Skip to content

Docs/requirements - #10

Merged
woutslabbinck merged 3 commits into
mainfrom
docs/requirements
Nov 19, 2026
Merged

woutslabbinck merged 3 commits into
mainfrom
docs/requirements

Conversation

@elenamolino

Copy link
Copy Markdown
Collaborator

Changes

  • docs/Requirements.md: grouped by module (Normalization N1–N10, Policy, Rule, Action, Constraint, Party, Asset, Operators, RightOperand, Profiles, Inconsistencies I1–I3), each requirement with its source (Wiki / ODRL 2.2 section / Vocab). New: R107–R122.
  • Each requirement is specified on the shape it is checked (modules 01–08).
  • A test per requirement.
  • DPVProfile.test.ts: loop checking if all the dpv-odrl examples are valid.

Fixes

  • R06: inheritFrom to a Set, Offer, Agreement... was rejected (subclasses of odrl:Policy added to the shapes).
  • Actions with refinement were rejected because they didn't type the action (e.g. Examples 14, 20, 21 of the ODRL Model).

To discuss

  1. Terms outside ODRL or a loaded profile are a Violation (R13, R24, R41, R42). The code already did this, now the requirements say the same.

    :permission1 a odrl:Permission ;
        odrl:action :myAction ;                    # R13 → Violation
        odrl:target :asset1 ;
        odrl:constraint [
            odrl:leftOperand :myOperand ;          # R41 → Violation
            odrl:operator :myOperator ;            # R42 → Violation
            odrl:rightOperand 5
        ] .

    Literal target, assignee or assigner is a warning (R15, R18, R21)

    :permission1 a odrl:Permission ;
        odrl:action odrl:use ;
        odrl:target "asset9898" ;      # Warning 
        odrl:assignee "Pedro" .        #Warning 

Tests

417 pass, 16 fail:

  • 11 on purpose: the error is found, but with the message of another shape (R15, R18, R21, R34, R35, R38, R44, R113, R114).
  • 2 known: rule subclass in Validator.test.ts.
  • 3 on purpose: TOSL examples with foaf:age and spatial strings.

@woutslabbinck

Copy link
Copy Markdown
Collaborator

Merged with main, but some tests still fail -> 19 in total.
That is three more than what we had, though 2 more are added due to the fact that profile tests were add for subclass.

Solving the ones from rule class as we discussed with the policy being closed resolves two more in Validator.test.ts.
However, it lets TOSL test fail. The reason being is that much metadata is added that was not documented by ODRL in section 2.8.

I am merging this branch already, such that I can publish a new version.

However, @besteves4 and @elenamolino : how would you proceed with this?
I am in favor of making policy closed as this is more true to ODRL.
We will have to add some dct terms to the shape for policies then, which is fine. I would advocate of removing the extra metadata of the policies of TOSL then to make them proper ODRL policies.
WDYT?

test/unit/Validator.test.ts (4)

  • The ODRL Validator › for profiles › with a rule subclass › validates policies that use a profile rule subclass and where the wrong relation is used.
  • The ODRL Validator › for profiles › with a rule subclass › fails when a profile rule subclass is used without a profile
  • The ODRL Validator › for profiles › with a rule subclass › fails when a profile rule subclass is used without a profile and a wrong relation is used
  • The ODRL Validator › for profiles › with a rule subclass › fails when a profile rule subclass is used without a profile and a wrong type is used

FAIL test/unit/ActionShapes.test.ts (6)

  • The action shapes › R34: [ odrl:refinement [ odrl:leftOperand odrl:resolution ; odrl:operator odrl:lteq ; odrl:rightOperand 1200 ] ] is reported.

    Expected value: "An action refinement must have one rdf:value."
    Received array: ["Action is neither part of the ODRL Vocabulary nor typed as odrl:Action in a profile.", "An action outside the ODRL vocabulary requires a declared odrl:profile.", "A collection with refinement must have one source."]

  • The action shapes › R34: [ rdf:value odrl:print, odrl:display ; odrl:refinement [ odrl:leftOperand odrl:resolution ; odrl:operator odrl:lteq ; odrl:rightOperand 1200 ] ] is reported.

    Expected value: "An action refinement must have one rdf:value."
    Received array: ["Action is neither part of the ODRL Vocabulary nor typed as odrl:Action in a profile.", "An action outside the ODRL vocabulary requires a declared odrl:profile."]

  • The action shapes › R35: odrl:print odrl:print odrl:includedIn odrl:display . is reported.

    Expected value: "The value of odrl:includedIn should be either odrl:use or odrl:transfer."
    Received array: ["Action should be a supported action or a blank node with rdf:value and odrl:refinement."]

  • The action shapes › R35: odrl:print odrl:print odrl:includedIn odrl:use, odrl:transfer . is reported.

    Expected value: "The value of odrl:includedIn should be either odrl:use or odrl:transfer."
    Received array: ["Action should be a supported action or a blank node with rdf:value and odrl:refinement."]

  • The action shapes › R113: odrl:print odrl:print odrl:implies :myAction . is reported.

    Expected value: "Each implies value should be an Action."
    Received array: ["Action should be a supported action or a blank node with rdf:value and odrl:refinement."]

  • The action shapes › R114: [ rdf:value odrl:print ; odrl:refinement [ odrl:leftOperand odrl:resolution ; odrl:rightOperand 1200 ] ] is reported.

    Expected value: "An action with refinement must have a valid refinement."
    Received array: ["Action is neither part of the ODRL Vocabulary nor typed as odrl:Action in a profile.", "An action outside the ODRL vocabulary requires a declared odrl:profile.", "A Constraint must have one odrl:operator."]

FAIL test/unit/PolicyShapes.test.ts (1)

  • The policy shapes › R107: :policy0 a odrl:Set ; odrl:permission :permission1 . :policy1 a :MyPolicy ; odrl:permission :permission1 . is reported.

    Expected value: "The policy type must be an ODRL policy class, or a subclass of odrl:Policy defined in a loaded profile."
    Received array: ["Value is not in http://www.w3.org/ns/odrl/2/Policy, http://www.w3.org/ns/odrl/2/Agreement, http://www.w3.org/ns/odrl/2/Assertion, http://www.w3.org/ns/odrl/2/Offer, http://www.w3.org/ns/odrl/2/Privacy, http://www.w3.org/ns/odrl/2/Request, http://www.w3.org/ns/odrl/2/Set, http://www.w3.org/ns/odrl/2/Ticket"]

FAIL test/unit/RuleShapes.test.ts (3)

  • The rule shapes › R15: :policy1 a odrl:Set ; odrl:permission :rule1 . :rule1 a odrl:Permission ; odrl:action odrl:use ; odrl:target :asset2 . :asset2 a odrl:Asset ; odrl:uid "asset2" . is reported.

    Expected value: "Target should be a supported asset or a blank node with rdf:value."
    Received array: ["An Asset may have one uid, and it must be an IRI."]

  • The rule shapes › R18: :policy1 a odrl:Set ; odrl:permission :rule1 . :rule1 a odrl:Permission ; odrl:action odrl:use ; odrl:target :asset1 ; odrl:assignee :carol . :carol a odrl:Party ; odrl:uid "carol" . is reported.

    Expected value: "Assignee should be a supported party or a blank node with rdf:value."
    Received array: ["A Party may have one uid, and it must be an IRI."]

  • The rule shapes › R21: :policy1 a odrl:Set ; odrl:permission :rule1 . :rule1 a odrl:Permission ; odrl:action odrl:use ; odrl:target :asset1 ; odrl:assigner :carol . :carol a odrl:Party ; odrl:uid "carol" . is reported.

    Expected value: "Assigner should be a supported party or a blank node with rdf:value."
    Received array: ["A Party may have one uid, and it must be an IRI."]

TOSL (3)

  • The TOSL profile › validates the example openai/Europe_terms_of_use_2024.ttl.
  • The TOSL profile › validates the example openai/openai_02_permission01.ttl.
  • The TOSL profile › validates the example openai/openai_37_prohibition03.ttl

FAIL test/unit/ConstraintShapes.test.ts (2)

  • The constraint shapes › R38: :constraint1 a odrl:Constraint ; odrl:leftOperand odrl:count ; odrl:operator odrl:lt ; odrl:rightOperand 5 ; odrl:rightOperandReference :maxCount . is reported.

    Expected value: "A Constraint must have one of odrl:rightOperand or odrl:rightOperandReference (neither both nor none)."
    Received array: ["Each constraint must conform to ODRL constraint or ODRL logical constraint."]

  • The constraint shapes › R44: :constraint1 odrl:and ( :c1 :c2 ) . :c1 odrl:leftOperand odrl:count ; odrl:operator odrl:lt ; odrl:rightOperand 5 . :c2 odrl:operator odrl:eq . is reported.

    Expected value: "Each value in a logical constraint must be a Constraint."
    Received array: ["Each constraint must conform to ODRL constraint or ODRL logical constraint."]

@woutslabbinck
woutslabbinck merged commit 9993f28 into main Nov 19, 2026
1 check failed
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.

2 participants