json-ld/json-ld.org — Issue #43: Use of IRIs and CURIEs as @context keys
Author: gkellogg
Created: 2011-11-29 19:34:15+00:00
State: open
Labels: spec-design

In today's telco (http://json-ld.org/minutes/2011-11-29/) we discussed using using CURIEs in the key position within an @context object to describe @datatype coercion rules. This needs comes about because of the desire to fully utilize JSON-LD compact form in a generic RDF transformation without requiring a processor to automatically create term definitions. For example, consider the following expressed in Turtle:

@prefix foaf: .
@prefix xsd: .

a foaf:Person;
foaf:name "Gregg Kellogg";
foaf:homepage ;
foaf:birthday "1957-02-27"^^xsd:date .

I would like to be able to take advantage of the foaf:birthday range datatype in a JSON-LD representation; if the processor must automatically create a prefix (say, "foaf_birthday") there is some risk with colliding with a definition in another context. The rule would be that if the key is an NCName, it is taken as a term definition, otherwise normal IRI expansion rules apply. Allowing a CURIE to be used in the key position, could allow something such as the following:

{
"@context": {
"xsd": "http://www.w3.org/2001/XMLSchema#",
"foaf": "http://xmlns.com/foaf/0.1/",
"foaf:birthday": {"@coerce": "xsd:date"}
},
"@subject": "http://greggkellogg.net/foaf#me",
"@type": "foaf:Person",
"foaf:name": "Gregg Kellogg",
"foaf:birthday": "1957-02-27",
"foaf:homepage": "http://greggkellogg.net/"
}

This was also briefly discussed on the mailing list:

http://lists.w3.org/Archives/Public/public-linked-json/2011Nov/0041.html