Reputation: 43
I'm trying to accomplish machine-understandable relationship descriptions for companies/subsidiaries and their websites. Let's suppose there is one parent company with two subsidiaries, all of which have their own websites. I deploy one Organization
script, and one WebSite
script per home page.
The parent organization's JSON-LD reads:
<script type="application/ld+json">
{
"@context": "http://www.schema.org",
"@type": "Organization",
"@id": "https://www.parentorg.com/#organization",
"name": "Parent Org",
"legalName": "Parent Org Inc.",
"description": "Description of company",
"foundingDate": "1978",
"logo": "https://www.parentorg.com/images/logo.png",
"image": "https://www.parentorg.com/de/images/outside.jpg",
"url": "https://www.parentorg.com/",
"address": {
"@type": "PostalAddress",
"streetAddress": "Street 110",
"addressLocality": "City",
"postalCode": "XX XXX",
"addressCountry": "XX"
},
"contactPoint": {
"@type": "ContactPoint",
"contactType": "customer support",
"telephone": "+12-345-678-91011",
"email": "[email protected]"
},
"sameAs": [
"https://twitter.com/parentorg/",
"https://www.instagram.com/parentorg/",
"https://www.youtube.com/user/parentorg/",
"https://plus.google.com/parentorg"
],
"subOrganization": [
{
"@type": "Organization",
"@id": "https://www.subsidiary-one.de/#organization",
"name": "Subsidiary One"
},
{
"@type": "Organization",
"@id": "https://www.subsidiary-two.de/#organization",
"name": "Subsidiary Two"
}
]
}
</script>
The parent's website JSON-LD is:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"@id": "https://www.parentorg.com/#website",
"url": "https://www.parentorg.com/",
"author": {
"@type": "Organization",
"@id": "https://www.parentorg.com/#organization",
"name": "Parent Org"
}
}
</script>
And now the subsidiaries' organization JSON-LD contain a parentOrganization
property:
"parentOrganization": {
"@type": "Organization",
"@id": "https://www.parentorg.com/#organization",
"name": "Parent Org"
}
Would this be a good way to cross-reference those entities? And do I even need to write out the name
properties inside subOrganization
, parentOrganization
, and author
, when there are URIs referenced?
Upvotes: 4
Views: 2679
Reputation: 96697
Yes, you follow the best practice how to cross-reference entities (by giving each entity an @id
that is different from the url
).
You don’t have to provide additional properties when referencing entities, so this is fine:
"author": {"@id": "https://www.parentorg.com/#organization"}
"subOrganization": [
{"@id": "https://www.subsidiary-one.de/#organization"},
{"@id": "https://www.subsidiary-two.de/#organization"}
]
"parentOrganization": {"@id": "https://www.parentorg.com/#organization"}
However, this of course requires that consumers fetch the referenced documents. But not all do (probably). So if you want to provide data for those consumers, too, you could add properties in addition to the @id
. It could be just one, a few, or even all properties. I think the two from your example are the most important ones:
Providing @type
can also be useful for consumers that are capable of fetching documents, as it may allow them to decide whether the referenced resource is of interest to them before fetching it. For example, a consumer might only care about works author
ed by an Organization
, not by a Person
.
Providing the name
property can be useful for consumers that display the included structured data in some way that benefits from a name/label.
Upvotes: 3