[protege-owl] SWRL/Jess Bug

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[protege-owl] SWRL/Jess Bug

Steve Wartik
I've encountered a problem using Jess that I think is caused by a
property whose domain is owl:Thing. Open the attached ontology, activate
the SWRL tab, click the J button, then click the OWL+SWRL->Jess button.
Protege throws the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
edu.stanford.smi.protege.model.DefaultCls
        at
edu.stanford.smi.protegex.owl.swrl.bridge.PropertyInfo.buildPropertyInfoList(PropertyInfo.java:118)
        at
edu.stanford.smi.protegex.owl.swrl.bridge.SWRLRuleEngineBridge.importOWLProperty(SWRLRuleEngineBridge.java:352)
        at
edu.stanford.smi.protegex.owl.swrl.bridge.SWRLRuleEngineBridge.importOWLProperties(SWRLRuleEngineBridge.java:345)
        at
edu.stanford.smi.protegex.owl.swrl.bridge.SWRLRuleEngineBridge.importSWRLRulesAndOWLKnowledge(SWRLRuleEngineBridge.java:163)
        at
edu.stanford.smi.protegex.owl.swrl.bridge.jess.ui.JessControlPanel$ImportActionListener.actionPerformed(JessControlPanel.java:100)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
        at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
        at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
        at java.awt.Component.processMouseEvent(Component.java:5488)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)>
        at java.awt.Component.processEvent(Component.java:5253)
        at java.awt.Container.processEvent(Container.java:1966)
        at java.awt.Component.dispatchEventImpl(Component.java:3955)
        at java.awt.Container.dispatchEventImpl(Container.java:2024)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
        at java.awt.Container.dispatchEventImpl(Container.java:2010)
        at java.awt.Window.dispatchEventImpl(Window.java:1774)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


FYI, the invocation of individualsIterator.next() on line 118 is
returning :SYSTEM-CLASS.

Steve Wartik

<?xml version="1.0"?>
<rdf:RDF
    xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
    xmlns:swrl="http://www.w3.org/2003/11/swrl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
    xmlns="http://www.owl-ontologies.com/simple.owl#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:base="http://www.owl-ontologies.com/simple.owl">
  <owl:Ontology rdf:about="">
    <owl:imports rdf:resource="http://www.w3.org/2003/11/swrlb"/>
    <owl:imports rdf:resource="http://www.w3.org/2003/11/swrl"/>
  </owl:Ontology>
  <owl:Class rdf:ID="Foo"/>
  <owl:ObjectProperty rdf:ID="prop-1"/>
  <owl:ObjectProperty rdf:ID="prop-2"/>
  <Foo rdf:ID="Bar_2"/>
  <swrl:Imp rdf:ID="Rule-1">
    <swrl:head>
      <swrl:AtomList>
        <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
        <rdf:first>
          <swrl:IndividualPropertyAtom>
            <swrl:propertyPredicate rdf:resource="#prop-2"/>
            <swrl:argument1>
              <swrl:Variable rdf:ID="f1"/>
            </swrl:argument1>
            <swrl:argument2>
              <swrl:Variable rdf:ID="f2"/>
            </swrl:argument2>
          </swrl:IndividualPropertyAtom>
        </rdf:first>
      </swrl:AtomList>
    </swrl:head>
    <swrl:body>
      <swrl:AtomList>
        <rdf:first>
          <swrl:ClassAtom>
            <swrl:argument1 rdf:resource="#f1"/>
            <swrl:classPredicate rdf:resource="#Foo"/>
          </swrl:ClassAtom>
        </rdf:first>
        <rdf:rest>
          <swrl:AtomList>
            <rdf:first>
              <swrl:IndividualPropertyAtom>
                <swrl:argument1 rdf:resource="#f1"/>
                <swrl:argument2 rdf:resource="#f2"/>
                <swrl:propertyPredicate rdf:resource="#prop-1"/>
              </swrl:IndividualPropertyAtom>
            </rdf:first>
            <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
          </swrl:AtomList>
        </rdf:rest>
      </swrl:AtomList>
    </swrl:body>
  </swrl:Imp>
  <Foo rdf:ID="Bar_1">
    <prop-1 rdf:resource="#Bar_2"/>
  </Foo>
</rdf:RDF>

<!-- Created with Protege (with OWL Plugin 2.2, Build 322)  http://protege.stanford.edu -->
Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: SWRL/Jess Bug

Martin O'Connor
Steven,

I have checked in a fix for this. You should just need Protege-OWL. Tell
me if it works for you too.

I was wondering if you edited the XML manually to add the following
property or did you use the Protege-OWL GUI or API to do it?

  <Foo rdf:ID="Bar_1">
    <prop-1 rdf:resource="#Bar_2"/>
  </Foo>

Martin

 Wartik wrote:

> I've encountered a problem using Jess that I think is caused by a
> property whose domain is owl:Thing. Open the attached ontology,
> activate the SWRL tab, click the J button, then click the
> OWL+SWRL->Jess button. Protege throws the following exception:
>
> Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
> edu.stanford.smi.protege.model.DefaultCls
>        at
> edu.stanford.smi.protegex.owl.swrl.bridge.PropertyInfo.buildPropertyInfoList(PropertyInfo.java:118)
>
>        at
> edu.stanford.smi.protegex.owl.swrl.bridge.SWRLRuleEngineBridge.importOWLProperty(SWRLRuleEngineBridge.java:352)
>
>        at
> edu.stanford.smi.protegex.owl.swrl.bridge.SWRLRuleEngineBridge.importOWLProperties(SWRLRuleEngineBridge.java:345)
>
>        at
> edu.stanford.smi.protegex.owl.swrl.bridge.SWRLRuleEngineBridge.importSWRLRulesAndOWLKnowledge(SWRLRuleEngineBridge.java:163)
>
>        at
> edu.stanford.smi.protegex.owl.swrl.bridge.jess.ui.JessControlPanel$ImportActionListener.actionPerformed(JessControlPanel.java:100)
>
>        at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
>        at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
>
>        at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
>
>        at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
>        at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
>
>        at
> java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
>        at java.awt.Component.processMouseEvent(Component.java:5488)
>        at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)>
>        at java.awt.Component.processEvent(Component.java:5253)
>        at java.awt.Container.processEvent(Container.java:1966)
>        at java.awt.Component.dispatchEventImpl(Component.java:3955)
>        at java.awt.Container.dispatchEventImpl(Container.java:2024)
>        at java.awt.Component.dispatchEvent(Component.java:3803)
>        at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
>        at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
>        at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
>        at java.awt.Container.dispatchEventImpl(Container.java:2010)
>        at java.awt.Window.dispatchEventImpl(Window.java:1774)
>        at java.awt.Component.dispatchEvent(Component.java:3803)
>        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
>        at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
>
>        at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
>
>        at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
>        at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
>        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
>
>
> FYI, the invocation of individualsIterator.next() on line 118 is
> returning :SYSTEM-CLASS.
>
> Steve Wartik
>
>------------------------------------------------------------------------
>
><?xml version="1.0"?>
><rdf:RDF
>    xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
>    xmlns:swrl="http://www.w3.org/2003/11/swrl#"
>    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
>    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
>    xmlns:owl="http://www.w3.org/2002/07/owl#"
>    xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
>    xmlns="http://www.owl-ontologies.com/simple.owl#"
>    xmlns:dc="http://purl.org/dc/elements/1.1/"
>  xml:base="http://www.owl-ontologies.com/simple.owl">
>  <owl:Ontology rdf:about="">
>    <owl:imports rdf:resource="http://www.w3.org/2003/11/swrlb"/>
>    <owl:imports rdf:resource="http://www.w3.org/2003/11/swrl"/>
>  </owl:Ontology>
>  <owl:Class rdf:ID="Foo"/>
>  <owl:ObjectProperty rdf:ID="prop-1"/>
>  <owl:ObjectProperty rdf:ID="prop-2"/>
>  <Foo rdf:ID="Bar_2"/>
>  <swrl:Imp rdf:ID="Rule-1">
>    <swrl:head>
>      <swrl:AtomList>
>        <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>        <rdf:first>
>          <swrl:IndividualPropertyAtom>
>            <swrl:propertyPredicate rdf:resource="#prop-2"/>
>            <swrl:argument1>
>              <swrl:Variable rdf:ID="f1"/>
>            </swrl:argument1>
>            <swrl:argument2>
>              <swrl:Variable rdf:ID="f2"/>
>            </swrl:argument2>
>          </swrl:IndividualPropertyAtom>
>        </rdf:first>
>      </swrl:AtomList>
>    </swrl:head>
>    <swrl:body>
>      <swrl:AtomList>
>        <rdf:first>
>          <swrl:ClassAtom>
>            <swrl:argument1 rdf:resource="#f1"/>
>            <swrl:classPredicate rdf:resource="#Foo"/>
>          </swrl:ClassAtom>
>        </rdf:first>
>        <rdf:rest>
>          <swrl:AtomList>
>            <rdf:first>
>              <swrl:IndividualPropertyAtom>
>                <swrl:argument1 rdf:resource="#f1"/>
>                <swrl:argument2 rdf:resource="#f2"/>
>                <swrl:propertyPredicate rdf:resource="#prop-1"/>
>              </swrl:IndividualPropertyAtom>
>            </rdf:first>
>            <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>          </swrl:AtomList>
>        </rdf:rest>
>      </swrl:AtomList>
>    </swrl:body>
>  </swrl:Imp>
></rdf:RDF>
>
><!-- Created with Protege (with OWL Plugin 2.2, Build 322)  http://protege.stanford.edu -->
>  
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: SWRL/Jess Bug

Steve Wartik
Martin,

Your fix has solved my problem. So it was the range and not the domain?
Well, I was close.

I read the comment you entered in the code. I gather some things aren't
being handled. Can you summarize them? That'll help me avoid reporting
problems you already know about.

I used only the Protege-OWL GUI to create the ontology.

Thanks,

Steve

Martin O'Connor wrote:

> Steven,
>
> I have checked in a fix for this. You should just need Protege-OWL.
> Tell me if it works for you too.
>
> I was wondering if you edited the XML manually to add the following
> property or did you use the Protege-OWL GUI or API to do it?
>
>  <Foo rdf:ID="Bar_1">
>    <prop-1 rdf:resource="#Bar_2"/>
>  </Foo>
>
> Martin
>


-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: SWRL/Jess Bug

Martin O'Connor

Steven,

The SWRL code does not currently give any warning if an attempt is made
to reason with OWL Full concepts. Currently, it simply silenty ignores
such attempts. I need to work out a strategy for detecting these
occurences. It is not as simple as detecting if the overall ontology is
in OWL Full because all ontologies that import the SWRL ontology become
OWL Full because swrl.owl is in OWl Full.

Martin

Steven Wartik wrote:

> Martin,
>
> Your fix has solved my problem. So it was the range and not the
> domain? Well, I was close.
>
> I read the comment you entered in the code. I gather some things
> aren't being handled. Can you summarize them? That'll help me avoid
> reporting problems you already know about.
>
> I used only the Protege-OWL GUI to create the ontology.
>
> Thanks,
>
> Steve
>
> Martin O'Connor wrote:
>
>> Steven,
>>
>> I have checked in a fix for this. You should just need Protege-OWL.
>> Tell me if it works for you too.
>>
>> I was wondering if you edited the XML manually to add the following
>> property or did you use the Protege-OWL GUI or API to do it?
>>
>>  <Foo rdf:ID="Bar_1">
>>    <prop-1 rdf:resource="#Bar_2"/>
>>  </Foo>
>>
>> Martin
>>
>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: SWRL/Jess Bug

JMiller

Martin,

I have been developing under the belief that OWL Full is to be avoided if at all possible, due to problems in decidability, etc.

Does your statement imply that an ontology that is OWL Full (even without SWRL) becomes problematic only when the SWRL rules use OWL Full concepts from that ontology?

Jim



"Martin O'Connor" <[hidden email]>
Sent by: [hidden email]

06/16/2006 01:06 PM

Please respond to
[hidden email]

To
[hidden email]
cc
Subject
[protege-owl] Re: SWRL/Jess Bug






Steven,

The SWRL code does not currently give any warning if an attempt is made
to reason with OWL Full concepts. Currently, it simply silenty ignores
such attempts. I need to work out a strategy for detecting these
occurences. It is not as simple as detecting if the overall ontology is
in OWL Full because all ontologies that import the SWRL ontology become
OWL Full because swrl.owl is in OWl Full.

Martin

Steven Wartik wrote:

> Martin,
>
> Your fix has solved my problem. So it was the range and not the
> domain? Well, I was close.
>
> I read the comment you entered in the code. I gather some things
> aren't being handled. Can you summarize them? That'll help me avoid
> reporting problems you already know about.
>
> I used only the Protege-OWL GUI to create the ontology.
>
> Thanks,
>
> Steve
>
> Martin O'Connor wrote:
>
>> Steven,
>>
>> I have checked in a fix for this. You should just need Protege-OWL.
>> Tell me if it works for you too.
>>
>> I was wondering if you edited the XML manually to add the following
>> property or did you use the Protege-OWL GUI or API to do it?
>>
>>  <Foo rdf:ID="Bar_1">
>>    <prop-1 rdf:resource="#Bar_2"/>
>>  </Foo>
>>
>> Martin
>>
>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html


Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: SWRL/Jess Bug

Martin O'Connor

Jim

SWRL is based on OWL DL so, for example, atoms of the form Man(?x) or
hasUncle(?x, ?y) expect x and y to be OWL individuals. If OWL Full is
used these could potentially be classes, which SWRL cannot deal with. At
the moment, the SWRLTab will ignore attempts to reason with classes in
this way in an OWL Full ontology. Using OWL Full will not be a problem
if the SWRL rules do not attempt to reason with classes.

It is worth noting that SWRL rules are not in general decidable.

Martin

James A Miller wrote:

>
> Martin,
>
> I have been developing under the belief that OWL Full is to be avoided
> if at all possible, due to problems in decidability, etc.
>
> Does your statement imply that an ontology that is OWL Full (even
> without SWRL) becomes problematic only when the SWRL rules use OWL
> Full concepts from that ontology?
>
> Jim
>
>
>
> *"Martin O'Connor" <[hidden email]>*
> Sent by: [hidden email]
>
> 06/16/2006 01:06 PM
> Please respond to
> [hidden email]
>
>
>
> To
> [hidden email]
> cc
>
> Subject
> [protege-owl] Re: SWRL/Jess Bug
>
>
>
>
>
>
>
>
>
>
> Steven,
>
> The SWRL code does not currently give any warning if an attempt is made
> to reason with OWL Full concepts. Currently, it simply silenty ignores
> such attempts. I need to work out a strategy for detecting these
> occurences. It is not as simple as detecting if the overall ontology is
> in OWL Full because all ontologies that import the SWRL ontology become
> OWL Full because swrl.owl is in OWl Full.
>
> Martin
>
> Steven Wartik wrote:
>
> > Martin,
> >
> > Your fix has solved my problem. So it was the range and not the
> > domain? Well, I was close.
> >
> > I read the comment you entered in the code. I gather some things
> > aren't being handled. Can you summarize them? That'll help me avoid
> > reporting problems you already know about.
> >
> > I used only the Protege-OWL GUI to create the ontology.
> >
> > Thanks,
> >
> > Steve
> >
> > Martin O'Connor wrote:
> >
> >> Steven,
> >>
> >> I have checked in a fix for this. You should just need Protege-OWL.
> >> Tell me if it works for you too.
> >>
> >> I was wondering if you edited the XML manually to add the following
> >> property or did you use the Protege-OWL GUI or API to do it?
> >>
> >>  <Foo rdf:ID="Bar_1">
> >>    <prop-1 rdf:resource="#Bar_2"/>
> >>  </Foo>
> >>
> >> Martin
> >>
> >
> >
> >
> -------------------------------------------------------------------------
> > To unsubscribe go to
> http://protege.stanford.edu/community/subscribe.html
> >
> >
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html