Skip to content

Upsert of RDF text: blank-node identity that doesn't depend on how the document is spelled #2091

Open

Description

@aaj3f

Since #2008, an upsert of Turtle or TriG identifies the document's blank nodes by its parsed statements rather than their order, so re-upserting the same document commits nothing, and an IRI written in full or as a prefixed name, or a string in single or double quotes, gives the same identity. Other differences in spelling still give a new identity, and so new blank nodes: a number or boolean written bare or as a typed literal (1 vs "1"^^xsd:integer), a language tag's case, a statement written twice, a renamed blank-node label, and, since anonymous [ ] nodes are numbered in document order, moving statements that contain them relative to each other. A model file of SHACL property shapes written as blank nodes is the shape that feels this most.

  • Hash literals as stored. A literal by its value (1 and "1"^^xsd:integer are one, as are 1.0 and 1.00, and a language tag in any case), and a statement written twice counted once.
  • Identify blank nodes by canonical labels (RDF Dataset Canonicalization, RDFC-1.0), so the identity depends on the graph and not on its labels or the order of anonymous nodes. RDFC-1.0 has a known worst case on pathological graphs, so it wants a work bound (with today's identity as the fallback past it), and a measurement on blank-node-heavy documents, since it sits on the upsert path.
  • Changing the identity re-mints a document's blank nodes once, on the first upsert after upgrading, as fix(transact): retractions name stored facts; RDF text is parsed once #2008's change did, so it needs the same upgrade note and the orphan query in turtle.md.

From the review of #2008 (blank-node identity of RDF text).

Activity

  1. added
    enhancement
    P3
    area:transact
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:transactenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions