w3c / odrl

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

Does a method exist to express that there is some restriction in the ODRL? #77

Closed toru-ikeda-iij closed 2 weeks ago

toru-ikeda-iij commented 2 weeks ago

Hello, we are thinking of publishing ODRL to a data catalog like CKAN. Specific restrictions may not have been determined at the time of catalog publication. Is it possible to express just that there is restriction in such a case?

For example, we suspect that we can indicate that there is a spatial constraint by writing is not null as shown below.

{
 "@context": "http://www.w3.org/ns/odrl.jsonld",
 "@type": "Set",
 "uid": "https://w3c.github.io/odrl/bp/examples/5",
 "permission": [{
    "target": "http://example.com/asset:9898.movie",
    "action": "display",
    "constraint": [{
           "leftOperand": "spatial",
           "operator": "neq",
           "rightOperand": null
       }]
 }]
}

Is this method correct? Please let me know if another method is correct. Thank you.

joshcornejo commented 2 weeks ago

I don't think that constraint works the way you are proposing, it looks like you want to have a way to 'template' the policies.

The simplest, you could build a SHACL that checks for grammar and not provide the "rightOperand", and your system highlights the error in validation:

    "constraint": [{
           "leftOperand": "spatial",
           "operator": "neq",                         // change to the operand you require
           // the SHACL will not let this be an Agreement
       }]

You could also expand the model and provide a property for "the stage that builds" an odrl:Agreement to fill it in:

"profile": "http://ex.com/odrl:profile:toru-profile", // profile:toru-profile defines what "templateValue" is
    "constraint": [{
           "leftOperand": "spatial",
           "operator": "neq",                         // change to the operand you require
           "rightOperand": null,
           "templateValue": true                      // it is left to the next step to "fill in the value"
       }]

In the SHACL, the feedback might be more generic than that which could be provided by way of the profile (e.g. the profile could have a link to a taxonomy of what values are allowed between the 9898.movie and spatial).

A possible issue with this for your users: if they want to "test" your rules before releasing them, you have paths to incomplete/untestable constraints (although this could be "filled in" by the development environment, but i don't know your end goal).

I've opened 65 - but it is a proposal to deal with templates in a different way.

riannella commented 2 weeks ago

As Josh indicated, your proposal would not be semantically correct.

However, another option is to consider using rightOperandReference.

"constraint": [{
           "leftOperand": "spatial",
           "operator": "eq",
           "rightOperand": "http://example.com/getSpatial?asset=http://example.com/asset:9898.movie"
toru-ikeda-iij commented 2 weeks ago

Thank you for your reply. We have found that there is more than one available path. I will mainly consider the method of using Profile, which is appropriate for expressing ODRL, and I will consider whether there is a method that better suits the use case by using rightOperandReference together.

This issue will be closed as the question has been resolved.

Thank you.