[Pellet-users] Bug from the pellet-2.0.0-rc6 version ?
Evren Sirin
evren at clarkparsia.com
Thu May 14 13:11:27 UTC 2009
It looks like anonymous DataRange restrictions in this schema cause a
problem in the Pellet loader. I've created a ticket for this issue [1]
and we'll fix it soon. The problem is only in the Jena bindings of
Pellet so if you Pellet through OWLAPI you won't encounter this
problem.
BTW, this schema contains several dangling anonymous DataRange
definitions that are not tied to anything else. This is probably a
Protege 3 issue and if you load the ontology to Protege 4 and save
without any modifications you will see that you get a cleaner version.
Cheers,
Evren
On Fri, May 8, 2009 at 10:20 AM, Etienne Morency-Bachand
<emorency at p3g.org> wrote:
> Hi,
>
>
>
> We are using Pellet with Jena and we had a new bug when using
> pellet-2.0.0-rc06. I’m sending a short test that triggers the error. I’m
> also sending the file that you would need to test the same error.
>
>
>
> We are importing an owl file created with Protege 3.4, schema.owl, where the
> datatype “completionStatus” is defined as a string from a predefined list of
> allowed values.
>
>
>
> Here is the test that we used to get the error:
>
>
>
> public void testPellet26() throws FileNotFoundException {
>
> OntModel ontModel =
> ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
>
> Ontology ont =
> ontModel.createOntology("http://www.p3gobservatory.org/data/generic-schema.owl#");
>
>
> ont.addImport(ontModel.createResource("http://www.p3gobservatory.org/data/schema.owl#"));
>
> ontModel.getDocumentManager().loadImport(ontModel, "file:C:\\Test
> Pellet\\schema.owl"); // add import
>
>
>
> Individual indiv =
> ontModel.createIndividual("http://www.p3gobservatory.org/data/generic-schema.owl#Test",
> ontModel
>
>
> .getOntClass("http://www.p3gobservatory.org/data/schema.owl#Domain"));
>
>
>
> // Fill properties of domains
>
>
> indiv.addProperty(ontModel.getDatatypeProperty("http://www.p3gobservatory.org/data/schema.owl#completionStatus"),
>
> "Under development");
>
>
>
> ontModel.write(new FileOutputStream("C:\\Test
> Pellet\\generic-schema.owl"));
>
>
>
> Individual ds =
> ontModel.getIndividual("http://www.p3gobservatory.org/data/generic-schema.owl#Test");
>
> for (Iterator<Statement> propIt = ds.listProperties();
> propIt.hasNext();) {
>
> Statement s = propIt.next();
>
> System.out.println(s.getPredicate() + " : " + s.getObject());
>
> }
>
> }
>
>
>
>
>
> With pellet-2.0.0-rc5 our test outputs the following:
>
>
>
> Classifying 3 elements
>
>
>
> Classifying: 33% complete in 00:00:00
>
> Classifying: 66% complete in 00:00:00
>
> Classifying: 100% complete in 00:00:00
>
> Classifying finished in 00:00:00
>
> Realizing 3 elements
>
>
>
> Realizing: 33% complete in 00:00:00
>
> Realizing: 66% complete in 00:00:00
>
> Realizing: 100% complete in 00:00:00
>
> Realizing finished in 00:00:00
>
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type :
> http://www.p3gobservatory.org/data/schema.owl#Domain
>
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type :
> http://www.w3.org/2002/07/owl#Thing
>
> http://www.w3.org/2002/07/owl#sameAs :
> http://www.p3gobservatory.org/data/generic-schema.owl#Test
>
> http://www.p3gobservatory.org/data/schema.owl#completionStatus : Under
> development
>
>
>
> With pellet-2.0.0-rc6, th output is the following:
>
>
>
> 05/08/2009 09:50:56,476 ERROR
> org.p3g.jena.DatashaperImporterTest.testPellet26:103 -
>
> org.mindswap.pellet.exceptions.UnsupportedFeatureException: Trying to use a
> literal as an individual. Literal ID: literal
>
> at
> org.mindswap.pellet.KnowledgeBase.addIndividual(KnowledgeBase.java:716)
>
> at
> org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.defineIndividual(DefaultGraphLoader.java:1054)
>
> at
> org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.processTriple(DefaultGraphLoader.java:1775)
>
> at
> org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.processTriples(DefaultGraphLoader.java:1337)
>
> at
> org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.processTriples(DefaultGraphLoader.java:1317)
>
> at
> org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader.load(DefaultGraphLoader.java:1906)
>
> at
> org.mindswap.pellet.jena.PelletInfGraph.load(PelletInfGraph.java:192)
>
> at
> org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:213)
>
> at
> org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:203)
>
> at
> org.mindswap.pellet.jena.PelletInfGraph.findWithContinuation(PelletInfGraph.java:140)
>
> at
> com.hp.hpl.jena.reasoner.BaseInfGraph.graphBaseFind(BaseInfGraph.java:345)
>
> at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:257)
>
> at
> com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:385)
>
> at
> com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:390)
>
> at
> com.hp.hpl.jena.rdf.model.impl.ResourceImpl.listProperties(ResourceImpl.java:152)
>
> at
> org.p3g.jena.DatashaperImporter.testPellet26(DatashaperImporter.java:738)
>
> at
> org.p3g.jena.DatashaperImporterTest.testPellet26(DatashaperImporterTest.java:101)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
>
> at
> org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
>
> at
> org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
>
> at
> org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
>
> at
> org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
>
> at
> org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
>
> at
> org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
>
> at
> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
>
> at
> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
>
> at
> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
>
> at
> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
>
> at
> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
>
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>
>
>
> Here is the content of the file schema.owl:
>
>
>
> <?xml version="1.0"?>
>
> <rdf:RDF
>
> xmlns="http://www.p3gobservatory.org/data/schema.owl#"
>
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
> xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
>
> xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#"
>
> xmlns:owl="http://www.w3.org/2002/07/owl#"
>
> xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
>
> xmlns:swrl="http://www.w3.org/2003/11/swrl#"
>
> xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
>
> xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
>
> xml:base="http://www.p3gobservatory.org/data/schema.owl">
>
> <owl:Ontology rdf:about=""/>
>
> <owl:Class rdf:ID="Domain">
>
> <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >TODO: name should be unique and not empty</owl:versionInfo>
>
> </owl:Class>
>
> <owl:DatatypeProperty rdf:ID="completionStatus">
>
> <rdfs:range>
>
> <owl:DataRange>
>
> <owl:oneOf rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >External validated</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Under development</rdf:first>
>
> </rdf:rest>
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Finished</rdf:first>
>
> </rdf:rest>
>
> </rdf:rest>
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Internal validated</rdf:first>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Pre-validated</rdf:first>
>
> </owl:oneOf>
>
> </owl:DataRange>
>
> </rdfs:range>
>
> <rdfs:domain rdf:resource="#Domain"/>
>
> <rdf:type
> rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
>
> </owl:DatatypeProperty>
>
> <owl:DataRange>
>
> <owl:oneOf rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Risk Factor</rdf:first>
>
> <rdf:rest
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Outcome</rdf:first>
>
> </owl:oneOf>
>
> </owl:DataRange>
>
> <owl:DataRange>
>
> <owl:oneOf rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Category</rdf:first>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Open</rdf:first>
>
> </owl:oneOf>
>
> </owl:DataRange>
>
> <owl:DataRange>
>
> <owl:oneOf rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Not applicable</rdf:first>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Impossible</rdf:first>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Partial</rdf:first>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Complete</rdf:first>
>
> </owl:oneOf>
>
> </owl:DataRange>
>
> <owl:DataRange>
>
> <owl:oneOf rdf:parseType="Resource">
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Complete from only one item</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Complete from 2 or more items</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Partial other</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Impossible covered</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Impossible not covered</rdf:first>
>
> </rdf:rest>
>
> </rdf:rest>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Partial categories for continuous variables</rdf:first>
>
> </rdf:rest>
>
> </rdf:rest>
>
> </owl:oneOf>
>
> </owl:DataRange>
>
> <owl:DataRange>
>
> <owl:oneOf rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Integer</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Date</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Time</rdf:first>
>
> </rdf:rest>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Decimal</rdf:first>
>
> </rdf:rest>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Text</rdf:first>
>
> </owl:oneOf>
>
> </owl:DataRange>
>
> <owl:DataRange>
>
> <owl:oneOf rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Gov. Database</rdf:first>
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest rdf:parseType="Resource">
>
> <rdf:rest
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
>
> <rdf:first
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Other</rdf:first>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Direct Measure</rdf:first>
>
> </rdf:rest>
>
> </rdf:rest>
>
> <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>
> >Questionnaire</rdf:first>
>
> </owl:oneOf>
>
> </owl:DataRange>
>
> </rdf:RDF>
>
> <!-- Created with Protege (with OWL Plugin 3.4, Build 533)
> http://protege.stanford.edu -->
>
>
>
> Thank you very much,
>
>
>
> Etienne Morency-Bachand
>
> P3G.org
>
>
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>
More information about the Pellet-users
mailing list