JSON-LD: @id values and relative URI reference value

138 views
Skip to first unread message

Graham Klyne

unread,
Oct 21, 2015, 7:28:34 AM10/21/15
to rdflib-dev
I've just posted an issue for the json-ld parser at https://github.com/RDFLib/rdflib-jsonld/issues/33

...

I have a workaround that works for me at the moment, which is to include the base URI in a context file, but I think this is contrary to the JSON-LD spec.

My understanding about JSON-LD and relative references appearing in various places is that:

(a) they should be resolved against the current base URI (per RFC3986)

(b) the default base URI is the URI of the containing document, which I supply through the publicId parameter lot the graph.parse(0 method.

(c) the default base URI may be overridden by @base in the source document, which may also appear in any internal (inline) context data.  The @base value itself may be a relative reference that is resolved against the previous base URI.

(d) @base URIs that appear in referenced external context descriptions should not be applied to the referencing source document.

Much of this is based only reading of the JSON-LD syntax document (http://www.w3.org/TR/json-ld/, section 6.1) and  API document (http://www.w3.org/TR/json-ld-api/, sections 6.1, 6.3, 7.2), but these specs are written largely in pseudo-code style which I find is very hard to understand.

Am I missing something here?

#g

Reply all
Reply to author
Forward
0 new messages