Menu

#1 Exception on accessing date datatype property

open
None
7
2005-02-28
2005-02-28
No

I've encountered a bug: when trying to query a date
datatype property with the following query:

((:instance Company ?Company) (isEstablishedOn ?
Company ?Date))

I get the following exception:

convertToAlgernon(): Cannot convert to Algernon: 1965-
02-01 of type class
edu.stanford.smi.protegex.owl.model.impl.DefaultRDFSL
iteral

The datatype property has a range of xsd:date.

I'm using the Owl build 241 on Protege 3.0.

Any idea what's going on here, or if it's fixable?

Thanks,

Mark

Full exception report:

convertToAlgernon(): Cannot convert to Algernon: 1965-
02-01 of type class edu.st
anford.smi.protegex.owl.model.impl.DefaultRDFSLiteral
convertToAlgernon(): Cannot convert to Algernon: 1965-
02-01 of type class edu.st
anford.smi.protegex.owl.model.impl.DefaultRDFSLiteral
convertToAlgernon(): Cannot convert to Algernon: 1965-
02-01 of type class edu.st
anford.smi.protegex.owl.model.impl.DefaultRDFSLiteral
convertToAlgernon(): Cannot convert to Algernon: 1965-
02-01 of type class edu.st
anford.smi.protegex.owl.model.impl.DefaultRDFSLiteral
java.lang.ClassCastException
at
org.algernon.kb.okbc.protege.AlgernonProtegeKB.query
(AlgernonProtegeK
B.java:295)
at org.algernon.kb.AlgernonKBSet.query
(AlgernonKBSet.java:87)
at org.algernon.aam.opcode.Query.execute
(Query.java:115)
at org.algernon.aam.Processor.process
(Processor.java:246)
at org.algernon.Algernon.ask(Algernon.java:495)
at org.algernon.Algernon.ask(Algernon.java:441)
at org.algernon.Algernon.ask(Algernon.java:387)
at
org.algernon.kb.okbc.protege.plugins.AlgernonTab.doAs
kOrTell(Algernon
Tab.java:520)
at
org.algernon.kb.okbc.protege.plugins.action.AskAction.a
ctionPerformed
(AskAction.java:62)
at javax.swing.AbstractButton.fireActionPerformed
(Unknown Source)
at
javax.swing.AbstractButton$ForwardActionEvents.action
Performed(Unknow
n Source)
at
javax.swing.DefaultButtonModel.fireActionPerformed
(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed
(Unknown Source)
at
javax.swing.plaf.basic.BasicButtonListener.mouseRelea
sed(Unknown Sour
ce)
at java.awt.AWTEventMulticaster.mouseReleased
(Unknown Source)
at java.awt.Component.processMouseEvent
(Unknown Source)
at java.awt.Component.processEvent(Unknown
Source)
at java.awt.Container.processEvent(Unknown
Source)
at java.awt.Component.dispatchEventImpl
(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown
Source)
at java.awt.Component.dispatchEvent(Unknown
Source)
at
java.awt.LightweightDispatcher.retargetMouseEvent
(Unknown Source)
at
java.awt.LightweightDispatcher.processMouseEvent
(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent
(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown
Source)
at java.awt.Window.dispatchEventImpl(Unknown
Source)
at java.awt.Component.dispatchEvent(Unknown
Source)
at java.awt.EventQueue.dispatchEvent(Unknown
Source)
at
java.awt.EventDispatchThread.pumpOneEventForHierarc
hy(Unknown Source)

at
java.awt.EventDispatchThread.pumpEventsForHierarchy
(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents
(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents
(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown
Source)

Discussion

  • Micheal Hewett

    Micheal Hewett - 2005-02-28
    • priority: 5 --> 7
    • assigned_to: nobody --> mhewett
     
  • Micheal Hewett

    Micheal Hewett - 2005-02-28

    Logged In: YES
    user_id=409118

    Hi Mark,

    When Algernon imports external data it tries to map it onto an Algernon
    datatype. In this case it doesn't know what to do with the Owl object so it
    does nothing, which causes an error later in the same function.

    I should probably change the convert method to default to converting to a
    String. I'll put that in the next version.

    If your isEstablishedOn slot is of type String, the fix will fix your problem.
    If it is a Date type (does Protege have Date types?) I will have to make
    further changes to Algernon to support Dates. This is not too hard but will
    take more time.

    As a workaround, is there any way you can retrieve the value as a String?
    Algernon will know what to do with a String.

    Mike

     
  • Mark Feblowitz

    Mark Feblowitz - 2005-03-01

    Logged In: YES
    user_id=1229509

    The two items I expect to have trouble with are
    an occurredOn property with range
    <rdfs:range
    rdf:resource="http://www.w3.org/2001/XMLSchema#date"/>
    and an occurredAt property with range
    <rdfs:range
    rdf:resource="http://www.w3.org/2001/XMLSchema#time"/>

    I suppose I could get by with a conversion to string (although
    I'll lose the cool date and time widgets).

    I'm wondering whether there might be a good general solution
    for all of the non-numeric xml schema types, e.g., to treat
    them as strings.

     

Log in to post a comment.

MongoDB Logo MongoDB