[protege-owl] Problem: Datatype matching problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[protege-owl] Problem: Datatype matching problem

peppesigno
Hi,
i'm working for my thesis and i'm using the protege-owl API. I have to realize a java to owl serializator/deserializator. I have a matching problem when i try to serialize a long java variable with the xsd:long owl datatype. My code works with int or float serialization but when i try to serialize a long it goes in exception.
Does someone know why?
There's some known problem with this type of matching?

I've an object with a long variable numlong initialized for example to the value: 3456L
I create the OWLNamedClass relative to the object e a OWLDatatypeProperty dataValue relative to my long variable. I set as range of the property the xsd:long owl type but when I try to set the value for the object Individual:

mainIndividual.setPropertyValue(hasValue,o);

(hasValue is the OWLDatatype Property, o is the object representing my long variable)

I have this exception:

Exception in thread "main" java.lang.IllegalArgumentException: invalid type: 3456
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.fail(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.checkValue(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.checkValues(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.setDirectOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.setDirectOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.cleandispatch.DefaultDispatch.setDirectOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.cleandispatch.CleanDispatchFrameStore.setDirectOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.setDirectOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.setDirectOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protegex.owl.model.framestore.OWLFrameStore.setDirectOwnSlotValues(OWLFrameStore.java:1007)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.setDirectOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.setOwnSlotValues(Unknown Source)
        at edu.stanford.smi.protegex.owl.model.impl.OWLUtil.setPropertyValue(OWLUtil.java:714)
        at edu.stanford.smi.protegex.owl.model.impl.DefaultRDFIndividual.setPropertyValue(DefaultRDFIndividual.java:432)
        at java2owl.JavaObject2OWL.objSer(JavaObject2OWL.java:182)
        at java2owl.JavaObject2OWL.objectSerializer(JavaObject2OWL.java:42)
        at provetecniche.Test2.main(Test2.java:15)

Someone can help me?

Thank you,

Giuseppe