Open gkellogg opened 1 year ago
In the meeting, we discussed the possibility of some kind of meta-record that could better control blank-node scope. This could be some kind of record with a directive that resets the blank node namespace between records, or records that form a header to the stream document itself that control such behavior for all records.
%meta bnode-space disjoint
{"@id": "_:b0", "p1": "v1"}
{"@id": "_:b0", "p2": "v2"}
In which the two records do not share the same blank node, even though the use the same identifier, or:
%meta bnode-space shared
{"@id": "_:b0", "p1": "v1"}
{"@id": "_:b0", "p2": "v2"}
In which both records share the same blank node. Perhaps something like %meta bnode-space reset
might be used between records to sever the shared space.
For JSON-LD, this would only really come into play when generating RDF, or flattening when blank nodes are renamed, and would be difficult to communicate through the API.
Similar thoughts about if each document describes its own disjoint dataset, or they are all considered sub-sets of a single dataset.
Easiest course would be to say that the stream format is intended for documents that all relate to the same dataset and blank node identifiers are shared across all documents within a stream.
@gkellogg — I think you intended for %meta bnode-space disjoint
to mean "the two records use the same label for different blank nodes, while %meta bnode-space shared
means "the two records use the same label for the same blank node"? If not, I'm entirely confused by what the two codeblocks are meant to mean.
Yes, something got lost in the original, I’ve updated the comment.
This format would require a separate definition for the meta record grammar.
Can this be a JSON record? Even more, can we have a JSON-LD context to define its meaning?
{"@context": "https://ndjson-ld.org/meta", "blank-nodes-scope": "global"}
On the call, I think we discussed that blank nodes would be scoped to each individual record, however this would make using this format in a manner similar to N-Quads unable to represent shared blank nodes.
Most serializations scope blank node identifiers to the file. In this reckoning:
could be semantically equivalent to:
Otherwise, there would be no way to state this using independent records.
Proposal: blank node labels are shared across all documents within a stream.