What to do
Merge fix/bnode-identity-in-triples-update into main, and include it in the next release.
The branch currently lives only on the SAWeindel/graph_db_interface fork, at e659da1. It is
3 commits ahead of main and 0 behind, so the merge is a fast-forward and conflict-free:
| Commit |
|
34dac9e |
Fix IRI validator rejecting URLs with ports |
65157c5 |
Generalize triples_update to atomic add/remove/replace (unequal lengths) |
e659da1 |
Keep blank-node identity across triples_update |
Why it matters downstream
kapps_ogm's OGM.commit feeds the output of Node.diff straight to triples_update. A diff is a
set difference, so the removed and added lists are almost never the same length — but published
2.0.1 still enforces:
if len(old_triples) != len(new_triples):
raise InvalidInputError("Old and new triples lists must have the same length.")
So on a clean install from kapps_ogm's manifest, every commit that adds and removes a
different number of triples fails with Exception: Failed to update instance in database.
Reproduced with scripts/demo_from_data.py, which exercises a simple-attribute update, a
complex-attribute replacement and a complex-attribute addition in one commit:
Diff for before_update: <empty> <- create + fetch round-trips fine
InvalidInputError: Old and new triples lists must have the same length.
With this branch installed instead, the same demo completes and both diffs are empty.
e659da1 is also requirement R11 of docs/prd/kapps-ogm-anonymous-node-identity.md in
EHoffm/kapps_semantic_middleware: triples_update must build one blank-node-to-variable map
shared across the DELETE and INSERT patterns, so a BNode appearing on both sides renders as the
same variable rather than being re-minted.
Interim state
kapps_ogm has pinned its dependency directly at this branch so development can continue
(SAWeindel/kapps_ogm#23 tracks reverting that pin once a release exists). That pin is a
stopgap — it makes kapps_ogm unpublishable and non-reproducible while it stands.
The next release is expected to carry further revisions beyond this branch; this ticket asks only
that these three commits are part of whatever that release turns out to be, not that a release be
cut immediately.
Acceptance criteria
What to do
Merge
fix/bnode-identity-in-triples-updateintomain, and include it in the next release.The branch currently lives only on the
SAWeindel/graph_db_interfacefork, ate659da1. It is3 commits ahead of
mainand 0 behind, so the merge is a fast-forward and conflict-free:34dac9e65157c5triples_updateto atomic add/remove/replace (unequal lengths)e659da1triples_updateWhy it matters downstream
kapps_ogm'sOGM.commitfeeds the output ofNode.diffstraight totriples_update. A diff is aset difference, so the removed and added lists are almost never the same length — but published
2.0.1still enforces:So on a clean install from
kapps_ogm's manifest, every commit that adds and removes adifferent number of triples fails with
Exception: Failed to update instance in database.Reproduced with
scripts/demo_from_data.py, which exercises a simple-attribute update, acomplex-attribute replacement and a complex-attribute addition in one commit:
With this branch installed instead, the same demo completes and both diffs are empty.
e659da1is also requirement R11 ofdocs/prd/kapps-ogm-anonymous-node-identity.mdinEHoffm/kapps_semantic_middleware:triples_updatemust build one blank-node-to-variable mapshared across the DELETE and INSERT patterns, so a
BNodeappearing on both sides renders as thesame variable rather than being re-minted.
Interim state
kapps_ogmhas pinned its dependency directly at this branch so development can continue(
SAWeindel/kapps_ogm#23tracks reverting that pin once a release exists). That pin is astopgap — it makes
kapps_ogmunpublishable and non-reproducible while it stands.The next release is expected to carry further revisions beyond this branch; this ticket asks only
that these three commits are part of whatever that release turns out to be, not that a release be
cut immediately.
Acceptance criteria
fix/bnode-identity-in-triples-updateis merged intomain.triples_update— more triples added than removed, and the reverse —so the equal-length constraint cannot silently return.
BNodepresent on both the old and the new side renders as one variable.triples_updatewidens rather than breaks its contract.