Re: Representing RDF Literals/Resources as JSON Strings

> With JSON all (simple or primitive) values are (double) quoted strings. One
> possibile syntax might be the following:
> 
>       1. quotedString = '"' string '"'
> 
>       2. datatypeString = ??
> 
>       3. uriref = '"' '<' uri '>' '"'


if im interpreting this right, this means a http://example.org URI would be "<http://example.org>" ambiguous whether it should be handled as a URI or a string. unless youre just filtering on /^<http\S+>$/ in which case you can lose the <> s. which is what i do,

right now, in N3 (apologize if this isnt syntactically correct, ive never written N3)

<http://somethin.org> <http://something.org/someprop> "yeah, i havent figured it out"
<http://somethin.org> <http://something.org/someprop> "omg., a solution!"

turns into

{ uri: "http://somethin.org",
  "http://somethin.org/someprop" : ["yeah, i havent figured it out", "omg., a solution!"] }


if the literal-regex overhead ever gets annoying i'll proably turn the literals into bonafide objects, with an appropriate datatype attribute..

whats a qname?


i chose this format since it was pretty much what Simile does (i thought i was going to use Exhibit/Potluck/Timegrid, but it turns out it chokes on object IDs that arent basic strings, or something (its expression/query engine having the same limitations), requiring extra data massaging and lookup tables all to use 250K of code that doesnt really do much), its pretty similar to freebase's format, and the objects can be tossed around without regard to anything outside of them, are easy to store/index in JS hash tables, etc. 

this assumes you want one resource per JSON object. for triples, 
[["http://somesubject","http://someprop","some val"],
 ["http://somesubject","http://someprop","anotherval"]]


as usual 'works for me'..

Received on Thursday, 7 June 2007 02:27:07 UTC