w3c / odrl

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

Add negation operator #27

Open besteves4 opened 1 year ago

besteves4 commented 1 year ago

Hi!

There is a not equal (odrl:neq) operator to express "that a given value is not equal to the right operand of the Constraint".

A similar negation operator could be useful for other operators such as having a "is Not A" operator to indicate that a given left operand is not an instance of the right operand of the Constraint. The same exercise can be done for other operators, e.g. odrl:isPartOf -> have a isNotPartOf

To not explode the number of operators, the creation of a "not" operator to be used together with the existent ones, e.g., using the existent odrl:isA with a new odrl:not, could also be considered.

coolharsh55 commented 1 year ago

A note on this in terms of the other issue (#28) where the proposed isNotA operator would only cover nos.2 for constraints, and therefore there should be something that covers all of: 1) should not be the same IRI (neq), 2) should not be a subclass (isNotPartOf), and 3) should not be an instance (isNotA).

riannella commented 1 year ago

Would odrl:isNoneOf meet this requirement?

coolharsh55 commented 1 year ago

I have limited knowledge, I thought isNoneOf means none of those from a list.

riannella commented 1 year ago

Alternatives includes:

1) Create a Prohibition (everything is a 'not')

2) Use SHACL constraint operators: https://www.w3.org/TR/shacl/#core-components

coolharsh55 commented 1 year ago

A simpler alternative as @besteves4 states is to have a isNotA operator as the negation of isA operator - which would give isA/isNotA to be similar to other operator pairs eq/neq, isAllOf/isNoneOf, and gt/lt.

besteves4 commented 1 year ago

As @coolharsh55 has also expressed before, my interpretation of the isPartOf/isAllOf/isAnyOf/isNoneOfoperators is that the corresponding right operand would have to be a list. If not, it is not clear to me the actual difference between the neq or the isNoneOf operators for instance.

Also, creating a prohibition is not a solution for permission-based systems, e.g. Solid, where a permission needs to be present to grant access to a resource.

simonstey commented 1 year ago

Isn't A isNotA B equivalent to A isNoneOf [B] where [B] is a list of length 1?