6

I'm working on a multiple-language website and I'm preparing Schema.org markups using JSON-LD. Important detail: this website uses subdirectories for languages. Let's consider 2 languages:

  • English: https://www.example.com/
  • French: https://www.example.com/fr/

I want to put Corporation and WebSite things on all localized HP. Everything goes fine but for @id, url and inLanguage properties: I don't quite know what I should fill.

For Corporation, I think I got it right: I'm going to use on all pages default url and base my @id on it:

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

But what would be the best move for WebSite properties, on my French HP? Technically speaking, /fr/ subfolder is part of the example.com/ domain. But then, @id, inLanguage and url are not telling my website is also available for French-speakers.

{
    "@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" ?
...

I searched a lot about this and found nothing on this particular matter. Does anyone have any experience on this?

unor
  • 92,415
  • 26
  • 211
  • 360
Alex - DJDB
  • 700
  • 2
  • 8
  • 19

1 Answers1

8

You have two different (albeit translated) websites. It shouldn’t matter that they share the same domain/hostname.

Each website should get its own WebSite item, with its own @id, url, and inLanguage values, while they would refer to the same Corporation item.

{
  "@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"}
}

If the websites are primarily translations, you could use workTranslation/translationOfWork to link the WebSite items.

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

(This is a good case to see why the WebSite items should have different @id values, because otherwise you couldn’t refer to their translations like that. Using the url value instead of the @id value wouldn’t be a good idea, because this URI typically represents the homepage, not the whole website.)

unor
  • 92,415
  • 26
  • 211
  • 360
  • Thank you for your answer !! I have learnt something very interesting thanks to your help. As you wrote, @id is very powerful. – Alex - DJDB Oct 17 '17 at 13:56