Skip to content

Add dprod-contracts folder#156

Merged
matthiasautrata merged 41 commits into
EKGF:developfrom
tonyseale:add-dprod-contracts
May 28, 2026
Merged

Add dprod-contracts folder#156
matthiasautrata merged 41 commits into
EKGF:developfrom
tonyseale:add-dprod-contracts

Conversation

@tonyseale

@tonyseale tonyseale commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces dprod-contracts/ — a self-contained ODRL 2.2 profile that extends DPROD with deterministic data-governance semantics. Destined for DPROD 1.1 once the design stabilises on develop; this PR is the working space for that.

The work has been actively iterated with review rounds from Matthias Autrata and Stephen — full status of every reviewer item is tracked in dprod-contracts/docs/changes-plan.md.

Scope

DPROD 1.1's contracts story is being decomposed across multiple feature branches. This PR is one contribution; Matthias's #160 add-adalbert-contracts is a parallel/complementary approach landing in its own folder. Neither branch needs to be the final word on contracts — both target develop, and final integration (including wiring into spec-generator/main.py) will happen once the design crystallises.

What's in the branch

Ontology + shapes

  • dprod-contracts.ttl — OWL profile: DataOffer, DataContract, RuntimeReference, lifecycle State enum, duty role properties, deadline/recurrence, logical negation, asset/party hierarchy
  • dprod-contracts-shapes.ttl — SHACL validation: policy/rule/contract/operand shapes and explicit rejection shapes for unsupported ODRL constructs
  • dprod-contracts-prof.ttl — DXPROF profile descriptor with prof:isProfileOf odrl:core

Examples

  • examples/data-contract.ttl — bilateral DataOffer + DataContract
  • examples/data-use-policy.ttl — role-based access with purpose constraints
  • examples/baseline.ttl — broader test policy set
  • examples/odcs.ttl + odcs.md — ODCS interop walk-through

Documentation

  • docs/specification.md — normative vocabulary reference
  • docs/formal-semantics.md — evaluation semantics, amenable to Dafny/Why3/Coq
  • docs/contracts-guide.md, docs/policy-writers-guide.md, docs/overview.md — guides
  • docs/term-mapping.md — DPROD ↔ ODRL/DCAT/ODCS term map
  • docs/changes-plan.md — live triage of reviewer feedback (Matthias, Stephen)
  • docs/recurrence-redesign.md — drafted Bucket 4 redesign (RFC 5545 RRULE-based recurrence), pending execution

Core repo

  • ontology/dprod/dprod-ontology.ttl — new contributor entries
  • respec/template.html — editor / author list updates

Build impact

dprod-contracts/ is not yet wired into the spec generator — this is deliberate while the design is still in flight. build.sh continues to produce the current DPROD 1.0 (Beta) spec unchanged.

Outstanding (tracked in changes-plan.md)

  • Bucket 4 — recurrence redesign (one large change, drafted in docs/recurrence-redesign.md)
  • Bucket 5 — open design decisions surfaced to the group: 5.4 (dprod:path typing), 5.5 (dprod:select keep/remove), 5.7 (DataDuty subtype), 5.8 / 5.9 (DataOffer / acceptsOffer cardinality — Stephen's basket-model proposal)
  • Bucket 6 — deferred items pending external input

🤖 Generated with Claude Code

jgeluk
jgeluk previously approved these changes Jan 29, 2026
tonyseale and others added 6 commits March 2, 2026 11:49
Adds DPROD contract TTL files (ontology, shapes, examples), documentation,
and supporting files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reformats the contracts ontology to match the styling of the main DPROD
ontology: 2-space indentation, header comments block, @base declaration,
Dublin Core annotation property declarations, rdfs:Class alongside
owl:Class, rdf:Property alongside owl property types, dct:description
instead of skos:definition, rdfs:comment instead of skos:note, lowercase
rdfs:label without @en, prefix-form rdfs:isDefinedBy, and period
terminator on its own line.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tonyseale tonyseale force-pushed the add-dprod-contracts branch from e48aeda to c994721 Compare March 2, 2026 16:43
tonyseale and others added 8 commits March 12, 2026 22:12
Domain-specific terms (actions, operands, concept values) that each
adopter would define themselves are moved out of the dprod: namespace
into ex: (https://example.org/) across all 4 example TTL files.

- 8 actions: deliver, notify, nonDisplay, report, conformTo, query, export, log
- 12 operands: recipientType, classification, processingMode, environment, etc.
- 14 concept values: internal, analytics, compliance, production, staging, etc.
- Add @Prefix ex: declaration where missing
- Rename section headers: "Inline DPROD Vocabulary" → "Inline Domain Vocabulary"
- Fix baseline.ttl bug: restore missing ex:deliver subject IRI
- Update dprod:select SPARQL string to use ex: namespace
- Core dprod: framework terms (DataContract, Subscription, state, path, etc.) unchanged

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Quick Start showed only a DataOffer but not the DataContract
that activates it. Add a parallel example showing bilateral binding,
acceptsOffer link, effective/expiration dates, and duties on both parties.
Also includes pre-existing namespace fixes (dprod: -> ex: for domain vocab).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d ontology

Complete the namespace migration started in 1ae9ad6 (which covered example
files). Domain-specific actions (deliver, notify, conformTo, report, nonDisplay),
operands (classification, timeliness, recipientType, environment, etc.), and
concept values (analytics, internal, realtime, etc.) now consistently use ex:
rather than dprod:, reinforcing that these are domain vocabulary, not core
profile terms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DCON equivalents and the full DCON->DPROD migration section are
historical and no longer relevant to the current specification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 16, 2026

Copy link
Copy Markdown

@tonyseale is attempting to deploy a commit to the EKGF Team on Vercel.

A member of the Team first needs to authorize it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jgeluk and others added 2 commits April 20, 2026 14:18
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tonyseale and others added 5 commits May 10, 2026 22:54
Closes triage items 1.5, 2.1, 2.2, 3.1, 3.2, 3.3, 5.3, 5.6 and folds in
two pre-existing edits (1.3 group decision, 1.4 doc fix). Full triage
status and decision log lives in dprod-contracts/docs/changes-plan.md.

Ontology (dprod-contracts.ttl):
- Document dprod:currentDateTime as canonical operand; explain why
  equivalence with odrl:dateTime is asserted via rdfs:seeAlso rather
  than owl:sameAs (1.5).
- Extend rdfs:comment on dprod:partOf and dprod:memberOf to record the
  deliberate domain narrowing to Asset/Asset and Party/Party (5.3).
- Drop owl:oneOf on dprod:State per group decision; State becomes open
  for future Contract-state / Duty-state split (1.3 follow-on).

SHACL shapes (dprod-contracts-shapes.ttl):
- Add sh:message to effectiveDate/expirationDate property shapes on
  DataOffer and DataContract, covering both maxCount and datatype
  violations (2.1).
- Replace sh:SPARQLTarget with declarative sh:targetSubjectOf in the
  five Reject* shapes; drops the SHACL-SPARQL dependency (2.2).

Formal semantics + spec docs:
- formal-semantics.md gets a Normalisation paragraph plus a
  let ref' = ... line in resolveRuntime so odrl:dateTime resolves to
  the same value as currentDateTime (1.5).
- specification.md table cell for currentDateTime updated to reflect
  the canonical-form framing (1.5).

DCON remnant cleanup:
- overview.md: remove DCON Migration section, role-table row, and
  inventory cell trailer (3.1).
- contracts-guide.md: remove DCON equivalent annotations, trim the
  DCON sentence from the Quality SLA paragraph, drop the DCON Migration
  section near the end (3.2).
- dprod-contracts/README.md: trim "+ DCON migration" from the
  term-mapping.md directory-tree comment (3.3).
- examples/odcs.md: drop stale reference to non-existent
  odcs-translated.ttl (1.4).

Planning artefacts (new files):
- docs/changes-plan.md: triage notes, in-line decisions, DONE markers.
- docs/temp.md: Bucket-4 recurrence-redesign design draft; tracked here
  during Bucket 4 development and deletable once 4.1-4.7 merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 5.2: rename dprod:subject/object to dprod:subjectOfDuty/objectOfDuty;
  both now rdfs:subPropertyOf odrl:function (mirrors the W3C Market
  Data ODRL Profile's duty-scoped md:subject/md:object pattern).
  Propagated across shapes, examples, and docs.
- 5.1: drop the confusing @base <…/contracts/> directive in
  dprod-contracts.ttl and repoint every rdfs:isDefinedBy to dprod: so
  terms self-declare as part of core DPROD.
- 3.4: closed without change; dct:conformsTo (fact predicate) and
  ex:conformTo (ODRL action in concept scheme) are distinct constructs,
  not redundant — captured in the plan's done-list as the rationale.
- changes-plan.md: log 5.1/5.2/3.4 outcomes; add Stephen's three new
  questions as items 5.7 (DataDuty subtype), 5.8 (DataOffer target
  cardinality), 5.9 (acceptsOffer basket model).

All TTL files re-parse cleanly with rdflib (26 files, 0 failures).
All four example policies pass SHACL validation against the renamed
shapes with RDFS inference.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- respec/template.html: drop duplicate "Matthias Autrata" from author list
- dprod-contracts.ttl: add Matthias Autrata and Josh Cornejo as
  dct:contributor to mirror the core ontology
- README, contracts.ttl, specification.md, formal-semantics.md: replace
  remaining "SHACL-style" with "SPARQL-style" (plan item 1.1, re-swept)
- docs/temp.md → docs/recurrence-redesign.md (purpose-named filename
  while Bucket 4 is in flight; 4.8 deletion still planned)
- .gitignore: drop /.idea/LNKD.tech Editor.xml (user-global, not project)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@jgeluk jgeluk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — staging-branch housekeeping pass

Reviewed against develop after the latest develop merge (0e1a388) and the housekeeping commit 1dc3883. Treating this PR as the working space for Tony's slice of DPROD 1.1 data-contracts — not as a self-contained final standard. Matthias's parallel work in #160 covers a complementary slice.

What I checked

  • Branch is up to date with develop (no remaining develop commits ahead of it).
  • dprod-contracts/{dprod-contracts,dprod-contracts-shapes,dprod-contracts-prof}.ttl all re-parse cleanly with rdflib (187 / 344 / 21 triples).
  • bash build.sh (i.e. spec-generator/main.py) runs end-to-end; the existing DPROD 1.0 (Beta) spec still generates.
  • Plan item 1.1 was marked PASS but six occurrences of "SHACL-style" were still in the source — those have now been swept in 1dc3883.

Housekeeping applied in 1dc3883

  • Duplicate "Matthias Autrata" removed from respec/template.html author list.
  • Matthias Autrata and Josh Cornejo added as dct:contributor in dprod-contracts.ttl to mirror the core ontology.
  • Final SHACL-style → SPARQL-style sweep across README.md, dprod-contracts.ttl, docs/specification.md, docs/formal-semantics.md.
  • docs/temp.mddocs/recurrence-redesign.md (purpose-named filename while Bucket 4 is in flight; 4.8 deletion still planned).
  • .gitignore: dropped /.idea/LNKD.tech Editor.xml (belongs in user-global gitignore).

Open questions for the group (not blocking this PR, but next steps)

These all live in dprod-contracts/docs/changes-plan.md; flagging here so they're visible from the PR conversation rather than buried in the file.

  1. Bucket 4 — recurrence redesign. Drafted in docs/recurrence-redesign.md. Worth executing as its own follow-up PR rather than continuing to expand this one.
  2. Bundle 5.7 / 5.8 / 5.9 — Stephen's three coupled questions (DataDuty subtype, DataOffer target cardinality, DataContract acceptsOffer basket model). The plan correctly notes 5.8 + 5.9 are tightly coupled; 5.7 likely wants to ride along.
  3. 5.4 / 5.5dprod:path OWL typing (untyped today as rdf:Property); dprod:select is defined but unused in any example — implement, mark non-normative, or delete?
  4. Spec-generator integration timing. Currently dprod-contracts/ is not loaded by spec-generator/main.py (deliberate while the design is in flight). Worth deciding now whether the wiring lands in this PR before merge, in a follow-up PR after Bucket 4 + 5.7-5.9 resolve, or in a single integration PR after both #156 and #160 are accepted.

Recommendation

This is a high-quality, well-documented contribution and the housekeeping leaves it in a tidy state. I'd suggest:

  • Land Bucket 4 (recurrence redesign) as a separate PR against add-dprod-contracts.
  • Run the 5.7 / 5.8 / 5.9 bundle past the group in a single message, then merge the decisions into this branch.
  • Decide the spec-generator integration plan with #160's author.

Once 5.7-5.9 are resolved and Bucket 4 is in, this PR is in good shape to merge into develop even if some lower-priority Bucket 5 / Bucket 6 items remain — they can continue evolving on develop via follow-up PRs.

@jgeluk

jgeluk commented May 28, 2026

Copy link
Copy Markdown
Member

Decision recorded — spec-generator integration: wiring lands in this PR, not deferred.

Each contracts PR is responsible for its own spec-generator wiring (#156 wires dprod-contracts/; #160 will wire adalbert/). This drops it from the "open questions" list in the review above.

Cc @tonyseale — happy to take a first crack at wiring dprod-contracts/{dprod-contracts,dprod-contracts-shapes,dprod-contracts-prof}.ttl into spec-generator/main.py so the contracts ontology renders in dist/index.html alongside the core spec. Will open a follow-up commit on this branch unless you'd rather drive it.

Repoints contracts namespace from https://ekgf.github.io/dprod/ to the
canonical https://www.omg.org/spec/DPROD/ so contracts terms unify with
the core DPROD vocabulary (fixes plan item 5.1 — Tony's verbal intent
was right but he kept the old EKGF GitHub Pages IRI).

Spec-generator changes:
- functions.load_ontologies() now also parses dprod-contracts.ttl,
  dprod-contracts-shapes.ttl, and dprod-contracts-prof.ttl into the
  main graph so contracts node-shapes are rendered as spec classes
- load_dprod_ontology() and load_dprod_shapes() include contracts
  so dprod.jsonld / dprod.rdf / dprod-shapes.* outputs cover them too
- globals.contracts_shapes_ns_iri added for the new prefix binding
- main.add_to_context() skips NodeShapes without sh:targetClass
  (NonEmptyClausesConstraint, the sh:targetSubjectOf reject shapes)
  and skips Reject*Shape patterns that target ODRL classes purely
  to forbid them — they would otherwise render as empty spec
  sections (Ticket, Request, AssetCollection, PartyCollection)
- reorder_list includes the contracts classes after the core ones
- dprod-contracts*.ttl files are copied into dist/

ReSpec template:
- edDraftURI points to https://ekgf.org/spec/{{ branch }}/ so the
  "Latest editor's draft" header link surfaces the per-branch
  preview on ekgf.org

Verified: build emits dist/index.html with sections for DataOffer,
DataContract, Policy, Set, Offer, Agreement, Permission, Prohibition,
Duty, Constraint, LogicalConstraint, LeftOperand alongside the core
DPROD classes; no Reject* noise.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jgeluk

jgeluk commented May 28, 2026

Copy link
Copy Markdown
Member

Spec-generator wiring done — commit b7a9fef on this branch.

Two coupled changes:

1. Namespace alignment. Contracts terms were minted under https://ekgf.github.io/dprod/, which doesn't match the canonical DPROD namespace (https://www.omg.org/spec/DPROD/) used everywhere else in this repo. Search-and-replaced across all of dprod-contracts/. This is what plan item 5.1 verbally promised ("all contracts terms are minted under the core dprod: namespace") but the file still had the legacy EKGF GitHub Pages IRI. After the rewrite, all 7 TTL files re-parse cleanly with rdflib.

2. Spec-generator integration.

  • functions.load_ontologies now parses dprod-contracts.ttl, dprod-contracts-shapes.ttl, and dprod-contracts-prof.ttl into the main graph; load_dprod_ontology / load_dprod_shapes cover the same so serialized outputs (jsonld / rdf / ttl) include contracts.
  • add_to_context skips NodeShapes without sh:targetClass (NonEmptyClausesConstraint and the sh:targetSubjectOf reject shapes) plus Reject*Shape patterns that target ODRL classes purely to forbid them.
  • reorder_list puts the contracts classes (DataOffer, DataContract, Policy, Set, Offer, Agreement, Permission, Prohibition, Duty, Constraint, LogicalConstraint, LeftOperand) after the core DPROD classes.
  • dprod-contracts*.ttl source files are copied into dist/.

3. Editor's draft link. respec/template.html now sets edDraftURI: "https://ekgf.org/spec/{{ branch }}/" so the spec header's "Latest editor's draft" link points at the per-branch preview on ekgf.org. For this branch the preview URL is https://ekgf.org/spec/add-dprod-contracts/.

The branch preview at https://ekgf.org/spec/add-dprod-contracts/ should pick this up on next Vercel build.

ProfilePropertyGroup and StatePropertyGroup are PropertyShapes reused
across multiple class shapes via sh:property. They previously had no
sh:name / sh:description, so the spec rendered them as empty "profile"
and "state" entries with "None" descriptions inside every host class
section. Add user-facing labels and descriptions so the rendered spec
shows what each reused property requires.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@jgeluk jgeluk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for merge into `develop`.

The branch is in good shape: ontology + shapes parse cleanly, the spec generator now renders the contracts vocabulary (DataOffer, DataContract, Policy, Set, Offer, Agreement, Permission, Prohibition, Duty, Constraint, LogicalConstraint, LeftOperand) alongside the core DPROD classes, the namespace is aligned with the canonical OMG IRI, the editor's draft link points at the per-branch ekgf.org preview, and all CI checks are green on the latest SHA.

The outstanding design items from `dprod-contracts/docs/changes-plan.md` are being split out into separate tracking issues — they can keep evolving on `develop` via follow-up PRs without holding this contribution any longer. Bucket 4 (recurrence redesign), 1.3 follow-on (DutyState/ContractState split), and the 5.x design questions (5.4 `dprod:path` typing, 5.5 `dprod:select`, 5.7 DataDuty subtype, 5.8/5.9 cardinality bundle, 6.2 path sandboxing) will each get their own issue so we can prioritise and assign them independently.

Thanks @tonyseale for the substantial, thoughtfully iterated contribution.

@jgeluk

jgeluk commented May 28, 2026

Copy link
Copy Markdown
Member

Outstanding items from `dprod-contracts/docs/changes-plan.md` are now tracked as separate issues so they can be prioritised and assigned independently after merge:

The `changes-plan.md` file stays on the branch as the historical triage record. Once these issues are individually resolved their corresponding entries can be marked closed in the plan, but new design discussion should happen on the issues from here on.

Ready to merge.

@jgeluk jgeluk mentioned this pull request May 28, 2026
2 tasks
jgeluk added a commit that referenced this pull request May 28, 2026
## Summary

- Add \`@matthiasautrata\` as a code owner (active contributor to
data-contracts work via PR #160 and review feedback on PR #156)
- Remove \`@nvar\` and \`@andrea-gioia\`
- \`@joshcornejo\` was already an owner, no change there

## Effect

Affects future PRs targeting \`develop\`: \`@matthiasautrata\` will be
auto-requested as a reviewer; \`@nvar\` and \`@andrea-gioia\` will no
longer be. The \`main\` copy of CODEOWNERS is unchanged for now — it'll
get synced at ballot time when the next merge from \`develop\` lands on
\`main\`.

## Test plan
- [ ] Confirm the new owner set is what you want before merging
- [ ] After merge, open a throwaway PR against develop to verify the
auto-requested reviewer set updates as expected (optional)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jgeluk jgeluk requested review from matthiasautrata and removed request for andrea-gioia and nvar May 28, 2026 17:03
@jgeluk jgeluk requested a review from matthiasautrata as a code owner May 28, 2026 17:03
@jgeluk

jgeluk commented May 28, 2026

Copy link
Copy Markdown
Member

@rivettp @FroehlichMarcel @joshcornejo @matthiasautrata — fresh review needed to unblock merge.

Branch protection on `develop` requires the last push to be approved by a code owner other than the pusher. The branch was just brought up to date with develop (which dragged in the CODEOWNERS update from #191) and the latest commit was pushed under my credentials, so my earlier approval no longer satisfies the rule. The PR itself is fully green otherwise — all CI checks pass on the latest SHA, the dprod-contracts ontology and shapes are wired into the spec generator, the branch preview is at https://ekgf.org/spec/add-dprod-contracts/, and the seven outstanding design items have been split out as their own tracking issues (#184#190).

Anyone of you approving will let this merge into develop. Thanks.

@matthiasautrata matthiasautrata enabled auto-merge (squash) May 28, 2026 17:16

@matthiasautrata matthiasautrata left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve

@matthiasautrata matthiasautrata merged commit 26c4481 into EKGF:develop May 28, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants