schemaorg / schemaorg

Schema.org - schemas and supporting software
https://schema.org/
Apache License 2.0
5.37k stars 821 forks source link

National language markup in schema.org #1313

Open jaygray0919 opened 8 years ago

jaygray0919 commented 8 years ago

Here are two sample markups of a single WikiData item in two languages: en-us (English-US) and es (Spanish).

Here is a reference: https://github.com/schemaorg/schemaorg/issues/1079

The advantage of the "Two-Script" sample is that url and sameAs are linked to their respective language.

The disadvantage of the "One-Script" sample is that it's not clear which url is linked to its language (per the above GitHub link and related links).

Which is the preferred way?

Is there a better way to build a Glossary of Terms where each term is marked-up in the chosen National Languages?

<script type="application/ld+json" id="">
{
    "@context": "http://schema.org/",
    "@type": "DataFeed",
    "@id": "https://www.wikidata.org/wiki/Q83323",
    "inLanguage": "en-us",
    "name": "Fertilizer",
    "url": "https://en.wikipedia.org/wiki/Fertilizer",
    "sameAs": "http://dbpedia.org/page/Fertilizer",
    "description": "A fertilizer is any material of natural or synthetic origin (other than liming materials) that is applied to soils or to plant tissues usually leaves) to supply one or more plant nutrients essential to the growth of plants."
}
</script>

<script type="application/ld+json" id="">
{
    "@context": "http://schema.org/",
    "@type": "DataFeed",
    "@id": "https://www.wikidata.org/wiki/Q83323",
    "inLanguage": "es",
    "name": "Fertilizante",
    "url": "https://es.wikipedia.org/wiki/Fertilizante",
    "sameAs": "http://es.dbpedia.org/page/Fertilizante",
    "description": "Un fertilizante es un tipo de sustancia o denominados nutrientes, en formas químicas saludables y asimilables por las raíces de las plantas, para mantener o incrementar el contenido de estos elementos en el suelo. Las plantas no necesitan compuestos complejos, del tipo de las vitaminas o los aminoácidos, esenciales en la nutrición humana, pues sintetizan todo lo que precisan. Sólo exigen una docena de elementos químicos, que deben presentarse en una forma que la planta pueda absorber."
}
</script>
<script type="application/ld+json" id="">
{
    "@context": "http://schema.org/",
    "@type": "DataFeed",
    "@id": "https://www.wikidata.org/wiki/Q83323",
    "name": [{
        "@language": "en",
        "@value": "Fertilizer"
        },{
        "@language": "es",
        "@value": "Fertilizante"
        }
    ],
    "description": [{
        "@language": "en",
        "@value": "A fertilizer is any material of natural or synthetic origin (other than liming materials) that is applied to soils or to plant tissues usually leaves) to supply one or more plant nutrients essential to the growth of plants."
        },{
        "@language": "es",
        "@value": "Un fertilizante es un tipo de sustancia o denominados nutrientes, en formas químicas saludables y asimilables por las raíces de las plantas, para mantener o incrementar el contenido de estos elementos en el suelo. Las plantas no necesitan compuestos complejos, del tipo de las vitaminas o los aminoácidos, esenciales en la nutrición humana, pues sintetizan todo lo que precisan. Sólo exigen una docena de elementos químicos, que deben presentarse en una forma que la planta pueda absorber."
        }
    ],
    "url": ["https://en.wikipedia.org/wiki/Fertilizer", "https://es.wikipedia.org/wiki/Fertilizante"],
    "sameAs": ["http://dbpedia.org/page/Fertilizer", "http://es.dbpedia.org/page/Fertilizante"]
}
</script>
danbri commented 8 years ago

I'm not understanding the reference to nations here. Isn't this more about identifying languages than countries?

jaygray0919 commented 8 years ago

I should have used more conversational language.

"National language" implementations often mean that a solution support 2+ spoken languages (https://msdn.microsoft.com/en-us/library/windows/desktop/dd319078(v=vs.85).aspx).

So yes Dan I had intended to ask: what's the best way to markup an item in English and Spanish (and German, etc.).

The "Two script" example uses inLanguage for each language.

The "One Script" uses @language and @value.

/jay

chaals commented 7 years ago

I don't know off-hand what the various different tools make of it and I guess that's what you want to know in reality, but my instinct is to use the one-script model and rely on better understanding of JSON-LD over https://schema.org/inLanguage

github-actions[bot] commented 4 years ago

This issue is being tagged as Stale due to inactivity.