odrl icon indicating copy to clipboard operation
odrl copied to clipboard

Add negation operator

Open besteves4 opened this issue 3 years ago • 7 comments

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.

besteves4 avatar Oct 27 '22 16:10 besteves4

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).

coolharsh55 avatar Oct 28 '22 17:10 coolharsh55

Would odrl:isNoneOf meet this requirement?

riannella avatar Oct 29 '22 06:10 riannella

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

coolharsh55 avatar Oct 29 '22 07:10 coolharsh55

Alternatives includes:

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

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

riannella avatar Oct 30 '22 01:10 riannella

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.

coolharsh55 avatar Oct 30 '22 09:10 coolharsh55

As @coolharsh55 has also expressed before, my interpretation of the isPartOf/isAllOf/isAnyOf/isNoneOf operators 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.

besteves4 avatar Nov 01 '22 01:11 besteves4

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

simonstey avatar Feb 06 '23 12:02 simonstey