Graph serialization

Hello RDFJS,

I’ve been following the discussion over on SWIG about how bnodes are especially confusing for many developers (among other aspects of RDF). It seems people expect them to work like URIs (even I thought this briefly, and some tools I’ve used have also worked this way), but of course if we wanted the functionality of a URI, we’d just use a URI.

I was thinking one of the things that might make the behavior of bnodes more self-evident is if numbering, inside any given graph serialization, always started at zero. That is, when encoding a graph, doing so trying to use implicit/unlabeled bnodes (i.e. the square bracket syntax in Turtle), and number the remaining _:b0 through _:b{n-1}.

Right now when I'm serializing RDF triples into a document (especially Turtle) they’re being encoded with the internal bnode label, which is process-wide (instead of graph-specific), and might be re-used by other bnodes even though they’re technically different bnodes.

To to take an example, I’ve got a dataset of multiple graphs (generated from multiple RDFa documents, but possibly also Turtle or other documents that allow labeled bnodes) that I’d like to merge [1] and make available in a Turtle file as a single graph.

[1]  Merge: <https://www.w3.org/TR/rdf11-mt/#shared-blank-nodes-unions-and-merges <https://www.w3.org/TR/rdf11-mt/#shared-blank-nodes-unions-and-merges>>

This means that, regardless of the label that the bnodes were minted with (or labeled with in their source documents), I’d like to make sure that bnodes that come from different graphs don’t share a label when I export them to a merged Turtle document. 

First, I’m looking for some way to serialize a graph without exposing the internal addressing of my blank nodes.

Second, I wonder what thoughts you have on bnode labeling with respect to making RDF more comprehensible.

Thanks,

Austin Wright.

Received on Tuesday, 18 December 2018 00:33:16 UTC