owlontologyprotege4

Is it possible to compare two datatype properties using <= in a OWL statement?


I'm new on ontologies and OWL, so I need some help.

I have two datatype properties (or variables): VARmin and VARmax. Both has to be >=0 and <=1. This restriction, I managed to create and it's ok. I did this:

(VARmin some float[<= 1, >= 0]) and (VARmax some float[<= 1, >= 0])

The problem is that I need to compare those variables, just like this form: VARmin <= VARmax. I tried this:

VARmin some float[<=" 'VARmax' "^^float]

but I got this error: "UnsupportedOperationException: Value null is not valid for the facet 32"

I researched some possible solution for this error and I got an explanation about specific datatypes like "Years" and the form to compare integers here: https://mailman.stanford.edu/pipermail/p4-feedback/2007-October/000414.html But this is not my case.

I researched again, but solutions don't match with my problem. Could anyone help me, please!

P.S.: I'm using Protégé version 4.0 and Pellet reasoner 1.5


Solution

  • To solve this question, using SWRL, I created the following rule:

    SomeClass(?someclass), VARmin(?someclass, ?varmin), greaterThanOrEqual(?varmin, 0.0), lessThanOrEqual(?varmin, 1.0), VARmax(?someclass, ?varmax), greaterThanOrEqual(?varmax, 0.0), lessThanOrEqual(?varmax, 1.0), lessThanOrEqual(?varmin, ?varmax) -> ComparisonOK(?someclass)

    In addiction, I found this answer [1] that helped me a lot to create the disjunctions to deny each case specified by the rule above, for example:

    SomeClass(?someclass), VARmin(?someclass, ?varmin), lessThan(?varmin, 0.0) -> ComparisonNotOK(?someclass)

    [1] Disjunction inside SWRL rule