# OIP-0026: Export bindings and imagery provenance: DCAT and DCAT-AP, PROV-O, HXL and C2PA

| Field | Value |
|---|---|
| Status | DRAFT |
| Function | `exchange` (§5.10) and, for provider-side exports, `describe` (§5.3); no new function (the register keeps exactly twelve) |
| Requires | nothing for the bindings of DCAT, PROV-O and C2PA, which read objects already in the tree. The HXL binding names the `detection` object of OIP-0020 and the `alert-notice` object of OIP-0005 by name and needs them accepted first. The crosswalk round-trip layout (`source.<schema>.json` and `mapped.<id>.<ext>`) is the one OIP-0006 fixes; this proposal follows it and does not edit `crosswalks/README.md` |
| Affects | §6 (one paragraph after the wire-bindings table); `registers/relations.yaml` (`EXT-PROV` and `EXT-DCAT` gain `exchange`, profiles and their artefacts; new rows `EXT-HXL` and `EXT-C2PA`); `registers/implements-edges.json` and `registers/requirements.yaml` regenerated; new bindings `bindings/dcat/`, `bindings/prov-o/`, `bindings/hxl/`, `bindings/c2pa/`; new crosswalks `crosswalks/dcat.yaml` and `crosswalks/prov-o.yaml` with their examples; new cases CT-GRID-130 to CT-GRID-133, CT-PROVIDER-130, CT-CONSUMER-130 and CT-CONSUMER-131 (CT-GRID-130, CT-GRID-133 and CT-PROVIDER-130 automated by `binding-dcat-*` and `binding-c2pa-image` invariants, `sdk/python/src/obsp/inv_oip0026.py`; the other four manual) |
| Protocol version | obsp/0.1 |
| Last call | 30 days (bindings and crosswalks of existing objects, no new object) unless the editors rule otherwise |

## Problem

The protocol's records are readable by people who run the protocol. The people who need them most often do not: a
data portal lists datasets in DCAT, a provenance tool reads PROV, an aid organisation loads HXL-tagged tables into the
tools it already has, and a newsroom or an analyst handles an image, not a record. Four gaps follow.

1. **Catalogues.** A product manifest and a source manifest cannot be listed in a catalogue that speaks DCAT or the
   European DCAT-AP profile. Two operators who build the description by hand will disagree on identity, licence and
   coverage, and one of them will write a licence that the manifest never stated.
2. **Provenance.** The provenance bundle is PROV-O shaped but is not PROV-O. A tool that reads PROV cannot follow it, and
   nothing says what must survive a conversion.
3. **Humanitarian hand-off.** Detections (OIP-0020) and alert notices (OIP-0005) have no form that response
   organisations can load. A table made by hand drops the status of an exercise notice, writes zero for a value that is
   missing, or carries the people who were notified.
4. **Images.** A still or an EO quicklook leaves the protocol and loses its origin. The coalition format for that is C2PA
   Content Credentials, but an image signed with it says nothing a protocol reader can follow back to the product, its
   digest, its provenance and its receipts.

## Change

### Normative text (§6, after the wire-bindings table)

One paragraph, with no key word and so no new requirement id in the index: it names the four export bindings and says
that a publisher or consumer that names one is held to every requirement of that binding's profile. Each binding
follows `bindings/README.md`: `PROFILE.md`, `binding.yaml`, a machine-readable artefact, at least two positive and two
negative examples, and a test that keeps the examples honest. Standards are cited by identifier, edition and clause; no
standard's text, table or figure is copied; every mapping row is `checked: not checked` until a reviewer compares it
with the published edition.

| Binding | Standard (edition) | Artefact | Requirements |
|---|---|---|---|
| `bindings/dcat/` | W3C DCAT 3 and DCAT-AP (editions not checked) | `dataset.schema.json`, `context.jsonld`, `mapping.yaml` | BND-DCAT-01 to BND-DCAT-10 |
| `bindings/prov-o/` | W3C PROV-O, Recommendation 2013-04-30 | `graph.schema.json`, `context.jsonld`, `mapping.yaml` | BND-PROVO-01 to BND-PROVO-10 |
| `bindings/hxl/` | HXL Standard (edition not checked) | `mapping.yaml` | BND-HXL-01 to BND-HXL-11 |
| `bindings/c2pa/` | C2PA Technical Specification (edition 2.x, not checked) | `assertion.schema.json`, `outline.schema.json`, `mapping.yaml` | BND-C2PA-01 to BND-C2PA-11 |

What the bindings decide:

1. **DCAT and DCAT-AP.** A product manifest and a source manifest each become one `dcat:Dataset` (JSON-LD). Identity,
   title and publisher come from the manifest. A licence is written only where the manifest states one, never defaulted,
   and never for a source whose `rightsState` is not `APPROVED_FOR_SCOPE`; `rightsState` itself is never a licence or a
   rights term. Temporal and spatial coverage are written only where the manifest states them; the generation time is
   an issue date, not a coverage. Each output is a `dcat:Distribution`, with a checksum equal to the OBSP digest of the
   product version where the product has one output. The `dct:provenance` link carries the digest of the bundle. A
   withdrawn or recalled product is not exported as current. Because the live `product-manifest` has no licence, extent
   or description field, the binding reads the manifest `extensions` keys `export.licence`, `export.temporal` and
   `export.spatial` and takes the description from the publisher, until a later proposal adds the fields.
2. **PROV-O.** The bundle becomes one JSON-LD graph with a `prov:Bundle` node carrying the digest of the original, and
   one node per entity, activity and agent. Every relation is written unqualified and, where it carries a role, a time or
   an activity, also qualified; derivation kinds use `prov:wasRevisionOf`, `prov:wasQuotedFrom` and
   `prov:hadPrimarySource`. No statement is added. The export converts back to the bundle as a set of statements, with
   every field restored; a test proves it for every provenance document in the repository. `crosswalks/prov-o.yaml` and
   `crosswalks/dcat.yaml` record the same terms row by row against the schemas.
3. **HXL.** Detections and alert notices become CSV tables whose second row holds HXL hashtags, listed per table in
   `mapping.yaml`. Dates are copied unchanged, a missing value is an empty cell, a magnitude always carries its unit and
   uncertainty, an alert row always carries its status (an exercise stays an exercise), coordinates are not refined, no
   column names a recipient or a person, and a table is never offered as a warning channel; alert notices go out in the
   CAP form of OIP-0005.
4. **C2PA.** One custom assertion, labelled `org.obsp.evidence` and vendor-neutral, carries the product UNI and version,
   the OBSP digest of the product version, the UNI and digest of the provenance bundle and references (kind, id,
   digest) to the receipts that exist: supply-chain, proof (for example `EO_CUSTODY`) and transparency receipts. It is
   an assertion of the signed claim, embedded in PNG and JPEG stills and quicklooks and carried in a sidecar manifest
   store for other media types. It carries no statement of authenticity or trust; signing credentials, trust lists and
   time stamping stay the operator's and the tool's. A derivative image declares its parent as an ingredient. Because
   an image is immutable, the assertion carries no correction state: a consumer resolves the product UNI and does not
   show the image of a superseded, withdrawn or recalled product as current.

### How the bindings relate to the specification

| Specification | Carried by |
|---|---|
| §5.3 Describe (source manifests) | BND-DCAT-02, -03, -08; BND-C2PA-02 (provider renderings) |
| §5.6 Qualify (provenance) | BND-PROVO-01 to -10; BND-DCAT-07; BND-C2PA-03 |
| §5.9 Correct (states stay visible) | BND-DCAT-09; BND-C2PA-10 |
| §5.10 Exchange (licence and state never dropped) | BND-DCAT-04, -05, -09; BND-HXL-07 |
| §2 principles (claims follow evidence) | BND-C2PA-07, -09; BND-HXL-10; BND-DCAT-10 |

No protocol object is added and no schema of `schemas/json` changes. The dataset description, the graph, the table row
and the assertion are projections of existing objects (`product-manifest`, `source-manifest`, `provenance`,
`supply-chain-receipt`, `proof-receipt` and, once accepted, `detection` and `alert-notice`), defined by the bindings, not
new contracts.

## Compatibility

Additive. No schema, fixture or case of the live tree changes; no existing record becomes invalid. The bindings are
`proposed` until this proposal is accepted. The `obsp:` namespace (`urn:obsp:ns:v0.1:`) is introduced by the DCAT and
PROV-O bindings for the terms the standards lack; it is a URN until the steward publishes a resolvable address.
`tests/test_validate.py` and the runner service test are made independent of the shipped bindings and crosswalks (the
same change OIP-0009 and OIP-0019 make for bindings), and the offline runner test passes the attestations of the
provider example set when it has any (it has none: every provider case of this proposal is automated).

## Tests

| Requirement | Case | Kind | Evidence |
|---|---|---|---|
| BND-DCAT-01 to -09 | CT-GRID-130 | automated (`binding-dcat-dataset`: the dataset, its manifest and the provenance bundle; schema validation and comparison with the manifest) | manifests, descriptions and digests; the state of a withdrawn or superseded product is not shown by a document |
| BND-PROVO-01 to -09 | CT-GRID-131 | manual (the round trip back to the bundle is a conversion the implementer runs) | bundles, graphs, re-created bundles and digests |
| BND-HXL-01 to -10 | CT-GRID-132 | manual (tables are CSV and the record of whom they were handed to is a human fact) | sources, tables and the hand-off record |
| BND-C2PA-01 to -08 | CT-GRID-133 | automated (`binding-c2pa-image`: the manifest outline, the provenance bundle and the receipts; schema validation and comparison with the bundle) | images, manifests, source documents and digests; the signature of the image is not checked |
| BND-DCAT-08; BND-C2PA-01, -02, -05, -07, -08 | CT-PROVIDER-130 | automated (`binding-dcat-source`, `binding-c2pa-image`) | source manifest, description, image and manifest outline |
| BND-DCAT-04, -06, -07, -09, -10; BND-PROVO-05, -10 | CT-CONSUMER-130 | manual | consumer attestation |
| BND-HXL-05, -07, -11; BND-C2PA-03, -04, -09, -10, -11 | CT-CONSUMER-131 | manual | consumer attestation |

CT-GRID-130, CT-GRID-133 and CT-PROVIDER-130 are automated (`obsp.golden`): the implementer supplies the export and the documents it was made from. The other four cases are manual because they judge conversions, hand-offs and application behaviour that documents do not show. Each binding has its
own positive and negative examples and a test that runs in `make test`: `tests/test_dcat_binding.py`,
`tests/test_provo_binding.py`, `tests/test_hxl_binding.py` and `tests/test_c2pa_binding.py`. Each derives every positive
example from repository fixtures through its mapping, validates it against the artefact, and checks that every negative
example breaks exactly the requirement its file name states:

- DCAT: `identifier-mismatch` (BND-DCAT-02), `licence-invented` (-04), `coverage-guessed` (-05),
  `checksum-not-the-digest` (-06), `missing-provenance-link` (-07), `rights-state-as-licence` (-08).
- PROV-O: `no-bundle-node` (BND-PROVO-01), `agent-named` (-02), `qualified-without-unqualified` (-03), `time-rewritten`
  (-04), `bundle-digest-of-export` (-05), `inferred-derivation` (-06), `invented-node` (-07), `derivation-kind-lost`
  (-09); and the round trip for every provenance fixture and example (-08).
- HXL: `hashtag-row-missing` (BND-HXL-01), `unknown-hashtag` (-02), `local-time` (-04), `placeholder-for-missing` (-05),
  `magnitude-without-uncertainty` (-06), `exercise-without-status` (-07), `recipient-column` (-09).
- C2PA: `label-not-registered` (BND-C2PA-01), `digest-of-asset` (-02), `provenance-not-the-bundle` (-03),
  `receipt-invented` (-04), `assertion-outside-claim` (-05), `sidecar-for-png` (-06), `states-verification` (-07).

The crosswalks are checked by `tools/validate.py` (group crosswalks): every pointer resolves in its schema and every
required property has a row. Their examples (`crosswalks/examples/dcat/`, `crosswalks/examples/prov-o/`) are the
source document and the mapped document, and the binding tests assert that the mapped document is the binding's own
derivation. The HXL test reads the `detection` and `alert-notice` fixtures and checks the mapping's pointers against
their schemas as soon as OIP-0020 and OIP-0005 are accepted; until then it uses the values of those proposals' fixtures
that the mapping reads.

## Open questions

1. Every standard in this proposal: the edition in force, the clause of each term, and the dictionary of hashtags
   (HXL) and the rules for custom assertions (C2PA) are `checked: not checked`. A reviewer has to compare each mapping
   row with the published text before any row says `opened`.
2. DCAT and DCAT-AP: which members DCAT-AP lists as mandatory, and whether the shape is acceptable to a national
   profile. The binding writes `dct:description` from a publisher input because the manifest has none.
3. `product-manifest` has no licence, extent or description field. Should a later proposal add them, replacing the
   `export.*` extension keys (OIP-0001 adds a licence; OIP-0009 asks for an extent)?
4. The `obsp:` namespace and the `org.obsp.evidence` label use a reverse-domain form that names the protocol. Which
   domain the steward controls, where the namespace is published and whether C2PA tools accept the label is a naming
   and hosting decision for the steward, not decided here.
5. HXL: whether each hashtag and attribute is in the standard's dictionary; whether `#geo+wkt`, a repeated evidence
   column and the uncertainty columns suit the tools that read HXL; and whether a sensitive detection should be
   exported at all before OIP-0014 (data governance) is decided.
6. C2PA: whether TIFF and GeoTIFF renderings of EO products should be embedded or carried in a sidecar, which receipts
   belong in the assertion for a product with several, and whether the rendering recipe should be referenced.
7. PROV-O: whether role objects should be typed `prov:Role` nodes, and whether the extensions JSON literal should be
   exported at all.
8. Four cases are manual; should the live harness (OIP-0001 slice S6) check descriptions and tables when it reaches
   export endpoints?
9. Merge order: `cases.patch` creates `conformance/examples/OBSP-GRID/attestations.yaml`, which OIP-0009 also creates, and appends to
   `conformance/examples/OBSP-CONSUMER/attestations.yaml` (no provider attestations remain); `registers.patch` regenerates `implements-edges.json` and
   `requirements.yaml`, as other drafts do; `tests-common.patch` repeats the demo-binding helper of OIP-0009 and
   OIP-0019 (in a form that also removes the shipped crosswalks). Whichever proposal is accepted second merges those
   files and regenerates the generated ones.

Acceptance needs appointed editors, the dependencies above for the HXL binding, and a last-call window. Until then this
proposal stays at DRAFT.
