Closed
Description
The idea of this issue is to set @container
of a property to @language
to allow L10n of JSON property values as shown in the following example:
{
"@context": {
"label": {
"@id": "http://example.com/label",
"@container": "@language"
}
},
"@id": "http://buckingham.uk/queenie",
"label": {
"en": "The Queen",
"de": "Die Koenigin"
}
}
When expanded, this should result in:
[
{
"@id": "http://buckingham.uk/queenie",
"http://example.com/label": [
{ "@value": "The Queen", "@language": "en" },
{ "@value": "Die Königin", "@language": "de" }
]
}
]
Compaction might be a bit trickier if there are other properties that are not language tagged for the same property. They either have to stay under the full IRI in that case or contain at least one keyword to be distinguishable from language maps, something like:
{
"@context": {
"label": {
"@id": "http://example.com/label",
"@container": "@language"
}
},
"@id": "http://buckingham.uk/queenie",
"label": [
{
"en": "The Queen",
"de": "Die Koenigin"
},
"No language",
5,
true,
{
"@id": "_:b1", <-- a keyword MUST be present to distinguish an object from a language map
"prop": value"
}
]
}
Something similar was discussed before under the term "language map" (#29) and came up again in a discussion Gregg had with @vrandezo. There has also been some discussion on the mailing list:
- http://lists.w3.org/Archives/Public/public-linked-json/2012Jun/0010.html
- http://lists.w3.org/Archives/Public/public-linked-json/2012Jun/0011.html
- http://lists.w3.org/Archives/Public/public-linked-json/2012Jun/0012.html
- http://lists.w3.org/Archives/Public/public-linked-json/2012Jun/0013.html
- http://lists.w3.org/Archives/Public/public-linked-json/2012Jun/0014.html
- http://lists.w3.org/Archives/Public/public-linked-json/2012Jun/0015.html
- http://lists.w3.org/Archives/Public/public-linked-json/2012Jun/0018.html
Gregg originally proposed to use something he called "folding" for this and #134:
{
"@context": {
"en": {"@id": null", "@language": "en", "@fold": true},
"de": {"@id": null", "@language": "de", "@fold": true},
"queenie": {"@id": null", "@fold": true}
},
"queenie": {
"@id": "http://buckingham.uk/queenie",
"label": {
"en": { "@value": "The Queen" },
"de": { "@value": "Die Königin"}
}
}
}