Every locally authored node gets a fresh blank-node id ("_:" + uuid) when it is constructed, and a collection keeps those ids when it saves. Re-running the script that builds a dataset produces a new set of ids, so the same metadata written twice is two different graphs. Nothing in the library ties a node's identity to its content or to a user-chosen key.
The consequences land downstream: uploading a re-generated collection to the Knowledge Graph creates duplicates unless the KG layer has an existence query (fairgraph does, openminds-kg-sync does not, see ehennestad/openminds-kg-sync#7), and two exports of the same collection cannot be diffed without relabelling.
openMINDS_Python has the same behaviour (_:000000 counters per collection) and offers a Collection.generate_ids(id_generator) hook so a caller can assign real ids before upload. There is no equivalent here.
Proposal:
- Accept an explicit id at construction for every type (the generated constructors already take
id), and document that as the way to author stable metadata.
- Offer a deterministic id strategy on
Collection, for example an IRI derived from a user-supplied base plus the node's lookup label or content hash, applied before save.
- Keep blank nodes as the default for scratch work, but make the choice visible in the tutorial, since users hit the duplication only after they have uploaded twice.
🤖 Generated with Claude Code
Every locally authored node gets a fresh blank-node id (
"_:" + uuid) when it is constructed, and a collection keeps those ids when it saves. Re-running the script that builds a dataset produces a new set of ids, so the same metadata written twice is two different graphs. Nothing in the library ties a node's identity to its content or to a user-chosen key.The consequences land downstream: uploading a re-generated collection to the Knowledge Graph creates duplicates unless the KG layer has an existence query (fairgraph does, openminds-kg-sync does not, see ehennestad/openminds-kg-sync#7), and two exports of the same collection cannot be diffed without relabelling.
openMINDS_Python has the same behaviour (
_:000000counters per collection) and offers aCollection.generate_ids(id_generator)hook so a caller can assign real ids before upload. There is no equivalent here.Proposal:
id), and document that as the way to author stable metadata.Collection, for example an IRI derived from a user-supplied base plus the node's lookup label or content hash, applied before save.🤖 Generated with Claude Code