[ 
https://issues.apache.org/jira/browse/JENA-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16121217#comment-16121217
 ] 

Dave Reynolds commented on JENA-1380:
-------------------------------------

That exception is thrown if you are trying to retrieve a property as a 
particular type (in this case a TransitiveProperty) but property does not have 
the correct type associated with it. Though without seeing the calling code is 
then it's hard to see why it thinks that might be a TransitiveProperty.

So on the face of it that's not a bug but intended behaviour. 

I assume your/pellets processing has added reference to 
owl:bottomObjectProperty but the type declaration of that is not declared in 
the model closure. Since that's an OWL 2 property which is not supported by 
Jena there's no built in knowledge of that property. So you would need to 
either declare it or, easier, set the OntModel to non-strict.



> 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();
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to