Open nschejtman opened 3 years ago
I've got the following code which receives two models, one that comes from reading instance data and another from reading an ontology data. Jena's defaul OWL reasoner works just fine like this:
def default(data: Model, schema: Model): InfModel = { val reasoner = ReasonerRegistry.getOWLReasoner.bindSchema(schema) return ModelFactory.createInfModel(reasoner, data) }
I'm able to perform basic inferences like:
aMan a Man
Man subClassOf Human
aMan a Human
However, when using Openllet's reasoner I'm not able to perform even these basic inferences. What am I missing?
Just in case this was my attempt:
def pellet(data: Model, schema: Model): InfModel = { val reasoner = PelletReasonerFactory.theInstance().create().bindSchema(schema) return ModelFactory.createInfModel(reasoner, data) }
Data:
@prefix i: <file://src/test/resources/basic/data#> . @prefix o: <file://src/test/resources/basic/ontology#> . i:Argentina a o:Country . i:BuenosAires a o:Province .
Schema:
@prefix : <file://src/test/resources/basic/ontology#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <file://src/test/resources/basic/ontology#> . <file://src/test/resources/basic/ontology#> rdf:type owl:Ontology . :Region a owl:Class . :Country rdfs:subClassOf :Region . :Province rdfs:subClassOf :Region .
Query:
PREFIX i: <file://src/test/resources/basic/data#> PREFIX o: <file://src/test/resources/basic/ontology#> ASK { i:Argentina a o:Region . i:BuenosAires a o:Region . }
Running that query against the inference model from Jena's default OWL reasoner returns true while Pellet returns false
Looks like this is a bug. The workaround by creating the infModel directly with the union of both my data and schema
I've got the following code which receives two models, one that comes from reading instance data and another from reading an ontology data. Jena's defaul OWL reasoner works just fine like this:
I'm able to perform basic inferences like:
aMan a Man
Man subClassOf Human
aMan a Human
(plus others)However, when using Openllet's reasoner I'm not able to perform even these basic inferences. What am I missing?
Just in case this was my attempt:
Concrete example:
Data:
Schema:
Query:
Running that query against the inference model from Jena's default OWL reasoner returns true while Pellet returns false