JSON-LD: What Is The Correct Syntax For The Report Schema Type?
I've used several JSON-LD formatting tools (Example 1, Example 2, Example 3), but none are so specific as to list the schema type Report
, and its property reportNumber
. The schema type is documented here, but without examples.
This page has been a helpful reference, but I still have uncertainty.
So I would like to know if the following syntax is correct, and what to change if it's not:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Report",
"reportNumber": "1234",
"headline": "Report Headline",
"description": "Report Description",
"image": "img.jpg",
"author": {
"@type": "Organization",
"name": "Org. Name",
"url": "example.com"
},
"publisher": {
"@type": "Organization",
"name": "Org. Name",
"logo": {
"@type": "ImageObject",
"url": "logo.svg"
}
},
"datePublished": "2021-11-24",
"dateModified": "2021-11-24"
}
</script>
I just swapped the type Article
for Report
. It appears to me that Report
is a subset of the Article
type, making properties like headline
and description
still valid, but in addition, making the property reportNumber
valid. I'm new to JSON-LD.
Answer
It looks like you are doing it correctly. In JSON-LD you can use any of the properties of a class in any of its subclasses.
In order to validate your JSON-LD, I have used the Google's structured tool JSON-LD validator, available at https://validator.schema.org/. I think you may find it useful in the future.
Your snippet passed the tests with zero errors or warnings. Just be careful with "logo.svg", because it is a relative path.I would add the full URL to your logo. The same applies for img.jpg
Related Questions
- → How do I call the value from another backed page form and use it on a component in OctoberCms
- → Inline JS callback syntax Vs Internal JS callback syntax
- → Prevent form action from being followed by robots
- → How to remove parameters from the root URL if it does I18n
- → SEO Canonical URL in Greek characters
- → Htaccess negation
- → Wrapping anchor elements with text
- → Adding schema.org to site
- → dynamic php title depends on page id and using of "if (isset"
- → Building sitemap for 2 wordpress install under 1 domain
- → Bigcommerce Repeating url
- → 301 Redirection from no-www to www in wordpress
- → Wrapper inside or outside HTML5 semantics main, which is best practice?