问题原文
原帖链接 · StuFu · CC BY-SA 4.0
I'm wondering what the effects/benefits/issues are with linking Website and Organization structured data (specifically in JSON-LD).
On the homepage of my site I have something like this:
<script type='application/ld+json'>
[{
"@context":"http://schema.org",
"@type":"Organization",
"@id":"https://example.com/",
"url":"http://example.com",
"name":"My site",
"logo":"https://example.com/logo.jpg",
"sameAs": [
"https://www.facebook.com/example/",
"https://twitter.com/example"
]},
{
"@context":"http://schema.org",
"@type":"WebSite",
"@id":"https://example.com/",
"url":"https://example.com",
"name":"My Site",
"potentialAction":{
"@type":"SearchAction",
"target":"https://example.com?searchQuery={search_term_string}",
"query-input":"required name=search_term_string"
}
}]
</script>
In this case I've connected the Website and Organization with the same ID. I've noticed in the Structured Data Tool, Google will combine this into one data type:
I'm using Website for the potential benefits of the site search box and I'm using Organization for the benefits of contact point and linking to social accounts.
My question is: is this a good idea? Is there any reason to not connect these two items in structured data? What implications are there to link these items vs. keeping them as separate IDs?
已采纳解答
原帖链接 · unor · CC BY-SA 4.0
Same @id?
If items have the same @id, they are the same. These two snippets are semantically equivalent:
[
{
"@context": "http://schema.org",
"@type": "Organization",
"@id": "https://example.com/"
},
{
"@context": "http://schema.org",
"@type": "WebSite",
"@id": "https://example.com/"
}
]
{
"@context": "http://schema.org",
"@type": ["Organization", "WebSite"],
"@id": "https://example.com/"
}
But are the organization and its website the same thing? I would say no. Examples that show why these are different entities:
Others might want to make statements only about the website or only about the organization. For example, if someone states
<#i> ex:likes <https://example.com/> ., maybe they actually only like the website, but not the organization. If both were the same, it wouldn’t be possible to differentiate.An organization might have multiple websites (e.g., per language), but if the organization and all of its websites would be the same entity, it would not be possible to associate the different
urlvalues with the correspondinginLanguagevalues. Each language version should get its ownWebSiteitem (example).
A different @id for each thing
I would recommend to give your Organization its own @id, for example:
{
"@type": "Organization",
"@id": "https://example.com/#org",
"url": "https://example.com/"
}
If you want to go the extra mile, you could even give your WebSite its own @id, so that it can be differentiated from the homepage:
{
"@type": "WebSite",
"@id": "https://example.com/#site",
"url": "https://example.com/"
}
{
"@type": "WebPage",
"@id": "https://example.com/",
"url": "https://example.com/"
}
Linking Organization and WebSite
You can associate the organization and its website(s) with suitable properties like author/creator, copyrightHolder, and/or publisher, as well as mainEntity/about.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
