Knowledge graphs · Field note

Identifiers that survive change: what I have learned designing IDs for knowledge graphs

When a knowledge graph goes wrong, the cause is rarely the query language or the database. It is usually identifiers: a code reused for something else, a URI that changed when a team renamed a product, two records silently merged into one. Identifiers are the part of a graph that everything else depends on, and the hardest to change later. These are the rules I now apply from day one.

Field noteSumanta Mukhopadhyay8 min read4 sources
#knowledge-graph#ontology#data
FIELD NOTE · KNOWLEDGE GRAPHS · FIELD NOTE1 Dec 2026 · 21:20 GST

Why identifiers fail

Struggling graph projects very often have an identifier problem underneath. The patterns repeat: product codes used as identifiers, then reused by the business for new products; local diagnosis codes used across hospitals that turn out to mean different things in each; URIs built from department names that break when the organisation changes. In each case the graph's logic was fine. The thing it hung everything on was not stable.

The advice is old. Tim Berners-Lee's note "Cool URIs don't change" argues that identifiers should be designed so they never need to change, which mostly means leaving out anything that might: names, organisational structure, technology2. The W3C's Data on the Web Best Practices make the same point for published data: use persistent URIs as identifiers and keep them stable across versions3. The hard part is applying it inside real systems with messy sources.

A model worth copying

The OMOP Standardized Vocabularies, used in health research worldwide, handle this well, and the pattern transfers to any domain. Each concept has a numeric primary key that means nothing in itself, alongside the source vocabulary and the code in that vocabulary, a validity period and a reason if it became invalid1.

Annotated concept record showing a numeric concept ID as primary key, an English name, domain, source vocabulary, concept class, standard flag, the code in the source vocabulary, a validity start and end date, and an invalid reason field
A concept record: a meaningless stable key, the source code kept as an attribute, and validity dates. Most of the rules below are visible here. Source: The Book of OHDSI, Standardized Vocabularies · CC0 1.0

When a source code changes or is retired, the concept is not deleted. It gets an end date and a reason, and mapping relationships point from old concepts to their replacements1. Analyses written years ago still resolve, and anyone following an old identifier can see what happened to it.

The rules I now apply

Identity
Minted stable IDmeaningless, never reused
Cross-references
Source codessystem, code, validityExternal IDsother registries
Lifecycle
Statusactive, deprecated, mergedReplaced bypointer to successor
Provenance
Who and whysource, process, time
Separate identity from everything that changes: codes, names, status and history each have their own place.

1. Mint your own identifiers, and make them meaningless. No names, no source codes, no team or product structure inside the identifier. Anything meaningful will eventually change.

2. Keep every source code as an attribute with its system and dates. "Code 123 in system X, valid from this date" is a fact about an entity, not its identity. Two systems can share a code; one system can reuse a code.

3. Never delete or reuse an identifier. Deprecate it, record why and point to the replacement. A dangling reference is better than a silently wrong one.

4. Make merges explicit. When entity resolution decides two records are one, keep both identifiers, mark one as merged into the other and record the evidence. Merges are sometimes wrong, and you need to be able to split them.

5. Record provenance on identity decisions. Which process created, merged or retired an identifier, when and from what source. The W3C PROV ontology gives a standard vocabulary for entities, activities and agents if you need one4.

6. Version the description, not the identifier. An entity's properties change; its identity should not. Publish versions of the data, keep the identifiers the same across them3.

Common shortcutWhat goes wrongInstead
Source code as IDReuse and collisions across systemsMinted ID plus coded attributes
Name in the URIRenames break linksOpaque path, name as a label
Delete on retirementOld references break silentlyDeprecate with a successor pointer
Merge by overwriteWrong merges cannot be undoneMerge record with evidence
New ID per versionEvery consumer must remapStable ID, versioned data

Identifier design is the cheapest decision to get right on day one and the most expensive to fix in year three. Spend the week.

How to retrofit an existing graph

  1. AuditFind where identifiers carry meaning, are reused or are derived from sources
  2. MintAssign stable identifiers to every entity, keeping old ones as aliases
  3. SeparateMove source codes into attributes with system and dates
  4. RedirectMake old identifiers resolve to the new ones
  5. LifecycleAdd status, successor and provenance to every identity change
  6. GuardValidate new data so the old patterns cannot return
Retrofit without breaking consumers: mint, keep aliases, redirect, then enforce.

Validation rules are what stop the old habits creeping back; I use shape constraints for this, as described in SHACL validation. Entity resolution, the usual source of merges, is covered in entity resolution for knowledge graphs, and hierarchy handling in materialise or infer.

The CTO's take

Identifiers look like plumbing, which is why they are delegated and then regretted. They are an architectural decision with a long tail: every system that integrates with the graph will copy them. Agree the rules early, write them down as part of the platform, and treat any request to "just use the code from the source system" as the design discussion it really is.

If you are building a knowledge graph or semantic layer and want it to last, I am a fractional CTO and AI architect based in India, the United States and the UAE, working globally. You can analyse your challenge and bring the result to a call.

References
  1. 1
  2. 2
    Cool URIs don't changeW3C (Tim Berners-Lee) · 1998
  3. 3
  4. 4
FAQ

Common questions

Should a knowledge graph use source system codes as identifiers?

Keep them, but not as the primary identity. Source codes change, get reused and collide across systems. Mint your own stable identifier and record each source code as an attribute with its system and validity period.

What should happen to an identifier when an entity is merged or retired?

Never delete or reuse it. Mark it as deprecated with a reason and a pointer to its replacement, so old references keep resolving and anyone following them can see what happened.

Do identifiers need to be URIs?

Not necessarily inside a database, but if the graph is shared or published, stable HTTP URIs that resolve to a description are a strong default, provided their structure does not encode things that change, such as team or product names.

Keep reading

Related

Open to advisory, fractional CTO & select builds

Let's talk about what you're building.

The fastest route is a free 30-minute call. Prefer to write? Send a message and I'll reply personally within two business days.

Start a conversation

How would you like to reach me?

Book a 30-min callFastest. Pick any open slot on my calendar.→ Write in GmailOpens a pre-filled draft in your browser.→ Use my email appOutlook, Apple Mail or your default client.→

I reply personally within two business days. Time zones from the Americas and Europe to the Middle East and Asia-Pacific.