Re: Is this valid JSON-LD?

Ah! I did not realize this.

Here is how I hit this. I do an RDFa->JSON-LD conversion (via RDFLib as an intermediate RDF toolkit), and I would like the beautify the output. If the user in RDFa does


<span rel="http://www.ex.org/prop" resource="http://a.b.c"/>
<span rel="http://www.ex.org/prop" resource="http://p.q.r"/>

and there are no prefixes (or vocab) defined in the original source.

A simple json-ld is of course

{
  "http://www.ex.org/prop" { "@id" : "http://a.b.c" } ,
  "http://www.ex.org/prop" { "@id" : "http://p.q.r" } 
}

but, to make it cleaner, it would be nice if I could say

{
  "@context" {
     "http://www.ex.org/prop" : { "@type" : "@id" }
  }
  "http://www.ex.org/prop"  : "http://a.b.c" ,
  "http://www.ex.org/prop"  : "http://p.q.r"
}
 
Which would require to have the URI as a key. 

Bottom line: I am very much in favour allowing this.

Ivan





On Jan 11, 2012, at 13:21 , Markus Lanthaler wrote:

> Ivan, this is ISSUE-43 which is currently being discussed. See:
> https://github.com/json-ld/json-ld.org/issues/43
> 
> 
> --
> Markus Lanthaler
> @markuslanthaler
> 
> 
> 
> 
>> -----Original Message-----
>> From: Ivan Herman [mailto:ivan@w3.org]
>> Sent: Wednesday, January 11, 2012 8:07 PM
>> To: Linked JSON
>> Subject: Is this valid JSON-LD?
>> 
>> Something that I have not seen anywhere in the document:
>> 
>> {
>>  "@context" : {
>>     "http://www.example.org/pred" : { "@type" : "@id" }
>>   },
>>   ...
>>   "http://www.example.org/pred" : "http://ivan-herman.net"
>>   ...
>> }
>> 
>> yielding
>> 
>> [ <http://www.example.org/pred> <http://ivan-herman.net> ]
>> 
>> I would expect the answer to be yes, but there is nowhere a more formal
>> definition of @context that would give me straight answer.
>> 
>> This (and my question yesterday on the "@id" : [...] idiom) reinforces
>> my feeling that a somewhat more formal definition of the various json-
>> ld structures would be welcome in my view.
>> 
>> Thanks
>> 
>> Ivan
>> 
>> 
>> ----
>> Ivan Herman, W3C Semantic Web Activity Lead
>> Home: http://www.w3.org/People/Ivan/
>> mobile: +31-641044153
>> FOAF: http://www.ivan-herman.net/foaf.rdf
>> 
>> 
>> 
>> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Wednesday, 11 January 2012 13:43:27 UTC