- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Sat, 8 Mar 2014 19:31:32 +0100
- To: <public-linked-json@w3.org>
- Cc: "'Jean-Claude Moissinac'" <jean-claude.moissinac@telecom-paristech.fr>
Hi Jean-Claude
On Saturday, March 08, 2014 7:17 PM, Jean-Claude Moissinac wrote:
> I'm trying to define a context for the following transformation
> and after reading and trying, I'm not able to get the result
> My source extract
> "http://www.w3.org/2000/01/rdf-schema#label": [
> {
> "@language": "fr",
> "@value": "memoriser"
> },
> {
> "@language": "en",
> "@value": "remember"
> }
> ],
>
> As you can see, it's a part of an OWL ontology transformed in json-ld
> I would like to get
> "label": [ "fr": "memoriser", "en": "remember" ],
What you are looking for are language maps [1]. Actually it's quite trivial... well, it always is if you know how to do it, right? :-) You just have to map "label" to rdfs:label and set its @container to @language. So the context would be
{
"@context": {
"label": {
"@id": "http://www.w3.org/2000/01/rdf-schema#label",
"@container": "@language"
}
}
}
Here's a direct link to the playground demonstrating it:
http://bit.ly/1g99PEm
HTH,
Markus
[1] http://www.w3.org/TR/json-ld/#string-internationalization
(see Example 34)
--
Markus Lanthaler
@markuslanthaler
Received on Saturday, 8 March 2014 18:32:04 UTC