Reputation: 8178
In JSON-LD the @type
shows up not just at the top level, but in the contactPoint
property. Why is it needed if the context is already provided?
<script type="application/ld+json">
{ "@context" : "http://schema.org",
"@type" : "Organization",
"url" : "http://www.your-company-site.com",
"contactPoint" : [
{ "@type" : "ContactPoint",
"telephone" : "+1-401-555-1212",
"contactType" : "customer service"
}
]
}
</script>
Doesn't the parser know from the context and the first @type
line that we're working with an organization, and so the property contactPoint
is meant to have that type of object in it? Otherwise, can I rename that property to just contact
and then specifying the @type
should inform what it is? The example seems redundant to me. Maybe I'm misunderstanding something about how JSON-LD is working here.
Upvotes: 2
Views: 481
Reputation: 96607
Schema.org does not require which values a property can have. It lists the expected values, but authors don’t have to follow that, it’s just a recommendation.
For example, the expected value of the contactPoint
property is an entity with the ContactPoint
type. But it’s possible to use a string or a URL value instead (strictly speaking even a Thing
item, or any other type).
Even if you would always follow the recommendation and use the expected type, it’s still not necessarily clear which type you mean, because
itemOffered
expects Product
or Service
)Upvotes: 3