w3c / odrl

ODRL Community Group Repository
https://www.w3.org/community/odrl/
Other
18 stars 10 forks source link

Proposal - multiple paths for evaluation of Constraints #66

Open joshcornejo opened 1 month ago

joshcornejo commented 1 month ago

I've been discussing refinements like this (modified from Krishnamurthy's emails in May):

{
     "@context": "http://www.w3.org/ns/odrl.jsonld",
     "@type": "Offer",
     "uid": "http://example.com/policy:6163",
     "profile": "http://example.com/odrl:profile:10",
     "permission": [{
        "target": "http://example.com/document:1234",
        "assigner": "http://example.com/org:616",
        "action": "distribute",
        "refinement": [{ "@id": "http://example.com/p:99/C1" }],
        "constraint": [{ "@id": "http://example.com/p:99/C1" }],
    }],
},
{
   "@context": "http://www.w3.org/ns/odrl.jsonld",
   "@type": "Constraint",
   "uid": "http://example.com/p:99/C1",
   "leftOperand": "count",
   "operator": "lt",
   "rightOperand":  { "@value": "3", "@type": "xsd:int" }
}

During the call on 21/Oct/2024, we agreed that in such cases "count" is considered a different variable for the constraint and the refinement. (note - we agreed that the majority of examples appear to make "no sense", but considering they are nodes in a graph, a grammatical checker/validator will either have to allow or revoke them for correctness and the evaluator will need to have consistent behaviour).

Another scenario pops up that is not in the examples and could be considered ambiguous:

{
     "@context": "http://www.w3.org/ns/odrl.jsonld",
     "@type": "Offer",
     "uid": "http://example.com/policy:6163",
     "profile": "http://example.com/odrl:profile:10",
     "permission": [{
        "target": "http://example.com/document:1234",
        "assigner": "http://example.com/org:616",
        "action": "distribute", "print",
        "refinement": [{
            "leftOperand": "count",
            "operator": "lt",
            "rightOperand":  { "@value": "3", "@type": "xsd:int" }
        }]
    }]
 }

This raises the question: Is this "count" separate? (Print three times / distribute three times?) or is it for a total for the combination of printing and distribution?

Based on examples 26 and unravelling in 27, I propose this is interpreted the same way and considered as separate for each element (i.e. three times, each action), and the interpretation is of "grouping, because of the same refinement" and not "grouped, refinement applied to group".