- From: john.walker <john.walker@semaku.com>
- Date: Fri, 9 May 2014 16:27:56 +0200 (CEST)
- To: public-linked-json@w3.org
Hi There,
I have a question about use of rdf:type in JSON-LD.
Take for example a simple SKOS tree loaded [1] to the playground:
http://json-ld.org/playground/index.html#json-ld=https%3A%2F%2Frawgit.com%2Fjaw111%2Fbbd1b00d656045ba8a2c%2Fraw%2Ftree.jsonld
All looks good.
Now I want to apply a JSON-LD frame [2] to this:
http://json-ld.org/playground/index.html#startTab=tab-framed&json-ld=https%3A%2F%2Frawgit.com%2Fjaw111%2Fbbd1b00d656045ba8a2c%2Fraw%2Ftree.jsonld&frame=https%3A%2F%2Frawgit.com%2Fjaw111%2Fbbd1b00d656045ba8a2c%2Fraw%2Fframe1.jsonld
In the result there is no content in the "@graph".
It seems that this is due to the use of "@type" in the JSON-LD frame, whereas
the JSON-LD input uses "http://www.w3.org/1999/02/22-rdf-syntax-ns#type".
Note that the input document is being generated from a SPARQL query, so I'm not
in control of how it is formed, it's just a simple serialization of the triples.
So a triple in question looks like:
{
"@id": "http://example.com/conceptSchemes/myTree",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {
"@id": "http://www.w3.org/2004/02/skos/core#ConceptScheme"
}
}
I would have thought the processor would somehow know that "@type" and
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type" are equivalent, but it seems
not.
If I modify the frame to use the full URI [3], it works as expected:
http://json-ld.org/playground/index.html#startTab=tab-framed&json-ld=https%3A%2F%2Frawgit.com%2Fjaw111%2Fbbd1b00d656045ba8a2c%2Fraw%2Ftree.jsonld&frame=https%3A%2F%2Frawgit.com%2Fjaw111%2Fbbd1b00d656045ba8a2c%2Fraw%2Fframe2.jsonld
So my questions:
- is this specified on way or another in the standard
- is this a problem in the processing in the playground, or
- should the relevant triples be formulated as follows in the JSON-LD input:
{
"@id": "http://example.com/conceptSchemes/myTree",
"@type": "http://www.w3.org/2004/02/skos/core#ConceptScheme"
}
Hope that is clear...
Cheers,
John
[1] https://rawgit.com/jaw111/bbd1b00d656045ba8a2c/raw/tree.jsonld
[2] https://rawgit.com/jaw111/bbd1b00d656045ba8a2c/raw/frame1.jsonld
[3] https://rawgit.com/jaw111/bbd1b00d656045ba8a2c/raw/frame2.jsonld
Received on Friday, 9 May 2014 14:28:18 UTC