0

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

  • OWL ontologies do not have the concept of a variable. Just facts (triples) and property definitions and constants. Sometimes you can get an inference engine to perform computation by classifying a disjoint entity inconsistency. But for the most part, using SPARQL for computational comparisons is a better fit, and sometimes the only solution. – scotthenninger Mar 20 '16 at 20:13
  • If by variables you're referring to SWRL variables, there are builtins for comparison of variables. See the SWRL specs: https://www.w3.org/Submission/SWRL/#8 – Ignazio Mar 21 '16 at 07:13
  • 1
    In general, OWL axioms need to be "tree-shaped", and what you're asking for (a class expression that asks for individuals who have an X value less than or equal to their Y value) isn't "tree-shaped", since you want to compare the leaf of the "has X value" branch with the leaf of the "has Y value" branch. You'd have to use a SWRL rule to do this. – Joshua Taylor Mar 21 '16 at 12:17
  • There was a recent question that has some similar aspects. The answer and commentary might be helpful. [How to define a class that does not have two equivalent predicate objects?](http://stackoverflow.com/q/36043590/1281433) – Joshua Taylor Mar 21 '16 at 12:19
  • Thank you very much, @JoshuaTaylor, scotthenninger and Ignazio!! Sorry about the time! I was very busy with another part of the project. But I could solve my problem using SWRL, in fact. I'll post the solution here, after that. – Jane Queiroz Apr 08 '16 at 20:32

1 Answers1

0

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

Community
  • 1
  • 1