Re: [JSON] PROPOSAL: Syntax structure should be object-based

>> Sometimes it sounds more like "GRDDL for JSON".  The mapping isn't
>> universal - the generation of IRIs from data that has sufficiently
>> unique keys is application dependent, for example.
 >
> Yes, the mapping can't be universal. However, not because the unique
> keys are application dependent (you can always specify a default
> vocabulary to map each unknown unique key to... you could even say that
> you could use bnodes as predicates here). In RDFa, these unique keys can
> be given a prefix via @vocab... RDF in JSON could have the same
> mechanism that basically states: "If you can't find a mapping for a key,
> append it to this URI." For example:
>
> {
>     "#": { "@vocab": "http://example.org/foo#" },
>     "sparqly": "Andy Seaborne",
> }
>
> The above would create the following triple:
>
> _:bnode1<http://example.org/foo#sparqly>  "Andy Seaborne" .

That was not the point of my example.  The keys here are in the sense of 
database keys.  Subjects and objects need URIs for linking.

If we have:

{
   "employeeId":   "1234" ,
   "name"      :   "Alice"
}

and want the URI to be <http://company.com/employee/1234> then the 
"http://company.com/employee/" has to come from somewhere as does the 
rule for concatenation.

Maybe that happens by something "#" part

{ "#" : { "@gen": "http://company.com/employee/${name}", .. }

 Andy

Received on Thursday, 17 March 2011 08:51:29 UTC