W3C home > Mailing lists > Public > public-webont-comments@w3.org > March 2004

Jena throws an Exception given a seemingly correct OWL file

From: Antoine Zimmermann <antoine.zimmermann@inrialpes.fr>
Date: Thu, 04 Mar 2004 17:16:35 +0100
Message-ID: <40475663.20404@inrialpes.fr>
To: public-webont-comments@w3.org

I imported an OWL file (file content follows) into Protégé (with the OWL 
plugin) and this is what I got (a Jena Exception):


com.hp.hpl.jena.ontology.ConversionException: Cannot convert node 
http://www.w3.org/1999/02/22-rdf-syntax-ns#rest to OntProperty
    at 
com.hp.hpl.jena.ontology.impl.OntPropertyImpl$1.wrap(OntPropertyImpl.java:65)
    at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:113)
    at com.hp.hpl.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:65)
    at com.hp.hpl.jena.enhanced.EnhNode.viewAs(EnhNode.java:64)
    at com.hp.hpl.jena.enhanced.EnhNode.as(EnhNode.java:69)
    at 
com.hp.hpl.jena.ontology.impl.OntResourceImpl.objectAs(OntResourceImpl.java:1144)
    at 
com.hp.hpl.jena.ontology.impl.RestrictionImpl.getOnProperty(RestrictionImpl.java:118)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.createRestriction(JenaLoader.java:750)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.createAnonymousCls(JenaLoader.java:399)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.createCls(JenaLoader.java:408)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.getCls(JenaLoader.java:957)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.createDirectSuperclasses(JenaLoader.java:457)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.createNamedCls(JenaLoader.java:707)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.createCls(JenaLoader.java:416)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.getCls(JenaLoader.java:957)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.createClses(JenaLoader.java:425)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.<init>(JenaLoader.java:64)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.loadFileHelper(JenaLoader.java:1136)
    at 
edu.stanford.smi.protegex.owl.jena.JenaLoader.loadFile(JenaLoader.java:1063)
    at 
edu.stanford.smi.protegex.owl.jena.JenaOWLKnowledgeBase.load(JenaOWLKnowledgeBase.java:614)
    at 
edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(JenaKnowledgeBaseFactory.java:138)
    at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown Source)
    at 
edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown 
Source)
    at edu.stanford.smi.protege.ui.ProjectManager.importSources(Unknown 
Source)
    at 
edu.stanford.smi.protege.ui.ProjectManager.buildProjectRequest(Unknown 
Source)
    at 
edu.stanford.smi.protege.action.BuildProject.actionPerformed(Unknown Source)
    at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at 
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at 
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
    at 
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at 
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)


My OWL file is as follows:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
      <!ENTITY xsd        "http://www.w3.org/2001/XMLSchema.xsd#" >
      <!ENTITY rdf        "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
      <!ENTITY rdfs        "http://www.w3.org/2000/01/rdf-schema#" >
      <!ENTITY owl        "http://www.w3.org/2002/07/owl#" > ]>

<rdf:RDF
 xmlns:foaf    ="http://xmlns.com/foaf/0.1/"
 xmlns:rdf    ="&rdf;"
 xmlns:xsd    ="&xsd;"
 xmlns:rdfs    ="&rdfs;"
 xmlns:owl    ="http://www.w3.org/2002/07/owl#">
 
  <owl:Ontology rdf:about="">
    <rdfs:comment>Where is the problem ?</rdfs:comment>
  </owl:Ontology>

  <owl:Class rdf:ID="PersonList">
    <rdfs:subClassOf rdf:resource="&rdf;List" />
    <rdfs:label xml:lang="en">Person list</rdfs:label>
    <rdfs:comment xml:lang="en">A list of persons.</rdfs:comment>
    <rdfs:subClassOf>
      <owl:Restriction>
    <owl:onProperty rdf:resource="&rdf;first" />
    <owl:cardinality 
rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
      </owl:Restriction>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty rdf:resource="&rdf;first" />
        <owl:allValuesFrom 
rdf:resource="http://xmlns.com/wordnet/1.6/Person" />
      </owl:Restriction>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty rdf:resource="&rdf;rest" />
        <owl:cardinality 
rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
      </owl:Restriction>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty rdf:resource="&rdf;rest" />
        <owl:allValuesFrom>
          <owl:Class>
            <owl:unionOf rdf:parseType="Collection">
              <owl:Class rdf:about="#PersonList" />
              <owl:Class>
                <owl:oneOf rdf:parseType="Collection">
                  <rdf:List rdf:about="&rdf;nil" />
                </owl:oneOf>
              </owl:Class>
            </owl:unionOf>
          </owl:Class>
        </owl:allValuesFrom>
      </owl:Restriction>
    </rdfs:subClassOf>
  </owl:Class>

</rdf:RDF>
Received on Thursday, 4 March 2004 11:16:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 18 February 2014 13:20:07 UTC