Best practices says that
JSON documents may be in the form of a object, or an array of objects. For most purposes, developers need a single entry point, so the JSON SHOULD be in the form of a single top-level object.
This seems to me to be encouraging the idea that the top-level object in a JSON-LD document has some special significance, say that it might be where processing should start. This works fine for RDF-unaware components but, when the JSON-LD document has been converted into RDF, how do I tell which node is the top-level object? Is the RDF-unaware component attaching significance to something that has no semantic footprint?
Some possible solutions I am considering:
- Ask the RDF-unaware client to mark the root node for me (e.g.
rdf:type my:RootNode
) - Find the blank node (subject) that never appears as an object (and hope there is exactly one).
- Load the JSON-LD as JSON, and do (1) myself before parsing, hoping that the JSON-LD is always in just the right form.