JSON-LD Spec confusion

Hi, I've implemented a Ruby version of JSON-LD [1] and [2], and going through the spec I have some questions:

In processing step 2.1 for @context processing. The text indicates to merge each key-value pair into the active context. Is any processing performed on the values. For instance, could a value be a CURIE, or {"@iri": <value>}? Examples indicate that there is no such processing, and each value should be an absolute IRI. The wording makes this unclear.

Also in 2.1, for @coerce the doc says to merge each key-value mapping to the local context's @coerce mapping, overwriting duplicate values. In the case where a mapping is indicated to a list of properties (e.g., { "xsd:anyURI": ["foaf:homepage", "foaf:member"] }, does this overwrite a previous mapping of { "xsd:anyURI": "foaf:knows" }, or add to it. I've implemented it as being additive with replacements.

For value coercion, does the lookup happen on the lexical- or value-space of the property? For example, if a context defines "f": "http://xmlns.com/foaf/0.1/" is "f:age" coerced to xsd:integer? The default context currently coerces "foaf:age" to "xsd:integer". I presume the value-space is used for comparisons, so the mapping is based on an expanded URI, not the CURIE lexical value.

In 5.1 IRIs, the arithmetic requirements aren't laid out. I presume that for @vocab and CURIE expansion, it is treated as a string concatenation, for @base, it is treated like URI join (i.e., "@base": "http://example.com/foo", "@": "bar" results in <http://example.com/bar> not <http://eample.com/foobar>.

-- For my parser, I found it useful to automatically coerce rdf:type to xsd:anyURI, as "a" is semantic sugar for "rdf:type".

Regarding RDF List creation in 3.3, I found it to be simple enough, as the logic is pretty much the same as for Turtle. I think it's important that JSON allow for an RDF expression of ordered elements, and like it or not, the RDF List mechanism is the only viable one we have.

In 6.2 Type Coercion introduces @type, should this not be @coerce? The semantics are equivalent. It's also in an example in 8.3.3.

Gregg

[1] https://github.com/gkellogg/json-ld
[2] https://rubygems.org/gems/json-ld

Received on Monday, 9 May 2011 23:30:52 UTC