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] isValidType()

Tania Tudorache tudorache at stanford.edu
Wed Sep 13 11:14:48 PDT 2006


James,

I agree with you, the way datatypes are implemented in Protege OWL can 
be improved. We are looking into that.
Until then, there is a solution to your problem.

Protege OWL wraps the datatype values (other than the core ones, string, 
float, boolean and int) into a RDFSLiteral. (See 
http://protege.stanford.edu/plugins/owl/api/guide.html#OWLDatatypeProperties). 


In order to set a long value for a datatype property with range 
xsd:long, you can use the following code:

        OWLIndividual ind = owlModel.getOWLIndividual("MyIndividual");
        OWLDatatypeProperty longProp = 
owlModel.getOWLDatatypeProperty("longProp");
        
       //setting the value:     
        ind.setPropertyValue(longProp, 
DefaultRDFSLiteral.create(owlModel, new Long(555)));

        //getting the value:      
        RDFSLiteral retValLit = (RDFSLiteral) 
ind.getPropertyValue(longProp);
     
        long longValue = retValLit.getLong();
    
We will also update the documentation from the OWL Developers Guide.

Tania


james.wiley at adelphia.net wrote:

>What on earth is Protege doing with datatype properties?  I have specified a datatype property with range xsd:long, but when I try to use the OWL API to set the datatype property to a Long object, an exception is thrown.  I traced the problem to the isValidType method in ArgumentCheckingFrameStore which only accepts Float, String, Integer, Boolean or Frame.  Why would I be able to set the limit the type and not be able to set the property to that type?  There seems to be a serious mapping problem between valid XSD types and Java types.  What can I do to remedy this situation.  I have an ontology that requires the use of longs (and doubles) and currently they are not supported.
>_______________________________________________
>protege-owl mailing list
>protege-owl at lists.stanford.edu
>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>  
>




More information about the protege-owl mailing list