Description
Although JSON-LD allows the expression of named graphs, the documents don't really describe the notion of a Dataset. I think we do need to talk about datasets, as this is at least required to align with RDF Concepts. However, the issue goes a bit deeper.
Generally, and RDF document expression a graph can be used to define the contents of a named graph, for example in SPARL as follows:
FROM <path/to/json-ld/doc.json-ld
FROM NAMED <path/to/another/json-ld/doc.jsonld>
In this case, each is presumed to be the serialization of a specific graph, and are either added to the default graph or a named graph depending on the use of FROM
or FROM NAMED
.
JSON-LD is different from TriG, in that it can't be determined simply by knowing the document type, whether it serializes a single graph or a Dataset. It's not clear to me how Dataset serializations are used in the context of SPARQL, as they are typically used to transfer an entire dataset, and not just a single graph.
PROPOSAL: normatively define the concept of a JSON-LD Dataset. In the context of a Dataset, a JSON-LD document including only a default graph serializes a Dataset with only a default graph. A JSON-LD document describing a default graph and/or one or more named graphs serializes a Dataset with default and named graphs.
PROPOSAL: define an alternate extension and mime-type for describing JSON-LD documents serializing Datasets, as distinct from the existing type which serializes a single graph. Named graphs used within a graph serialization are flattened into a single graph, and produce only a single graph when parsed.