[
https://issues.apache.org/jira/browse/JENA-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16121197#comment-16121197
]
Elie Roux commented on JENA-1380:
---------------------------------
Hmpf sorry, forgot the stack trace:
{noformat}
org.apache.jena.ontology.ConversionException: Cannot convert node
http://www.w3.org/2002/07/owl#bottomObjectProperty to TransitiveProperty
at
org.apache.jena.ontology.impl.TransitivePropertyImpl$1.wrap(TransitivePropertyImpl.java:61)
at org.apache.jena.enhanced.EnhNode.convertTo(EnhNode.java:152)
at org.apache.jena.enhanced.EnhNode.convertTo(EnhNode.java:31)
at org.apache.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:62)
at org.apache.jena.enhanced.EnhNode.viewAs(EnhNode.java:102)
at org.apache.jena.enhanced.EnhGraph.getNodeAs(EnhGraph.java:126)
at
org.apache.jena.ontology.impl.OntModelImpl.lambda$findByTypeAs$58(OntModelImpl.java:2954)
at org.apache.jena.util.iterator.Map1Iterator.next(Map1Iterator.java:46)
at
org.apache.jena.util.iterator.WrappedIterator.next(WrappedIterator.java:94)
at
org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:56)
at
org.apache.jena.util.iterator.NiceIterator$1.hasNext(NiceIterator.java:105)
at
org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
at
org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55)
at
io.bdrc.xmltoldmigration.MigrationTest.testP1331(MigrationTest.java:164)
{noformat}
Line 164 is the line commented with //ERROR in the code pasted in the original
request.
> Exception when reasoner introduces owl:bottomObjectProperty
> -----------------------------------------------------------
>
> Key: JENA-1380
> URL: https://issues.apache.org/jira/browse/JENA-1380
> Project: Apache Jena
> Issue Type: Bug
> Components: Ontology API
> Affects Versions: Jena 3.3.0
> Environment: Linux, Maven, project settings:
> https://github.com/BuddhistDigitalResourceCenter/xmltoldmigration/blob/master/pom.xml
> Reporter: Elie Roux
>
> The Openllet reasoner introduces some owl:bottomObjectProperty triples that
> seem to confuse Jena. I've opened an [openllet
> ticket](https://github.com/Galigator/openllet/issues/17) about that. Here is
> the code that makes Jena fail:
> {noformat}
> String ontostring = "@prefix : <http://purl.bdrc.io/ontology/> .\n" +
> "@prefix bdo: <http://purl.bdrc.io/ontology/> .\n" +
> "@prefix owl: <http://www.w3.org/2002/07/owl#> .\n" +
> "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" +
> "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" +
> "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n" +
> "@base <http://purl.bdrc.io/ontology/> .\n" +
> "\n" +
> "<http://purl.bdrc.io/ontology/> rdf:type owl:Ontology ;\n" +
> " rdfs:label \"BDRC
> Ontology\"^^xsd:string ;\n" +
> " owl:versionInfo \"0.1\"^^xsd:string
> .\n" +
> "\n" +
> "bdo:personKinWho rdf:type owl:ObjectProperty ,\n" +
> " owl:FunctionalProperty ;\n" +
> " rdfs:domain bdo:Kin ;\n" +
> " rdfs:range bdo:Person .\n" +
> "\n" +
> "\n" +
> "bdo:Kin rdf:type owl:Class .\n" +
> "\n" +
> "bdo:Person rdf:type owl:Class .";
> OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
> InputStream stream = new ByteArrayInputStream(ontostring.getBytes());
> m.read(stream, null, "TURTLE");
> ExtendedIterator<OntProperty> ppi = m.listAllOntProperties();
> while (ppi.hasNext()) {
> OntProperty p = ppi.next();
> }
> OntModel ontoModelInferred =
> ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, m);
> ppi = ontoModelInferred.listAllOntProperties();
> while (ppi.hasNext()) { // ERROR
> OntProperty p = ppi.next();
> }
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)