Class ProvOExporter

java.lang.Object
ai.doctruth.internal.audit.ProvOExporter

public final class ProvOExporter extends Object
Render an ExtractionResult as W3C PROV-O JSON-LD. Single source of audit-format truth for the library — bumping the export format (e.g. switching to a different ontology vocabulary) is one file and one ADR.

Output shape:

{
  "@context": "https://www.w3.org/ns/prov",
  "@type": "prov:Entity",
  "doctruth:value": { ... },
  "doctruth:retries": 0,
  "doctruth:sourcePublishedAt": "2026-01-15T00:00:00Z",   // present iff bi-temporal set
  "prov:wasGeneratedBy": {
    "@type": "prov:Activity",
    "prov:startedAtTime": "2026-05-07T07:30:00Z",
    "prov:wasAssociatedWith": {
      "@type": "prov:SoftwareAgent",
      "rdfs:label": "anthropic",
      "prov:version": "claude-sonnet-4-5-20250929"
    }
  },
  "prov:wasDerivedFrom": [
    {
      "doctruth:fieldPath": "name",
      "prov:value": "Alex Chen",
      "doctruth:matchScore": 0.97,
      "doctruth:sourceLocation": {"pageStart": 1, "pageEnd": 1, "lineStart": 3, "lineEnd": 3, "charOffset": 0}
    }, ...
  ],
  "doctruth:confidence": {
    "name": {"score": 0.91, "rationale": "exact substring match"}, ...
  }
}