1

我工作的一个多语言的网站,我准备使用JSON-LD Schema.org标记。重要细节:本网站使用语言的子目录。让我们考虑两种语言:Schema.org的网站,多国语言:灌装公司和网站的事情吧

  • 英语:https://www.example.com/
  • 法国:https://www.example.com/fr/

我想把CorporationWebSite东西上所有本地化HP。一切顺利但@idurlinLanguage属性:我不太知道我应该填什么。

对于Corporation,我想我猜中了:我要在所有页面的默认URL中使用,并在其基础我@id

{ 
    "@context": "http://schema.org", 
    "@type": "Corporation", 
    "@id": "https://www.example.com/#organization", 
    "name": "Example", 
    "url": "https://www.example.com/", 
... 

但是,什么是最好的移动性能WebSite,在我的法国HP上? 从技术上讲,/fr/子文件夹是example.com/域的一部分。但随后,@idinLanguageurl没有告诉我的网站也可用于讲法语的人。

{ 
    "@context": "http://schema.org", 
    "@type": "WebSite", 
    "@id": "https://www.example.com/#website", // should this be "https://www.example.com/fr/#website" ? 
    "name": "Example", 
    "url": "https://www.example.com/", // should this be "https://www.example.com/fr/" ? 
    "inLanguage": "en", // should this be "fr" ? 
... 

我搜索了很多关于这方面的信息,并没有在这个特定的问题上找到任何东西。 有没有人有这方面的经验?

回答

2

你有两个different (albeit translated)网站。它们共享相同的域/主机名应该没有关系。

每个网站应该得到自己的WebSite项目,有自己的@idurlinLanguage值,而他们会指向同一个Corporation项目。

{ 
    "@context": "http://schema.org", 
    "@type": "WebSite", 
    "@id": "https://www.example.com/#website", 
    "url": "https://www.example.com/", 
    "inLanguage": "en", 
    "publisher": {"@id": "https://www.example.com/#organization"} 
} 
{ 
    "@context": "http://schema.org", 
    "@type": "WebSite", 
    "@id": "https://www.example.com/fr/#website", 
    "url": "https://www.example.com/fr/", 
    "inLanguage": "fr", 
    "publisher": {"@id": "https://www.example.com/#organization"} 
} 

如果网站主要是翻译,你可以使用workTranslation/translationOfWork链接的WebSite项目。

"workTranslation": {"@id": "https://www.example.com/fr/#website"} 
"translationOfWork": {"@id": "https://www.example.com/#website"} 

(这是一个很好的例子,看看为什么WebSite项目应该有不同的@id值,因为否则你不是指他们的翻译这样的。使用url值而不是@id值不会是一个好主意,因为这URI typically represents the homepage, not the whole website。)

+0

谢谢您的回答!感谢您的帮助,我学到了非常有趣的东西。正如你写的,@id非常强大。 –