From a51d9d3355d7fc6256db17b8cf6dcf2c6449318f Mon Sep 17 00:00:00 2001 From: Jacobus Geluk Date: Wed, 18 Feb 2026 18:00:26 +0000 Subject: [PATCH 1/2] fix(examples): correct ODRL modeling in data-rights example Apply the ODRL fixes described in #83: - Change policy type from Offer to Agreement (required to have assignee) - Add assignee as PartyCollection with spatial refinement - Move spatial constraint from permission constraint to assignee refinement - Change action from odrl:read to odrl:use (read is not an ODRL term) - Update README.md inline example to match Resolves: DPROD-20, #83 Co-Authored-By: Claude Opus 4.6 --- examples/data-rights/README.md | 19 ++++++++++-------- examples/data-rights/example.jsonld | 30 +++++++++++++++-------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/examples/data-rights/README.md b/examples/data-rights/README.md index 638c1d2..23ab16f 100644 --- a/examples/data-rights/README.md +++ b/examples/data-rights/README.md @@ -12,18 +12,21 @@ examplePolicyA odrl:target exampleProduct:ProductA . examplePolicyB odrl:target exampleDataset:DatasetA1 . ``` -An example of a policy follows, that describes permission to distribute the data only within a specific geographic region: +An example of an agreement follows, that describes permission to use all the datasets of the product if the user is working inside EMEA or APAC: ```json examplePolicyA odrl:permission { - "action": "odrl:distribute", - "constraint": [ - {"leftOperand": "spatial", - "operator": "eq", - "rightOperator": "region:EMEA" - } - ] + "action": "odrl:use", + "assignee": { + "@type": "odrl:PartyCollection", + "refinement": [ + {"leftOperand": "odrl:spatial", + "operator": "odrl:isAnyOf", + "rightOperand": ["reg:EMEA", "reg:APAC"] + } + ] } + } ``` diff --git a/examples/data-rights/example.jsonld b/examples/data-rights/example.jsonld index f1c4e4b..d3a2a35 100644 --- a/examples/data-rights/example.jsonld +++ b/examples/data-rights/example.jsonld @@ -1,5 +1,5 @@ { - "@type": "Offer", + "@type": "Agreement", "@context": [ { "odrl": "http://www.w3.org/ns/odrl/2/", @@ -12,19 +12,21 @@ "permission": [ { - "action": "odrl:read", - "constraint": [ - { - "@type": "odrl:Constraint", - "leftOperand": "odrl:spatial", - "operator": "odrl:isAnyOf", - "rightOperand": [ - "reg:EMEA", - "reg:APAC" - ], - "description": " Permission to read all the datasets of the product if user is working inside EMEA or APAC" - } - ] + "action": "odrl:use", + "assignee": { + "@type": "odrl:PartyCollection", + "refinement": [ + { + "@type": "odrl:Constraint", + "leftOperand": "odrl:spatial", + "operator": "odrl:isAnyOf", + "rightOperand": [ + "reg:EMEA", + "reg:APAC" + ] + } + ] + } } ] } From fcadb0085a168af4e1aab125d33df8c30d566031 Mon Sep 17 00:00:00 2001 From: Jacobus Geluk Date: Wed, 18 Feb 2026 20:24:56 +0000 Subject: [PATCH 2/2] fix(examples): incorporate improvements from PR #132 Move assigner/target inside permission and add source to PartyCollection, as suggested by @joshcornejo. Co-Authored-By: Josh Cornejo <10956002+joshcornejo@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 --- examples/data-rights/example.jsonld | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/data-rights/example.jsonld b/examples/data-rights/example.jsonld index d3a2a35..9d3a08c 100644 --- a/examples/data-rights/example.jsonld +++ b/examples/data-rights/example.jsonld @@ -7,14 +7,14 @@ } ], "uid": "56456df-dfg-34535345-5545", - "assigner": "https://schema.org/person/AdamSmith", - "target": "https://data.org/data-product/equity-trade-xxx", "permission": [ { - "action": "odrl:use", + "target": "https://data.org/data-product/equity-trade-xxx", + "assigner": "https://schema.org/person/AdamSmith", "assignee": { "@type": "odrl:PartyCollection", + "source": "https://example.org/DataDepartment", "refinement": [ { "@type": "odrl:Constraint", @@ -26,7 +26,8 @@ ] } ] - } + }, + "action": "odrl:use" } ] }