> ## Documentation Index
> Fetch the complete documentation index at: https://medlogprotocol.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Provenance and lineage tracking

> Representing MedLog records with W3C PROV, and linking them to institutional workflows with OpenLineage.

## W3C PROV

MedLog implementations can use the [W3C PROV](https://www.w3.org/TR/prov-o/) conceptual model to
distinguish data, activities, and responsible actors. A MedLog record and its fragments can be
represented as [`prov:Entity`](https://www.w3.org/TR/prov-o/#Entity) instances; the model invocation
itself as a [`prov:Activity`](https://www.w3.org/TR/prov-o/#Activity); and the model and user as
instances of [`prov:Agent`](https://www.w3.org/TR/prov-o/#Agent) or its subclasses, such as
[`prov:SoftwareAgent`](https://www.w3.org/TR/prov-o/#SoftwareAgent),
[`prov:Person`](https://www.w3.org/TR/prov-o/#Person), or
[`prov:Organization`](https://www.w3.org/TR/prov-o/#Organization).

| MedLog concept | PROV concept |
| - | - |
| MedLog record and its fragments | [`prov:Entity`](https://www.w3.org/TR/prov-o/#Entity) |
| Model invocation | [`prov:Activity`](https://www.w3.org/TR/prov-o/#Activity) |
| Model | [`prov:SoftwareAgent`](https://www.w3.org/TR/prov-o/#SoftwareAgent) |
| Human user | [`prov:Person`](https://www.w3.org/TR/prov-o/#Person) |
| Institution | [`prov:Organization`](https://www.w3.org/TR/prov-o/#Organization) |

Relations connect an invocation to its inputs, outputs, and participating actors.

| Relation | Connects an invocation to |
| - | - |
| [`prov:used`](https://www.w3.org/TR/prov-o/#used) | Its [inputs](/specification/inputs) |
| [`prov:wasGeneratedBy`](https://www.w3.org/TR/prov-o/#wasGeneratedBy) | Its [outputs](/specification/outputs) and [internal artifacts](/specification/internal-artifacts) |
| [`prov:wasAssociatedWith`](https://www.w3.org/TR/prov-o/#wasAssociatedWith) | The [users](/specification/user-identity) and models that participated |

## OpenLineage

[OpenLineage](https://openlineage.io/) can also be used to link AI interactions recorded in MedLog
records to broader institutional computational workflows. For example, an inference pipeline can be
represented as a **job**, with individual executions represented as **runs** and consumed or produced
data represented as **datasets**.

OpenLineage `runId` values can be referenced in the MedLog [Header](/specification/header) field,
allowing inference events to be linked to upstream data processing steps and downstream computational
outputs.

<Tip>
  Linking a `runId` into the header is what makes an inference event traceable in both directions: back
  to the data preparation that produced its inputs, and forward to the analyses that consume its
  outputs.
</Tip>
