Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] FAQ: How do I create numeric value restrictions such as "wheels with diameter over 10"?

Timothy Redmond tredmond at
Tue Nov 23 08:01:06 PST 2010

I am noticing that my reply was not very informative and I am guessing 
this is the problem here.  I think that this is working in build 213.   
But if you load an ontology that was already incorrectly written then a 
reasoner will correctly complain about the ontology.

The problem arose because Protege wrote the restriction

    hasCalorificContentValue some integer[>= 400]

incorrectly.  In the previous version of Protege, when this restriction 
was created it gave the 400 value a string type.  In the new version of 
Protege it gives the 400 value the type integer.   Once an ontology 
contains the wrong version of the restriction, a reasoner will correctly 
inform you of a problem.  If you delete the offending restriction and 
recreate it then things will be fine again.

I did the following steps.

   1. Start Protege (Build 213) and open the pizza ontology from the
      uri:  This will
      give you a fresh good copy.
   2. Create a data property, hasCaloricContentValue.
   3. Select the Pizza class and create a subclass, HighCaloriePizza.
   4. Using the class expression editor give HighCaloriePizza the
      definition "Pizza and hasCaloricContentValue some integer[>= 400]".
   5. Check #1: Save the ontology and look at the rdf in a text editor. 
      Search for HighCaloriePizza and you will see that the datatype
      restriction gives the integer 400 the type integer.  Previously it
      was giving the type string.
   6. Go to the individuals tab, select the Pizza class, create an
      individual, myGoodPizza, and give it a data property assertion of
      hasCorificContentValue 600 of type integer.
   7. Check #2: Start the reasoner (I used Hermit 1.3.1).  There are no
      errors and when myGoodPizza is selected it shows up as having a
      type HighCaloriePizza.

Here is what the definition of HighCaloriePizza looks like in my version 
of the Pizza ontology:

     <owl:Class rdf:about="&pizza;HighCaloriePizza">
                 <owl:intersectionOf rdf:parseType="Collection">
                     <rdf:Description rdf:about="&pizza;Pizza"/>
                         <owl:onProperty rdf:resource="&pizza;hasCaloricContentValue"/>
                                 <owl:onDatatype rdf:resource="&xsd;integer"/>
                                 <owl:withRestrictions rdf:parseType="Collection">
                                         <xsd:minInclusive rdf:datatype="&xsd;integer">400</xsd:minInclusive>
         <rdfs:subClassOf rdf:resource="&pizza;Pizza"/>

Note the xsd:integer declaration around the 400 value.


On 10/28/2010 11:51 AM, Timothy Redmond wrote:
> I believe that if you update to the latest Protege 4 (it came out 
> pretty recently) your problem will go away.  I am not sure how long 
> this bug has been there but I am wondering if it has been there for a 
> while and the reasoners essentially discovered it.
> Let me know if this doesn't work.
> -Timothy
> On 10/28/2010 11:23 AM, Tri Datta wrote:
>> Hi All,
>> I'm running through the standard PIZZA ontology, and I'm a little 
>> confused by the discrepancy between what it's telling me to do 
>> (create a numerical comparison) and one of the FAQs, stating "How do 
>> I create numeric value restrictions such as "wheels with diameter 
>> over 10"?" -- which appears to suggest that we simply can't do that...
>> In particular, I'm trying to define a HighCaloriePizza with 
>> "hasCalorificContentValue some integer[>= 400]", and unfortunately, 
>> I'm getting an error as follows upon classifying:
>> _______________
>> IllegalArgumentException: Attempt to constrain 
>> datatype(com.clarkparsia.pellet.datatype.types.real.XSDInteger at 61882bfd) 
>> using constraining facet('MIN_INCLUSIVE') with an unsupported value 
>> ('literal(400,(),')
>> _______________
>> This seems to be suggesting that it's interpreting the 400 value as a 
>> string literal and is therefore unwilling to accept it for 
>> comparison. I also tried:
>> hasCalorificContentValue some integer[>= "400"^^integer]
>> hasCalorificContentValue some integer[>= "400"^^xsd::integer]
>> to try to somehow artificially cast the type, but no luck..
>> This seems to be asking me to do precisely what the FAQ is telling me 
>> not to do, so I was wondering if this was a problem with a feature in 
>> the last beta release,..except it looks like the tutorial that I'm 
>> using is a good bit older. I'm seeing a couple bugs that seem 
>> somewhat related, but as I'm just ripping off the tutorial at this 
>> point, I'm suspecting this is less as a "bug" than "me missing 
>> something quite obvious".
>> Any help would be hugely appreciated.
>> Thanks so much.
>> Tri
>> _______________________________________________
>> protege-owl mailing list
>> protege-owl at
>> Instructions for unsubscribing:
> _______________________________________________
> protege-owl mailing list
> protege-owl at
> Instructions for unsubscribing:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-owl mailing list