Knowledge graph modeling · a working brief

How a graph records what happened.

Two things an enterprise knowledge graph must model beyond the facts: the workflows that produce and transform them, and the provenance that says where each came from. Both rest on one small backbone — entity, activity, agent — so the graph can explain and defend itself.

W3C PROV-O · P-Plan domain & data workflows for ontologists & data engineers

The argument, up front

Thesis

Every fact in an enterprise graph should be able to answer two questions: where did you come from, and by what process? Provenance records the answer; workflows are the processes — both the business processes the graph describes and the pipelines that build it. Model the process as data, on the same entity–activity–agent backbone, and the graph explains itself.

A graph of bare assertions is untrustworthy the moment it feeds a decision: no one can tell whether a figure came from a system of record or a guess, whether it is current or stale, asserted or inferred, or who is accountable for it. Provenance and workflow modeling turn those unknowns into queryable data. The good news is that one W3C vocabulary — PROV-O — carries most of the weight, and the same three concepts describe a claims-handling process and a nightly data pipeline alike.

This brief connects to three others: it is the queryable form of the lineage the enterprise strategy and the source-mapping strategy call for, and it shares its version-chain machinery with ontology versioning.

01 — TWO WORKFLOWS, ONE BACKBONE

Domain processes, data pipelines — same shape

“Workflow” means two different things in a knowledge graph, and it helps to name them before modeling either. Both reduce to the same pattern: an activity uses some entities and produces others, run by an agent following a plan.

Sense 1 · the world the graph describes

Domain workflows

Business processes that are content: a customer order’s fulfillment, a claim’s lifecycle, a loan approval. The graph models the states, events, actors and artifacts so you can ask “what happened to this case, and when?”

Sense 2 · how the graph is built

Data workflows

The pipelines that produce and maintain the graph: ingestion, mapping runs, entity resolution, inference, materialization. Their execution trace is the graph’s provenance — “which run produced this triple, from what?”

Entity a fact, a decision Activity a run, a process step Agent person / software wasGeneratedBy used wasAttributedTo wasAssociatedWith wasDerivedFrom
Three classes, a handful of relations. Everything else in provenance — time, roles, plans, delegation — hangs off this triangle. A claims decision and a mapping run are both prov:Activity instances; a policyholder and an ETL engine are both prov:Agent instances.
02 — THE BACKBONE

PROV-O: entity, activity, agent

PROV-O is the W3C Recommendation for provenance on the Web. Learn these dozen terms and you can model most of what an enterprise graph needs.

TermKindMeaning
prov:EntityclassA thing with provenance — a datum, a document, a claim, a decision.
prov:ActivityclassSomething that occurred over time and acted on entities.
prov:AgentclassWho or what is responsible — Person, Organization, SoftwareAgent.
prov:wasGeneratedByentity → activityThe activity that produced this entity.
prov:usedactivity → entityThe inputs an activity consumed.
prov:wasAssociatedWithactivity → agentThe agent that carried the activity out.
prov:wasAttributedToentity → agentThe agent responsible for an entity.
prov:wasDerivedFromentity → entityLineage: this was built from that.
prov:wasInformedByactivity → activityOne activity enabled another (a chain of steps).
prov:actedOnBehalfOfagent → agentDelegation — an adjuster acting for an insurer.
prov:startedAtTime / endedAtTime / generatedAtTimetimeWhen an activity ran, or an entity came to be.
prov:qualifiedAssociationprov:Association (prov:hadPlan, prov:hadRole)detailThe “qualified” pattern: attach the plan followed and the role played to a relationship.

Retrospective provenance of a claim decision

@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix ex:   <https://example.org/resource/> .

ex:decision-9001 a prov:Entity, claim:Decision ;
    prov:wasGeneratedBy  ex:adjudication-run-42 ;
    prov:wasAttributedTo ex:adjuster-jsmith ;
    prov:wasDerivedFrom  ex:CLM-1001, ex:POL-500 ;                 # lineage
    prov:generatedAtTime "2026-02-01T16:20:00Z"^^xsd:dateTime .

ex:adjudication-run-42 a prov:Activity ;
    prov:used            ex:CLM-1001, ex:POL-500 ;
    prov:startedAtTime   "2026-02-01T16:00:00Z"^^xsd:dateTime ;
    prov:endedAtTime     "2026-02-01T16:20:00Z"^^xsd:dateTime ;
    prov:qualifiedAssociation [
        a prov:Association ;
        prov:agent   ex:adjuster-jsmith ;
        prov:hadRole ex:AdjudicatorRole ;
        prov:hadPlan ex:adjudication-plan-v3 ] .                   # the plan it followed

ex:adjuster-jsmith a prov:Person, prov:Agent .
03 — PLANS & EXECUTIONS

The recipe versus the run

Provenance has two tenses, and a mature graph models both. Confusing them — describing a process definition as if it were an execution — is the most common workflow-modeling mistake.

prospective

The plan (what should happen)

A reusable definition: the steps of claims adjudication, the stages of a mapping pipeline. Model it with prov:Plan, or in more detail with P-Planp-plan:Plan, p-plan:Step, p-plan:Variable, ordered by p-plan:isPrecededBy.

retrospective

The execution (what did happen)

A concrete trace: this claim, adjudicated at this time, by this agent. Model it with prov:Activity instances that link back to the plan via a qualified association’s prov:hadPlan.

Why keep both

The plan lets you ask “what is our adjudication process, and is it being followed?” The executions let you ask “how long did each step take, and where did this one deviate?” One definition is instantiated by many runs; linking each run to its plan version (a plan is a versioned entity — see versioning) is what makes process audit possible.

04 — MODELING DOMAIN WORKFLOWS

Business processes as content

The processes the business runs are first-class graph content. Three complementary patterns capture them; most domains use all three together.

  • Event-based — the lifecycle. Model each significant occurrence as a timestamped event — opened, closed, reopened, cancelled — each with an OWL-Time instant or interval. The ordered event stream is the workflow history.
  • State-based — the current status. Derive the present state from the latest event rather than storing a mutable flag, so status is always explainable by the events behind it — “the current status is whatever the most recent lifecycle event set it to.”
  • Activity-based — the accountable process. When you need to know who did what, using what, lift the step to a prov:Activity with an agent, inputs and outputs. An adjudication or an underwriting review is both a domain step and a provenance activity.

Events and provenance are the same story, told twice

A claim lifecycle event and a PROV activity describe the same happening at different altitudes: the event is the domain-facing record (“the claim was closed”), the activity is the accountability record (“the closing was performed by this adjuster, using this assessment, at this time”). Relate them — a domain event prov:wasGeneratedBy its activity — and one query can move from “what happened” to “who is responsible” without leaving the graph.

05 — MODELING DATA WORKFLOWS

The pipeline’s trace is the graph’s provenance

Every step that builds the graph — extraction, a mapping run, entity resolution, a reasoning pass, a materialization — is a prov:Activity that consumes inputs and generates graph data. Recording those runs answers the questions auditors and engineers ask most.

A mapping run, recorded against the graph it produced

@prefix prov: <http://www.w3.org/ns/prov#> .

# the triples this run produced live in their own named graph...
ex:graph/policy-src1 {
    ex:POL-500 a policy:Policy ; policy:policyNumber "POL-500" .
}
# ...and the named graph carries the provenance of the run
ex:graph/policy-src1
    prov:wasGeneratedBy ex:mapping-run-2026-05-01 .

ex:mapping-run-2026-05-01 a prov:Activity ;
    prov:used              ex:policy-extract-2026-05-01 ;
    prov:wasAssociatedWith ex:mapping-engine ;
    prov:endedAtTime       "2026-05-01T02:14:00Z"^^xsd:dateTime ;
    prov:qualifiedAssociation [
        a prov:Association ;
        prov:agent   ex:mapping-engine ;
        prov:hadPlan <https://example.org/mapping/policy/2.1.0> ] .  # the pinned mapping version

ex:mapping-engine a prov:SoftwareAgent .

Mark what the reasoner inferred

The most dangerous silent data is an inferred triple that looks asserted. Run inference as an activity and attribute its output to it, so a consumer can always separate “stated by a source” from “derived by a reasoner.” Trust decisions — and debugging — depend on being able to tell the two apart.

06 — WHERE PROVENANCE ATTACHES

Choosing the grain

Provenance can hang at four levels of granularity. Finer is more precise and more expensive; pick the coarsest level that answers your questions.

LevelMechanismAttach toUse when
DatasetDCAT / VoID + PROVthe dataset as a wholecatalog-level lineage, coarse trust
Named graphone graph per source/run; PROV on the graph IRIa bundle of triplesthe default — per-source, per-run lineage (the nanopublication pattern)
StatementRDF 1.2 triple terms (or reification)a single tripleper-fact source or confidence — e.g. entity-resolution links
Resourceprov:wasDerivedFrom / dct:sourceone individualsimple per-entity origin

Default to named graphs; reserve statement-level for when you must

Named graphs are the workhorse: put each source’s or run’s output in its own graph and attach the PROV there, and you get lineage for free on every triple inside without per-triple overhead. Drop to statement-level only where a single fact genuinely needs its own metadata — a match confidence on an identity link, a source on one contested value — using RDF 1.2 triple terms (see encoding). Provenance can easily outweigh the base data, so buy precision only where it pays.

07 — THE TIME DIMENSIONS

Three clocks, kept apart

Workflow and provenance modeling forces a distinction that flat data hides: an assertion has more than one time, and conflating them corrupts audit and history.

process time

When it was produced

When the activity ran and the entity came to be — prov:startedAtTime, endedAtTime, generatedAtTime.

valid time

When it is true in the world

The business interval a fact holds over — a coverage effective from–to. Model with OWL-Time intervals, independent of when it was recorded.

transaction time

When it was recorded

When the graph learned it. Together with valid time this gives bitemporality — “what did we believe was true, and as of when?”

revision

How it changed

Successive versions of an entity chained with prov:wasRevisionOf — the same machinery as ontology versioning, applied to data.

08 — WHAT IT BUYS

The questions this makes answerable

Provenance and workflow modeling are not documentation for its own sake — they exist to answer questions the business cannot otherwise ask of the graph.

lineage

Trace any value to its origin

“Which source, mapping and run produced this figure?” — the regulator’s question, answered by following wasGeneratedBy and wasDerivedFrom.

trust

Filter by source and recency

“Use only assertions from a system of record, after a date, excluding inferred triples.” Provenance turns trust into a query filter.

audit

Attribute every change

“Who or what changed this, and when, under whose authority?” — the accountability the activity–agent link records.

process analytics

Measure the workflows

Domain: “average time a claim spends open.” Data: “which mapping run introduced the bad values?” Both are just queries over recorded activities.

09 — IN PRACTICE

Recommendations

  • Use PROV-O as the backbone, and extend narrowly: P-Plan for process definitions, PAV / Dublin Core for authoring metadata, your domain events for the business lifecycle. Don’t invent a bespoke provenance model.
  • Make named graphs the default carrier of provenance; drop to statement-level (RDF 1.2 triple terms) only where a single fact truly needs its own metadata.
  • Emit provenance automatically. Pipelines should produce their PROV as a byproduct of running — hand-authored provenance is never complete and never trusted.
  • Separate provenance from base data in its own graphs. It can dwarf the facts it describes; partition it so it stays queryable without bloating everyday queries.
  • Let competency questions set the grain. Capture the provenance your lineage, trust and audit questions actually require — no finer. Regulated domains earn fine-grained capture; others do not.
  • Relate domain events to their activities, so one traversal crosses from “what happened” to “who is accountable and how it was produced.”

The one habit to keep

Whenever you assert a fact, ask: could someone downstream need to know where it came from or how it was made? If yes — and in an enterprise graph it usually is — record the activity and the agent, not just the result. A graph that remembers how it was made, and what it describes happening, is one that can be trusted, audited and improved.