galigator / openllet Goto Github PK
View Code? Open in Web Editor NEWOpenllet is an OWL 2 reasoner in Java, build on top of Pellet.
Home Page: https://www.w3.org/TR/owl2-primer/
License: Other
Openllet is an OWL 2 reasoner in Java, build on top of Pellet.
Home Page: https://www.w3.org/TR/owl2-primer/
License: Other
Hi all,
I am trying to build a custom rule editor for a research project. I am using OWLApi with openllet reasoner.
I have the rule in a seprate ontology as follows.
The question is after I deleted a rule I couldn't get the reseanor to redo the reasoning without the rule.
the code as follows and the ontologies are attached.
Thanks
package com.shadialian.owlapi;
import java.io.File;
import java.util.EnumSet;
import java.util.Set;
import openllet.core.KnowledgeBase;
import openllet.core.KnowledgeBaseImpl;
import openllet.core.rules.model.Rule;
import openllet.owlapi.OWL;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import openllet.owlapi.OpenlletReasoner;
import openllet.owlapi.OpenlletReasonerFactory;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLNamedIndividual;
import org.semanticweb.owlapi.reasoner.Node;
import org.semanticweb.owlapi.reasoner.OWLReasonerConfiguration;
import org.semanticweb.owlapi.reasoner.SimpleConfiguration;
public class Main {
private static final String familyOnt = "family.owl";
private static final String familyRules = "family-rules.owl";
private static final String familyIRI = "http://www.shadialian.com/ontologies/family#";
public static void main(String args[]) throws OWLOntologyCreationException {
owlApiTest();
}
public static void owlApiTest() throws OWLOntologyCreationException {
File familyOntFile = new File(familyOnt);
File familyRulesFile = new File(familyRules);
final OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
final OWLOntology ontology = manager.loadOntologyFromOntologyDocument(familyOntFile);
final OWLOntology rules = manager.loadOntologyFromOntologyDocument(familyRulesFile);
OWLReasonerConfiguration config = new SimpleConfiguration();
final OpenlletReasoner reasoner = OpenlletReasonerFactory.getInstance().createReasoner(rules, config);
System.out.println("done.");
reasoner.getKB().realize();
reasoner.getKB().printClassTree();
System.out.println(reasoner.getKB().getRules());
Set<Rule> rulesSet = reasoner.getKB().getRules();
Rule fRule = (Rule) rulesSet.toArray()[0];
((KnowledgeBaseImpl) reasoner.getKB()).setChanges(EnumSet.of(KnowledgeBase.ChangeType.ABOX_DEL));
rulesSet.clear();
reasoner.getKB().prepare();
reasoner.getKB().realize();
reasoner.flush();
//reasoner.refresh();
//reasoner.prepareReasoner();
//reasoner.getKB().prepare();
//reasoner.getKB().realize();
//reasoner.getKB().printClassTree();
final OWLClass Person = OWL.Class(familyIRI + "Person");
System.out.println("\n-------------------------------------------------\nPerson Indivisuals");
for (final Node<OWLNamedIndividual> ind : reasoner.getInstances(Person, false)) {
System.out.println(ind);
}
final OWLClass Male = OWL.Class(familyIRI + "Male");
System.out.println("\n-------------------------------------------------\nMale Indivisuals");
for (final Node<OWLNamedIndividual> ind : reasoner.getInstances(Male, false)) {
System.out.println(ind);
}
System.out.println(reasoner.getKB().getRules());
}
}
Exception in thread "partitioning" java.lang.UnsupportedOperationException at java.util.Collections$UnmodifiableCollection.add(Collections.java:1055) at openllet.modularity.GraphBuilder$AxiomVisitor.visit(GraphBuilder.java:117) at org.semanticweb.owlapi.model.OWLSubDataPropertyOfAxiom.accept(OWLSubDataPropertyOfAxiom.java:46) at openllet.modularity.GraphBuilder.addAxiom(GraphBuilder.java:610) at java.util.concurrent.ConcurrentHashMap$KeySpliterator.forEachRemaining(ConcurrentHashMap.java:3527) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at openllet.modularity.GraphBasedModuleExtractor.extractModuleSignatures(GraphBasedModuleExtractor.java:46) at openllet.modularity.AbstractModuleExtractor.extractModuleSignatures(AbstractModuleExtractor.java:224) at openllet.modularity.AbstractModuleExtractor.extractModules(AbstractModuleExtractor.java:198) at openllet.modularity.IncrementalClassifier$2.run(IncrementalClassifier.java:503)
beause when ontology has DataProperty, GraphBuilder
public void visit(OWLSubDataPropertyOfAxiom axiom) {
Node subNode = GraphBuilder.this._graph.createEntityNode(((OWLDataPropertyExpression)axiom.getSubProperty()).asOWLDataProperty());
Node supNode = GraphBuilder.this._graph.createEntityNode(((OWLDataPropertyExpression)axiom.getSuperProperty()).asOWLDataProperty());
subNode.getOutputs().add(supNode);
}
subNode.getOutputs() return is Collections.unmodifiableSet!
When I import latest version:
<dependency>
<groupId>com.github.galigator.openllet</groupId>
<artifactId>openllet-jena</artifactId>
<version>2.6.0</version>
</dependency>
and import it in a java file:
import com.github.galigator.openllet;
I get the error:
[ERROR] xxx.java:[23,28] package com.github.galigator does not exist
Find a way to shutdown the following warning :
[main] WARN org.semanticweb.owlapi.util.SAXParsers - http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[main] WARN org.semanticweb.owlapi.util.SAXParsers - entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'entityExpansionLimit' is not recognized.
Morning Galigator,
I'm using openllet 2.6.3 snapshot in my new Jena application and InfModel.listStatements();
seems to work oddly.
After creating and reading my ontology and inferring it, I'm a not able to list the statements. A simple request on a special unique statement works.
InfModel model = ModelFactory.createInfModel(PelletReasonerFactory.theInstance().create(), afferedOntology);
model.listStatements();
The error happens directly in Openllet so I ask you if you ever met such an issue.
Thx in advance,
GA
Here is the log of the Exception :
> 2018-03-23 16:54:52 SEVERE OntoSPC main null
> java.lang.ArrayIndexOutOfBoundsException
> at java.lang.System.arraycopy(Native Method)
> at openllet.core.rules.rete.BetaMemoryIndex$Unindexed.restore(BetaMemoryIndex.java:100)
> at openllet.core.rules.rete.BetaMemoryNode.restore(BetaMemoryNode.java:101)
> at openllet.core.rules.rete.ReteNode.restore(ReteNode.java:58)
> at openllet.core.rules.rete.BetaMemoryNode.restore(BetaMemoryNode.java:100)
> at openllet.core.rules.rete.ReteNode.restore(ReteNode.java:58)
> at openllet.core.rules.rete.ReteNode.restore(ReteNode.java:58)
> at openllet.core.rules.rete.BetaMemoryNode.restore(BetaMemoryNode.java:100)
> at openllet.core.rules.rete.ReteNode.restore(ReteNode.java:58)
> at openllet.core.rules.rete.ReteNode.restore(ReteNode.java:58)
> at openllet.core.rules.rete.BetaMemoryNode.restore(BetaMemoryNode.java:100)
> at openllet.core.rules.rete.ReteNode.restore(ReteNode.java:58)
> at openllet.core.rules.rete.ReteNode.restore(ReteNode.java:58)
> at openllet.core.rules.rete.Interpreter.restore(Interpreter.java:55)
> at openllet.core.rules.ContinuousRulesStrategy.restoreRules(ContinuousRulesStrategy.java:419)
> at openllet.core.rules.ContinuousRulesStrategy.restore(ContinuousRulesStrategy.java:387)
> at openllet.core.tableau.completion.SROIQStrategy.backtrack(SROIQStrategy.java:99)
> at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:275)
> at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417)
> at openllet.core.utils.Timers.execute(Timers.java:118)
> at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1417)
> at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1269)
> at openllet.core.KnowledgeBaseImpl.consistency(KnowledgeBaseImpl.java:2178)
> at openllet.core.KnowledgeBaseImpl.isConsistent(KnowledgeBaseImpl.java:2253)
> at openllet.jena.PelletInfGraph.prepare(PelletInfGraph.java:260)
> at openllet.jena.PelletInfGraph.prepare(PelletInfGraph.java:245)
> at openllet.jena.PelletInfGraph.findWithContinuation(PelletInfGraph.java:163)
> at org.apache.jena.reasoner.BaseInfGraph.graphBaseFind(BaseInfGraph.java:371)
> at org.apache.jena.graph.impl.GraphBase.find(GraphBase.java:255)
> at org.apache.jena.graph.Graph.find(Graph.java:111)
> at org.apache.jena.graph.GraphUtil.findAll(GraphUtil.java:102)
> at org.apache.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:1130)
> at OntoSPC.main(OntoSPC.java:48)
I'm using Openllet for queries on my ontology as suggested here. Afterwards I try to convert the given individuals to org.apache.jena.ontology.Individual which causes the Exception. Im not sure if it is a Jena Bug or caused by Openllet. I already opened ticket on the JENA Dashboard.
If it is not related to Openllet, I'm sorry for bothering.
Here is the testcode:
package bug;
import openllet.jena.PelletReasonerFactory;
import openllet.query.sparqldl.jena.SparqlDLExecutionFactory;
import org.apache.jena.ontology.OntModel;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.query.ResultSetFormatter;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.ontology.Individual;
import org.apache.jena.ontology.OntClass;
import org.apache.jena.util.iterator.ExtendedIterator;
import java.util.ArrayList;
public class SPARQLDLBug
{
// The ontology loaded as dataset
private static final String ontology = "ontologies/simple.owl";
private static final String query = "query.sparql";
public void run()
{
// First create a Jena ontology model backed by the Pellet reasoner
// (note, the Pellet reasoner is required)
final OntModel m = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
// Then read the _data from the file into the ontology model
m.read(ontology);
// Now read the query file into a query object
final Query q = QueryFactory.read(query);
// Create a SPARQL-DL query execution for the given query and
// ontology model
final QueryExecution qe = SparqlDLExecutionFactory.create(q, m);
// We want to execute a SELECT query, do it, and return the result set
final ResultSet rs = qe.execSelect();
ArrayList<String> result = new ArrayList<String>();
while(rs.hasNext()){
QuerySolution qs = rs.next();
// The Bug occurs in the next line
Individual in = qs.getResource("x").as(Individual.class);
ExtendedIterator<OntClass> it = in.listOntClasses(true);
String className = "";
while(it.hasNext()){
className = it.next().toString();
}
result.add(className);
}
qe.close();
}
public static void main(final String[] args)
{
final SPARQLDLBug app = new SPARQLDLBug();
app.run();
}
}
Here is the simple query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bio: <http://www8.cs.fau.de/research:cgm/schizophrenia#>
SELECT ?x
WHERE { ?x rdf:type bio:AcuteSchizophrenia }
And this is the error message:
Exception in thread "main" org.apache.jena.ontology.ConversionException: Cannot convert node http://www8.cs.fau.de/research:cgm/schizophrenia#R_AcuteSchizophrenia to Individual
at org.apache.jena.ontology.impl.IndividualImpl$1.wrap(IndividualImpl.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.as(EnhNode.java:107)
at bug.SPARQLDLBug.run(SPARQLDLBug.java:58)
The ontology consists of a class and one individual only:
<?xml version="1.0"?>
<rdf:RDF xmlns="http://www8.cs.fau.de/research:cgm/schizophrenia#"
xml:base="http://www8.cs.fau.de/research:cgm/schizophrenia"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
xmlns:swrl="http://www.w3.org/2003/11/swrl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<owl:Ontology rdf:about="http://www8.cs.fau.de/research:cgm/schizophrenia">
</owl:Ontology>
<!-- http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral -->
<rdfs:Datatype rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral"/>
<owl:Class rdf:about="http://www8.cs.fau.de/research:cgm/schizophrenia#AcuteSchizophrenia">
<rdfs:label xml:lang="en">Acute schizophrenia</rdfs:label>
</owl:Class>
<owl:NamedIndividual rdf:about="http://www8.cs.fau.de/research:cgm/schizophrenia#R_AcuteSchizophrenia">
<rdf:type rdf:resource="http://www8.cs.fau.de/research:cgm/schizophrenia#AcuteSchizophrenia"/>
</owl:NamedIndividual>
</rdf:RDF>
Best regards,
Christian
Attached is a ontology that appears to cause an infinite loop in the EmptySRIQStrategy, continuously calling SomeValuesRule(), blocking and branching without end.
A fragment of the logging which shows the repeated portion the loop:
openllet.core.tableau.completion.EmptySRIQStrategy complete Starting with _node anon(6)
openllet.core.tableau.completion.EmptySRIQStrategy expand Stop _blocked anon(6)
openllet.core.tableau.completion.EmptySRIQStrategy complete Starting with _node anon(7)
openllet.core.tableau.completion.CompletionStrategy applyUniversalRestrictions REF : anon(8) _TOP_OBJECT_PROPERTY_
openllet.core.tableau.completion.rule.SomeValuesRule applySomeValuesRule SOME: anon(7) -> agent_in -> anon(8) : Process (*) - DS{branch:4, depends:[0, 1, 2, 3]}
openllet.core.tableau.completion.CompletionStrategy applyUniversalRestrictions REF : anon(9) _TOP_OBJECT_PROPERTY_
openllet.core.tableau.completion.rule.SomeValuesRule applySomeValuesRule SOME: anon(7) -> has_part -> anon(9) : Agent (*) - DS{branch:5, depends:[0, 1, 2, 3, 4]}
<start repeat>
openllet.core.tableau.completion.EmptySRIQStrategy complete Starting with _node anon(8)
openllet.core.tableau.completion.EmptySRIQStrategy expand Stop _blocked anon(8)
openllet.core.tableau.completion.EmptySRIQStrategy complete Starting with _node anon(9)
...
As far as I can tell, it is valid OWL2 DL and Openllint doesn't spot anything.
I have tried changing OpenlletOptions (USE_COMPLETION_STRATEGY, and IGNORE_INVERSES) but no change.
openllet-owlapi (2.64)
thanks
Consider the simplest of ontologies with two individuals A and B
@prefix : <http://test#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@base <http://test#> .
:A rdf:type owl:NamedIndividual .
:B rdf:type owl:NamedIndividual .
Writing the inferred models leads to:
:A a owl:Thing , owl:NamedIndividual ;
owl:differentFrom :B , :A ;
owl:sameAs :A .
As you can see A is different from A and the same as A, which is a contradiction. The same happens with B
The code to reproduce this is (Scala):
val data = ModelFactory.createDefaultModel()
OpenlletOptions.USE_UNIQUE_NAME_ASSUMPTION = true
data.read("src/test/resources/two-individuals/data.ttl", "TTL")
val reasoner = PelletReasonerFactory.theInstance().create()
val infModel = ModelFactory.createInfModel(reasoner, data)
infModel.write(new FileWriter("src/test/resources/two-individuals/data.inferred.ttl"), "TTL")
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
(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:
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
there was a pellet-cli.jar available.
do you plan to release a similar tool?
Hi,
I'm using openllet-owlapi version 2.6.4 and owlapi-api version 5.1.5.
I get this NullPointerException
when I try to work with a specific ontology:
Exception in thread "main" java.lang.NullPointerException
at openllet.core.tableau.blocking.BlockingContext.moveBlockerUp(BlockingContext.java:45)
at openllet.core.tableau.blocking.Blocking.isDirectlyBlockedByDescendant(Blocking.java:156)
at openllet.core.tableau.blocking.Blocking.isDirectlyBlockedInt(Blocking.java:129)
at openllet.core.tableau.blocking.Blocking.isBlocked(Blocking.java:80)
at openllet.core.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:104)
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:251)
at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417)
at openllet.core.utils.Timers.execute(Timers.java:118)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1417)
at openllet.core.boxes.abox.ABoxImpl.existType(ABoxImpl.java:905)
at openllet.core.knowledge.InstancesBase.retrieve(InstancesBase.java:268)
at openllet.core.KnowledgeBaseImplFullSync.retrieve(KnowledgeBaseImplFullSync.java:733)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1353)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1361)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1361)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1361)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcepts(CDOptimizedTaxonomyBuilder.java:1322)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.realize(CDOptimizedTaxonomyBuilder.java:1181)
at openllet.core.KnowledgeBaseImpl.realize(KnowledgeBaseImpl.java:1950)
at openllet.core.KnowledgeBaseImplFullSync.realize(KnowledgeBaseImplFullSync.java:391)
at openllet.owlapi.PelletReasoner.precomputeInferences(PelletReasoner.java:1285)
As the ontology is not public yet I'd like to send it to you via mail (or some other channel. It's nothing secret, but I'm not comfortable sharing it openly without consent from all involved parties).
Initially I got the exception when I called reasoner.types(someIndividual)
, and I have now created a smaller version to investigate this error better: https://gist.github.com/Locke/c275b45823f014ba4a09400fe462c39d
The basic idea is that there is a basic ontology (created with Protégé) which is then imported by a second file that contains the individuals (created programmatically via owlapi from some other data source).
As I'm quite new to owl it might be that I made a terrible mistake, but in that case it should be detected and guided with a better exception.
Hi, first let me thank you for your efforts to keep the Pellet project alive !
I've made some tests and I'm facing a known problem just as https://github.com/Galigator/openllet/issues/22 did.
It seems the Inverse Functions are problematic. Here is the error I get :
Exception in thread "main" openllet.core.exceptions.InternalReasonerException: Invalid term found FunInv(http://www.geo.ulg.ac.be/nys/hasItem)
Before that, another ObjectProperty was problematic, I created its inverse function and all seems working fine, until this new error appeared. But the inverse of hasItem has already been created. I don't know how to deal with it.
The problem is only Openllet with Jena shows me such an error (Pellet in Protégé doesn't).
I don't know if i'm explicit enough :/ Thank you in advance,
GA
Could you please deploy this project to the central Maven's repository? I would be easier to retrieve it from the repository than installing it manually on machines.
I am using openllet 2.6.3 and owlapi 5.1.19 . have some swrl rules created by protege :
Patient(?patient) ^ Has_EDSS(?patient, ?edss) ^ swrlb:lessThan(?edss, 7777) ->Should_be_used(?patient,:_Treadmill_walking)
but i get error:
Exception in thread "main" openllet.atom.OpenError: Unsupported rule Rule([Patient(?patient), Has_EDSS(?patient,?edss), lessThan([?edss, "7777"^^integer])] => [Should_be_used(?patient,_Treadmill_walking)])
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:208)
Caused by: java.lang.UnsupportedOperationException: Builtin using unsafe variables: [lessThan([?edss, "7777"^^integer])]
at openllet.core.rules.rete.Compiler.compile(Compiler.java:235)
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:204)
also I open the question in stackoverflow
I'm using Openllet 2.6.5 with owlapi 5.1.16 to generate explanations for assertions and it works for the most part, but there's often invalid rules within the explanations. Asking the program to explain why "prop a b" is true might lead to an explanation that includes the contradicting rule "... -> not-prop a b", but is otherwise correct.
Using Protege with the pellet reasoner leads to correct explanations without those contradicting rules, so it most likely isn't a problem with the ontology itself.
The openllet reasoner is initialized via
//OwlOntoLayer onto
final OpenlletReasoner reasoner = OpenlletReasonerFactory.getInstance().createReasoner(this.onto.getOntology());
expGen = new PelletExplanation(reasoner);
and the explanation obtained with
OWLDataFactory dataFactory = this.ontology.getOWLOntologyManager().getOWLDataFactory();
OWLObjectPropertyAssertionAxiom propertyAssertion = dataFactory.getOWLObjectPropertyAssertionAxiom((OWLObjectPropertyExpression)objectProperty, (OWLIndividual)domain, (OWLIndividual)range);
System.out.println(expGen.getEntailmentExplanation((OWLAxiom)propertyAssertion));
The code seems to be correct when compared with the examples, all other variables output the expected value when you print them, and aside from the inconsistent rule the explanation is correct, which makes me believe it's not a problem with the code either.
I can't share the ontology I'm currently using, but if you think there might be a problem with it I can try recreating the problem with another ontology.
Hey Guys,
I have a problem when I use getObjectPropertyDomains from Openllet and my ontology has only properties (no have classes). The Exception is proposital in this case? I expected a empty set or empty stream but no this exception.
Thanks for all!
Follow my trace:
java.lang.NullPointerException
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.markToldSubsumers(CDOptimizedTaxonomyBuilder.java:704)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.doTopSearch(CDOptimizedTaxonomyBuilder.java:972)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:839)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:801)
at openllet.core.KnowledgeBaseImpl.getAllEquivalentClasses(KnowledgeBaseImpl.java:3971)
at openllet.core.KnowledgeBaseImpl.getEquivalentClasses(KnowledgeBaseImpl.java:3937)
at openllet.owlapi.PelletReasoner.getObjectPropertyDomains(PelletReasoner.java:702)
I discovered this repository because I had an issue with https://github.com/stardog-union/pellet. In this pull request the openllet repo is referenced. However, it remains unclear, whether openllet is a fork of pellet and might become its successor or in what other relation the repos stand.
Some more information in the README would help potential new users to have clear knowledge which of the two reasoners they should use for which use case.
Since beginning some tests (about 20) aren't activated in the OWL-API module.
There is various problems related to them:
At the end we could want those test on the JENA module too.
I have been running experiments to find the time taken for consistency checking with increasing size ontologies. I performed each experiment for 5 iterations and in each iteration, the results show two different behaviours (as shown in attached images el_results.jpeg and dl_results.jpeg) for EL and DL ontologies.:
1) inconsistency in result: sometimes the time taken by an ontology is very less and sometimes it times out (Time-out is 1.5 hrs). (Along the rows)
2) wrong result: smaller size ontology is taking more time (even times-out) than a larger size ontology (takes only a few seconds). (Along the columns)
Below is the link for the EL and DL ontologies.
https://drive.google.com/drive/folders/1HYURRLaQkLK8cQwV-UBNKK4_Zur2nU68?usp=sharing
I am using Openllet 2.6.4 and OWL API 5.1.0.
Also, pellet did not show the first behaviour. Although, it is also showing the second behaviour for DL ontologies (OWL2DL-2.owl is taking less time than OWL2DL-1.owl).
More Details about the ontologies:
I am working on a benchmark for different OWL 2 profiles https://github.com/kracr/owl2bench . The TBox is a university ontology (just like UOBM) and user gives 'number of universities' as input to generate ontologies of varying size. So, the numbers 1, 2, 5... in the file names OWL2EL-1.owl, OWL2EL-2.owl ... represent the increasing size of ontologies.
When running the following code with openllet 2.6.1:
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();
}
I get:
org.apache.jena.ontology.ConversionException: Cannot convert node http://www.w3.org/2002/07/owl#bottomObjectProperty to TransitiveProperty
at the line marked with // ERROR
.
The error goes away if I don't give the property the type owl:FunctionalProperty
.
WebOnt-description-logic-905 parse time 0
org.semanticweb.owlapi.reasoner.TimeOutException: Timeout occurred while reasoning!
at openllet.owlapi.PelletReasoner.convert(PelletReasoner.java:397)
at openllet.owlapi.PelletReasoner.isConsistent(PelletReasoner.java:1015)
at openllet.owlwg.runner.pellet.PelletOA3TestRunner.isConsistent(PelletOA3TestRunner.java:50)
at openllet.owlwg.owlapi.runner.impl.OwlApiAbstractRunner$XConsistencyTest.run(OwlApiAbstractRunner.java:216)
at openllet.owlwg.runner.pellet.PelletOA3TestRunner.run(PelletOA3TestRunner.java:64)
at openllet.owlwg.owlapi.runner.impl.OwlApiAbstractRunner.runConsistencyTest(OwlApiAbstractRunner.java:358)
at openllet.owlwg.owlapi.runner.impl.OwlApiAbstractRunner$Runner.visit(OwlApiAbstractRunner.java:125)
at openllet.owlwg.owlapi.testcase.impl.OwlApiConTstImpl.accept(OwlApiConTstImpl.java:35)
at openllet.owlwg.owlapi.runner.impl.OwlApiAbstractRunner$Runner.getResults(OwlApiAbstractRunner.java:117)
at openllet.owlwg.owlapi.runner.impl.OwlApiAbstractRunner.run(OwlApiAbstractRunner.java:351)
at openllet.pellet.owlapi.test.OWLWGTestCase.runTestCase(OWLWGTestCase.java:147)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:748)
EXCEPTION [WebOnt-description-logic-905]
If I use the OpenlletReasoner
and want to retrieve any Instances for any Class Expression containing Owl Complements, it either yields no result even though they are definitely Individuals fitting or some bot not all.
I created a small Ontology and code for reproducing that, and it turns out that the getInstances always returned 0 elements for the ClassExpressions containing a complement.
However using https://github.com/SmartDataAnalytics/SML-Bench/blob/updates/learningtasks/carcinogenesis/owl/data/carcinogenesis.owl and f.e. not carcinogenesis:Bond-2
contains 13055 Instances, so it is not always empty, but it should be way more.
Small Ontology file for reproducing:
@prefix : <http://example.com#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://example.com#> .
<http://example.com> rdf:type owl:Ontology .
:Carbon rdf:type owl:Class .
:Oxygen rdf:type owl:Class .
Parser parser = new Parser("test2.ttl");
:Oxygen-40 rdf:type owl:Class ;
rdfs:subClassOf :Oxygen .
:Oxygen-10 rdf:type owl:Class ;
rdfs:subClassOf :Oxygen .
:Carbon-10 rdf:type owl:Class ;
rdfs:subClassOf :Carbon .
:hasOxygen rdf:type owl:ObjectProperty ;
rdfs:domain :Carbon ;
rdfs:range :Oxygen .
:Individual-40 rdf:type :Oxygen-40 .
:Individual-10 rdf:type :Oxygen-10 .
:Individual-Carbon-10 rdf:type :Carbon-10 ;
:hasOxygen :Individual-10 .
:Individual-Carbon-10-2 rdf:type :Carbon-10 ;
:hasOxygen :Individual-40 .
Code which shows the problem:
public void test() throws OWLOntologyCreationException {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
ontology = manager.loadOntologyFromOntologyDocument(new File("ontology.ttl"));
OpenlletReasoner res = OpenlletReasonerFactory.getInstance().createReasoner(ontology);
res.prepareReasoner();
OWLClass carbon10 = new OWLClassImpl(IRI.create("http://example.com#Carbon-10"));
OWLClass oxygen40 = new OWLClassImpl(IRI.create("http://example.com#Oxygen-40"));
OWLClass oxygen10 = new OWLClassImpl(IRI.create("http://example.com#Oxygen-10"));
OWLClass oxygenBase = new OWLClassImpl(IRI.create("http://example.com#Oxygen"));
Set<OWLNamedIndividual> notCarbon10 = res.getInstances(new OWLObjectComplementOfImpl(carbon10), false).getFlattened();
Set<OWLNamedIndividual> notOxygen40 = res.getInstances(new OWLObjectComplementOfImpl(oxygen40)).getFlattened();
Set<OWLNamedIndividual> notOxygen10 = res.getInstances(new OWLObjectComplementOfImpl(oxygen10)).getFlattened();
Set<OWLNamedIndividual> notOxygenBase = res.getInstances(new OWLObjectComplementOfImpl(oxygenBase)).getFlattened();
Set<OWLNamedIndividual> carbon10Individuals = res.getInstances(carbon10).getFlattened();
Set<OWLNamedIndividual> oxygen40Individuals = res.getInstances(oxygen40).getFlattened();
Set<OWLNamedIndividual> oxygen10Individuals = res.getInstances(oxygen10).getFlattened();
Set<OWLNamedIndividual> oxygenBaseIndividuals = res.getInstances(oxygenBase).getFlattened();
System.out.println("Carbon-10 Individuals: "+carbon10Individuals);
System.out.println("Oxygen-40 Individuals: "+oxygen40Individuals);
System.out.println("Oxygen-10 Individuals: "+oxygen10Individuals);
System.out.println("Oxygen Individuals: "+oxygenBaseIndividuals);
if(notCarbon10.isEmpty()){
System.err.println("(not Carbon-10): Should contain :Individual-10, :Individual-40");
}
if(notOxygen40.isEmpty()){
System.err.println("(not Oxygen-40): Should contain :Individual-10, :Individual-Carbon-10, :Individual-Carbon-10-2");
}
if(notOxygen10.isEmpty()){
System.err.println("(not Oxygen-10): Should contain :Individual-40, :Individual-Carbon-10, :Individual-Carbon-10-2");
}
if(notOxygenBase.isEmpty()){
System.err.println("(not Oxygen): Should contain :Individual-Carbon-10, :Individual-Carbon-10-2");
}
OWLObjectProperty hasOxygen = new OWLObjectPropertyImpl(IRI.create("http://example.com#:hasOxygen"));
OWLClassExpression hasOxygenSomeOxygen10 = new OWLObjectSomeValuesFromImpl(hasOxygen, oxygen10);
// Carbon-10 and (hasOxygen only (not Oxygen-10)) -> only Individual is Individual-Carbon-10-2
OWLClassExpression carbon10AndhasOxygenOnlyNotOxygen10 = new OWLObjectIntersectionOfImpl(Lists.newArrayList(carbon10, hasOxygenSomeOxygen10.getComplementNNF()));
Set<OWLNamedIndividual> carbon10hasOxygen40 = res.getInstances(carbon10AndhasOxygenOnlyNotOxygen10).getFlattened();
if(carbon10hasOxygen40.isEmpty()){
System.err.println("(Carbon-10 and (hasOxygen only (not Oxygen-10))): Should contain :Individual-Carbon-10-2");
}
}
I am trying to use the OpenlletReasonerFactory
from version 2.6.5 as you can see in maven dependency below:
<dependency>
<groupId>com.github.galigator.openllet</groupId>
<artifactId>openllet-owlapi</artifactId>
<version>2.6.5</version>
</dependency>
However, when I try to build my project with IntelliJ the error class file has wrong version 54.0, should be 52.0
appears. I am using Java 8:
Do I really need to update my Java version? What version of Openllet works with Java 8?
I ran into a problem with what seems to be a bug with the minQualifiedCardinality
axiom. It exists in Pellet as well, but when using HermiT there is no problem. There are workarounds of course but I would like to be able to use this axiom as it was meant to work.
The error it throws is as follows:
java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
at openllet.core.tableau.branch.DisjunctionBranch.tryBranch(DisjunctionBranch.java:164) ~[openllet-core-2.6.5.jar:2.6.5]
at openllet.core.tableau.branch.Branch.tryNext(Branch.java:130) ~[openllet-core-2.6.5.jar:2.6.5]
at openllet.core.tableau.completion.SROIQStrategy.backtrack(SROIQStrategy.java:112) ~[openllet-core-2.6.5.jar:2.6.5]
at openllet.core.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:170) ~[openllet-core-2.6.5.jar:2.6.5]
at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417) ~[openllet-core-2.6.5.jar:2.6.5] at openllet.core.utils.Timers.execute(Timers.java:118) ~[openllet-core-2.6.5.jar:2.6.5]
It goes on for a while but this probably the most relevant part.
I've had the problem with several ontologies but below is the simplest ontology that I could make that triggers the exception:
@prefix : <http://test.org#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://test.org> .
<http://test.org> rdf:type owl:Ontology .
:rel rdf:type owl:ObjectProperty .
:class rdf:type owl:Class .
:one rdf:type owl:Class .
:two rdf:type owl:Class .
:three rdf:type owl:Class .
:four rdf:type owl:Class .
:subclass rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty :rel ;
owl:minQualifiedCardinality "2"^^xsd:nonNegativeInteger ;
owl:onClass [ rdf:type owl:Class ;
owl:unionOf ( :four
:three
:two
:one
)
]
] ;
rdfs:subClassOf :class .
:first rdf:type owl:NamedIndividual, :one .
:member rdf:type owl:NamedIndividual, :class ;
:rel :first, :second .
:second rdf:type owl:NamedIndividual, :two .
[ rdf:type owl:AllDifferent ;
owl:distinctMembers ( :first
:member
:second
)
] .
The build process work, but the following error throw.
[main] WARN uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl - BADLY BEHAVING LISTENER: Manager on ontology OntologyID(OntologyIRI(owlapi:ontology:ont12) VersionIRI()) is null; the ontology is no longer associated to a manager. Ensure the ontology is not being used after being removed from its manager. has been removed
java.lang.IllegalStateException: Manager on ontology OntologyID(OntologyIRI(owlapi:ontology:ont12) VersionIRI()) is null; the ontology is no longer associated to a manager. Ensure the ontology is not being used after being removed from its manager.
at org.semanticweb.owlapi.util.OWLAPIPreconditions.verifyNotNull(OWLAPIPreconditions.java:83)
at uk.ac.manchester.cs.owl.owlapi.OWLImmutableOntologyImpl.getOWLOntologyManager(OWLImmutableOntologyImpl.java:75)
at uk.ac.manchester.cs.owl.owlapi.concurrent.ConcurrentOWLOntologyImpl.getOWLOntologyManager(ConcurrentOWLOntologyImpl.java:126)
at openllet.modularity.IncrementalClassifier.ontologiesChanged(IncrementalClassifier.java:445)
at org.semanticweb.owlapi.model.DefaultChangeBroadcastStrategy.broadcastChanges(DefaultChangeBroadcastStrategy.java:31)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.broadcastChanges(OWLOntologyManagerImpl.java:1430)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.applyChanges(OWLOntologyManagerImpl.java:558)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.removeAxioms(OWLOntologyManagerImpl.java:624)
at openllet.modularity.test.PersistenceUpdatesTest.testAllowedUpdates(PersistenceUpdatesTest.java:192)
at openllet.modularity.test.PersistenceUpdatesTest.performPersistenceAllowedUpdates(PersistenceUpdatesTest.java:73)
at openllet.modularity.test.PersistenceUpdatesTest.miniTambisPersistenceAllowedUpdatesTest(PersistenceUpdatesTest.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
We have observed a bug when using Apache Jena Libs 4.2.0 together with Openllet-Jena 2.6.5, which seems to be resolved when downgrading Apache Jena to version 3.15.0.
Steps to reproduce:
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>our-jena-project</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.jena/apache-jena-libs -->
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>apache-jena-libs</artifactId>
<version>4.2.0</version>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.32</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.jena/jena-fuseki-main -->
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-fuseki-main</artifactId>
<version>4.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.galigator.openllet/openllet-jena -->
<dependency>
<groupId>com.github.galigator.openllet</groupId>
<artifactId>openllet-jena</artifactId>
<version>2.6.5</version>
</dependency>
</dependencies>
</project>
Test.java
import openllet.jena.PelletReasonerFactory; // this import seems to create the issue
import org.apache.jena.rdf.model.ModelFactory;
[...]
public class Test {
public static void main(String[] args) {
Model model = ModelFactory.createDefaultModel(); // the issue is raised as soon as we create a model, even if we do not use PelletReasonerFactory
}
The previous code raises the error java.lang.NoSuchFieldError: SHACLC
Indeed, inspecting the org.apache.jena.riot.Lang class fields, we can observe that the field SHACLC is missing when Openllet Jena 2.6.5 is installed, whereas it should be present as stated in the docs, which led us to conclude to a conflicting version issue.
try {
Class c = Class.forName("org.apache.jena.riot.Lang");
for (Field field : c.getDeclaredFields())
System.out.println(field.getName());
System.out.println("SHACLC is NOT defined");
} catch (ClassNotFoundException e) {
System.out.println(e.toString());
System.exit(0);
}
We hope that this helps people who encountered a similar issue and would welcome any feedback.
Also, is there any plan to upgrade Openllet-Jena to be compatible with Jena Libs 4+?
Thank you for this great library!
java.io.FileNotFoundException: testFileParser.txt (No such file or directory)
Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.716 sec - in openllet.aterm.test.Test1
With version 2.6.4 and OpenJDK 11 I cannot create / run the reasoner due to java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
.
I saw that you developed support for recent Java versions back in March and have been using a locally build SNAPSHOT version happily since for my development.
I think it is time to create version 2.6.5 so that there is a published version that can be used with Java 11. Or is there any blocker / regression where you might need assistance?
In particular, I want to avoid having a SNAPSHOT dependency in own application, esp. since I'm in the process of finishing up a major release of it and other developers are about to join its development.
I'm trying to use Openllet in a Java EE application running in Wildfly/Thorntail. This is currently not possible because Openllet calls java.util.logging.Logger#setParent(Logger)
which is not allowed by Wildfly:
Caused by: java.lang.SecurityException: setParent() disallowed at org.jboss.logmanager.Logger.setParent(Logger.java:359) at openllet.core.boxes.tbox.impl.TgBox.(TgBox.java:60) ... 82 more
I would it remove myself, but I looks like that Openllet does some more things with its logging, therefore I'm not sure about potential side effects...
Hey,
I'm having a query which works quite fine in Protege but causes a Nullpointer Exception in Openllet.
Its structure looks as following:
{?x rdfs:subClassOf [owl:intersectionOf [rdf:rest*/rdf:first [rdf:type owl:Restriction ; owl:onProperty :hasProp; owl:someValuesFrom ?result]]].}
I can say for sure that the wildcard symbol * causes this Exception, because it doesn't crash without it.
This is the stacktrace:
Exception in thread "main" java.lang.NullPointerException
at openllet.core.utils.ATermUtils.isVar(ATermUtils.java:1157)
at openllet.query.sparqldl.model.QueryAtomImpl.<init>(QueryAtomImpl.java:59)
at openllet.query.sparqldl.model.QueryAtomImpl.<init>(QueryAtomImpl.java:45)
at openllet.query.sparqldl.model.QueryAtomFactory.TypeAtom(QueryAtomFactory.java:34)
at openllet.query.sparqldl.parser.ARQParser.parse(ARQParser.java:525)
at openllet.query.sparqldl.parser.ARQParser.parse(ARQParser.java:215)
at openllet.query.sparqldl.jena.SparqlDLStage.parsePattern(SparqlDLStage.java:115)
at openllet.query.sparqldl.jena.SparqlDLStage.build(SparqlDLStage.java:103)
at openllet.query.sparqldl.jena.SparqlDLStageGenerator.execute(SparqlDLStageGenerator.java:49)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:128)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:58)
at org.apache.jena.sparql.algebra.op.OpBGP.visit(OpBGP.java:49)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:117)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:228)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:130)
at org.apache.jena.sparql.algebra.op.OpSequence.visit(OpSequence.java:75)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:117)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:228)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:130)
at org.apache.jena.sparql.algebra.op.OpSequence.visit(OpSequence.java:75)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:117)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:389)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:267)
at org.apache.jena.sparql.algebra.op.OpProject.visit(OpProject.java:47)
at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:117)
at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:88)
at org.apache.jena.sparql.engine.main.QC.execute(QC.java:52)
at org.apache.jena.sparql.engine.main.QueryEngineMain.eval(QueryEngineMain.java:55)
at org.apache.jena.sparql.engine.QueryEngineBase.evaluate(QueryEngineBase.java:136)
at org.apache.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:106)
at org.apache.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:87)
at org.apache.jena.sparql.engine.main.QueryEngineMain$QueryEngineMainFactory.create(QueryEngineMain.java:90)
at org.apache.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:524)
at org.apache.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:472)
at org.apache.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:511)
at org.apache.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:172)
Is this a known behaviour? Otherwise I'll try to provide a small example these days.
I have used Protege to reason out implicit facts in my ontology. Now, I want to achieve it by simply writing a java code. I loaded the dependencies necessary to run the Openllet reasoner. But, after instantiating a class object, I am presented with the following error:
Exception in thread "main" java.lang.NoSuchMethodError: org.semanticweb.owlapi.model.OWLOntology.importsClosure()Ljava/util/stream/Stream;
at openllet.owlapi.PelletReasoner.refresh(PelletReasoner.java:1167)
at openllet.owlapi.PelletReasoner.(PelletReasoner.java:397)
at openllet.owlapi.PelletReasoner.(PelletReasoner.java:364)
at openllet.owlapi.OpenlletReasonerFactory.createReasoner(OpenlletReasonerFactory.java:62)
at com.IITM.SimpleOnto.(SimpleOnto.java:93)
at CSV2Ontology.main(CSV2Ontology.java:18)
Could you please help me on this issue?
Serious investigation need, to see if this log must be shutdown or a correction must be done.
2017-03-21 23:19:59 SEVERE openllet.test.query.ManifestEngine doEvaluationTest Ignoring triple with unknown property from OWL namespace: http://www.w3.org/2001/sw/WebOnt/guide-src/food#Moderate @owl:sameIndividualAs http://www.w3.org/2001/sw/WebOnt/guide-src/wine#Moderate
openllet.core.exceptions.UnsupportedFeatureException: Ignoring triple with unknown property from OWL namespace: http://www.w3.org/2001/sw/WebOnt/guide-src/food#Moderate @owl:sameIndividualAs http://www.w3.org/2001/sw/WebOnt/guide-src/wine#Moderate
at openllet.jena.graph.loader.DefaultGraphLoader.addUnsupportedFeature(DefaultGraphLoader.java:224)
at openllet.jena.graph.loader.DefaultGraphLoader.processTriple(DefaultGraphLoader.java:1545)
at openllet.jena.graph.loader.DefaultGraphLoader.processTriples(DefaultGraphLoader.java:1461)
at openllet.jena.graph.loader.DefaultGraphLoader.processTriples(DefaultGraphLoader.java:1444)
at openllet.jena.graph.loader.DefaultGraphLoader.load(DefaultGraphLoader.java:2076)
at openllet.jena.PelletInfGraph.load(PelletInfGraph.java:239)
at openllet.jena.PelletInfGraph.load(PelletInfGraph.java:209)
at openllet.jena.PelletInfGraph.prepare(PelletInfGraph.java:262)
at openllet.jena.PelletInfGraph.prepare(PelletInfGraph.java:251)
at org.apache.jena.ontology.impl.OntModelImpl.prepare(OntModelImpl.java:2690)
at openllet.test.query.PelletSparqlDawgTester.createDataset(PelletSparqlDawgTester.java:130)
at openllet.test.query.PelletSparqlDawgTester.createQueryExecution(PelletSparqlDawgTester.java:152)
at openllet.test.query.ARQSparqlDawgTester.isCorrectlyEvaluated(ARQSparqlDawgTester.java:171)
at openllet.test.query.ManifestEngine.doEvaluationTest(ManifestEngine.java:387)
at openllet.test.query.ManifestEngine.doTestCase(ManifestEngine.java:423)
at openllet.test.query.ManifestEngine.doSingleTest(ManifestEngine.java:287)
at openllet.test.query.SparqlDawgTestCase.runTest(SparqlDawgTestCase.java:59)
at openllet.test.query.SparqlDawgTestSuite.run(SparqlDawgTestSuite.java:152)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Hey.
I get a NoSuchElementException
while reasoning. It appeared after I changed the datatype of a property from xsd:decimal
to xsd:float
. It could be, that I made something wrong. Either way, I don't think that the reasoner should throw this exception and at least use a try{...}catch(Exception e){...}
construct.
Best regards,
Christian
Classifying: 20% complete in 00:01Exception in thread "main" java.util.NoSuchElementException
at openllet.core.datatypes.EmptyIterator.next(EmptyIterator.java:35)
at openllet.core.boxes.abox.Literal.checkClash(Literal.java:403)
at openllet.core.boxes.abox.Literal.addType(Literal.java:284)
at openllet.core.tableau.completion.CompletionStrategy.addType(CompletionStrategy.java:420)
at openllet.core.rules.ContinuousRulesStrategy.addType(ContinuousRulesStrategy.java:96)
at openllet.core.tableau.completion.rule.AllValuesRule.applyAllValues(AllValuesRule.java:181)
at openllet.core.tableau.completion.rule.AllValuesRule.applyAllValues(AllValuesRule.java:118)
at openllet.core.tableau.completion.CompletionStrategy.addType(CompletionStrategy.java:452)
at openllet.core.rules.ContinuousRulesStrategy.addType(ContinuousRulesStrategy.java:96)
at openllet.core.tableau.branch.DisjunctionBranch.tryBranch(DisjunctionBranch.java:215)
at openllet.core.tableau.branch.Branch.tryNext(Branch.java:130)
at openllet.core.tableau.completion.rule.DisjunctionRule.applyDisjunctionRule(DisjunctionRule.java:101)
at openllet.core.tableau.completion.rule.DisjunctionRule.apply(DisjunctionRule.java:58)
at openllet.core.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:106)
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:251)
at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417)
at openllet.core.utils.Timers.execute(Timers.java:118)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1417)
at openllet.core.boxes.abox.ABoxImpl.isSatisfiable(ABoxImpl.java:621)
at openllet.core.boxes.abox.ABoxImpl.isSubClassOf(ABoxImpl.java:566)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.subsumes(CDOptimizedTaxonomyBuilder.java:1163)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.subCheckWithCache(CDOptimizedTaxonomyBuilder.java:1121)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.nodeSubsumes(CDOptimizedTaxonomyBuilder.java:1130)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.search(CDOptimizedTaxonomyBuilder.java:1045)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.doTopSearch(CDOptimizedTaxonomyBuilder.java:964)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:830)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:266)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:212)
at openllet.core.KnowledgeBaseImpl.classify(KnowledgeBaseImpl.java:1919)
at openllet.core.KnowledgeBaseImpl.realize(KnowledgeBaseImpl.java:1938)
at openllet.core.knowledge.InstancesBase.getTypes(InstancesBase.java:366)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:356)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:304)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:249)
at openllet.query.sparqldl.engine.QueryEngine.execSingleQuery(QueryEngine.java:313)
at openllet.query.sparqldl.engine.QueryEngine.exec(QueryEngine.java:124)
at openllet.query.sparqldl.jena.SparqlDLExecution.exec(SparqlDLExecution.java:240)
at openllet.query.sparqldl.jena.SparqlDLExecution.execSelect(SparqlDLExecution.java:203)
....
I want to build openllet from source so I did the following:
mvn -e package
This is what I get:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] The project com.github.galigator.openllet:openllet-parent:pom:2.6.6-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Openllet :: Parent POM [pom]
[INFO] Openllet :: Abstracts functions [jar]
[INFO] Openllet :: Core [jar]
[INFO] Openllet :: Query [jar]
[INFO] Openllet :: OWL API [jar]
[INFO] Openllet :: Jena [jar]
[INFO] Openllet :: Explanation [jar]
[INFO] Openllet :: Modularity [jar]
[INFO] Openllet :: Pellint [jar]
[INFO] Openllet :: CLI [jar]
[INFO] Openllet :: Profiler [jar]
[INFO] Openllet :: Examples [jar]
[INFO] Openllet :: Tests [jar]
[INFO] Openllet :: Protege [bundle]
[INFO] Openllet :: Distribution [bundle]
[INFO]
[INFO] -----------< com.github.galigator.openllet:openllet-parent >------------
[INFO] Building Openllet :: Parent POM 2.6.6-SNAPSHOT [1/15]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce) @ openllet-parent ---
[INFO]
[INFO] ----------< com.github.galigator.openllet:openllet-functions >----------
[INFO] Building Openllet :: Abstracts functions 2.6.6-SNAPSHOT [2/15]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce) @ openllet-functions ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ openllet-functions ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /media/workcard/workstickdir/projekte/external_repos/openllet/module-shared/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ openllet-functions ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 97 source files to /media/workcard/workstickdir/projekte/external_repos/openllet/module-shared/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Openllet :: Parent POM 2.6.6-SNAPSHOT:
[INFO]
[INFO] Openllet :: Parent POM ............................. SUCCESS [ 0.479 s]
[INFO] Openllet :: Abstracts functions .................... FAILURE [ 0.986 s]
[INFO] Openllet :: Core ................................... SKIPPED
[INFO] Openllet :: Query .................................. SKIPPED
[INFO] Openllet :: OWL API ................................ SKIPPED
[INFO] Openllet :: Jena ................................... SKIPPED
[INFO] Openllet :: Explanation ............................ SKIPPED
[INFO] Openllet :: Modularity ............................. SKIPPED
[INFO] Openllet :: Pellint ................................ SKIPPED
[INFO] Openllet :: CLI .................................... SKIPPED
[INFO] Openllet :: Profiler ............................... SKIPPED
[INFO] Openllet :: Examples ............................... SKIPPED
[INFO] Openllet :: Tests .................................. SKIPPED
[INFO] Openllet :: Protege ................................ SKIPPED
[INFO] Openllet :: Distribution ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.035 s
[INFO] Finished at: 2020-12-20T12:54:00+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project openllet-functions: Fatal error compiling: error: invalid target release: 14 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project openllet-functions: Fatal error compiling
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1145)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.codehaus.plexus.compiler.CompilerException: error: invalid target release: 14
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:173)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1134)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: error: invalid target release: 14
at com.sun.tools.javac.main.Arguments.error (Arguments.java:907)
at com.sun.tools.javac.main.Arguments.doProcessArgs (Arguments.java:383)
at com.sun.tools.javac.main.Arguments.processArgs (Arguments.java:347)
at com.sun.tools.javac.main.Arguments.init (Arguments.java:246)
at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:185)
at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:119)
at com.sun.tools.javac.api.JavacTool.getTask (JavacTool.java:68)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:125)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1134)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Hi all,
I'm raising a new issue around a StackOverflowError of openllet. I'm using the same set-up of Apache Jena Fuseki and the openllet reasoner as @barrynl describes in #21.
I've build a small ontology with Protege and defined a SWRL rule on top of it. This rule also uses SWRL Build-In functions to subtract and compare values. The SWRL rule used is:
wapa:ActualStock(?s1) ^ wapa:hasQuantityValue(?s1, ?q1) ^ wapa:hasStockYearMonth(?s1, ?date1) ^ swrlb:date(?date1, ?y, ?m1, ?d1, ?t1) ^ wapa:isStockOf(?s1, ?v) ^ wapa:isInStockAt(?s1, ?co) ^
wapa:ActualStock(?s2) ^ wapa:hasQuantityValue(?s2, ?q2) ^ wapa:hasStockYearMonth(?s2, ?date2) ^ swrlb:date(?date2, ?y, ?m2, ?d2, ?t2) ^ wapa:isStockOf(?s2, ?v) ^ wapa:isInStockAt(?s2, ?co) ^
swrlb:subtract(1, ?m1, ?m2) ^ swrlb:subtract(?moved, ?q2, ?q1) ^
wapa:MovedStock(?c) ^ wapa:isStockOf(?c, ?v) ^ wapa:isInStockAt(?c, ?co)
->
wapa:hasQuantityValue(?c, ?moved)
Please find below also the first part of the error message. As you can see there is a loop in the message that continues until the stack is full. I cannot retrieve where the reasoner gets stuck into a loop and how the SWRL rule is causing this.
Hopefully someone can help?
Thanks in advance, Jack
java.lang.StackOverflowError
at openllet.core.datatypes.types.floating.FloatingPointInterval.valid(FloatingPointInterval.java:166)
at openllet.core.datatypes.DiscreteInterval.contains(DiscreteInterval.java:171)
at openllet.core.datatypes.types.floating.FloatingPointInterval.contains(FloatingPointInterval.java:94)
at openllet.core.datatypes.types.floating.RestrictedFloatingPointDatatype.contains(RestrictedFloatingPointDatatype.java:195)
at openllet.core.datatypes.DatatypeReasonerImpl.containedIn(DatatypeReasonerImpl.java:307)
at openllet.core.datatypes.DatatypeReasonerImpl.isSatisfiable(DatatypeReasonerImpl.java:717)
at openllet.core.datatypes.DatatypeReasonerImpl.isSatisfiable(DatatypeReasonerImpl.java:679)
at openllet.core.boxes.abox.Literal.checkClash(Literal.java:369)
at openllet.core.boxes.abox.Literal.addType(Literal.java:286)
at openllet.core.tableau.completion.CompletionStrategy.addType(CompletionStrategy.java:419)
at openllet.core.rules.ContinuousRulesStrategy.addType(ContinuousRulesStrategy.java:93)
at openllet.core.tableau.completion.CompletionStrategy.applyDomainRange(CompletionStrategy.java:616)
at openllet.core.tableau.completion.CompletionStrategy.applyPropertyRestrictions(CompletionStrategy.java:579)
at openllet.core.tableau.completion.CompletionStrategy.addEdge(CompletionStrategy.java:566)
at openllet.core.rules.ContinuousRulesStrategy.addEdge(ContinuousRulesStrategy.java:81)
at openllet.core.rules.rete.ProductionNode$Edge.activate(ProductionNode.java:159)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaBuiltinNode.activate(BetaBuiltinNode.java:46)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaBuiltinNode.activate(BetaBuiltinNode.java:46)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaBuiltinNode.activate(BetaBuiltinNode.java:46)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:58)
at openllet.core.rules.rete.AlphaNode.lambda$activate$1(AlphaNode.java:52)
at java.util.Vector.forEach(Vector.java:1249)
at openllet.core.rules.rete.AlphaNode.activate(AlphaNode.java:52)
at openllet.core.rules.rete.AlphaEdgeNode.activate(AlphaEdgeNode.java:76)
at openllet.core.rules.rete.AlphaNetwork.activateEdge(AlphaNetwork.java:169)
at openllet.core.rules.ContinuousRulesStrategy.addEdge(ContinuousRulesStrategy.java:85)
at openllet.core.rules.rete.ProductionNode$Edge.activate(ProductionNode.java:159)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaBuiltinNode.activate(BetaBuiltinNode.java:46)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaBuiltinNode.activate(BetaBuiltinNode.java:46)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaBuiltinNode.activate(BetaBuiltinNode.java:46)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:27)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:58)
at openllet.core.rules.rete.AlphaNode.lambda$activate$1(AlphaNode.java:52)
at java.util.Vector.forEach(Vector.java:1249)
I have a problem concerning the inconsistency check for ontologies using imports.
I provide 2 minimal working examples.
In one case (inconsistency_wo_import), an inconsistent ontology is provided. Openllet detects that and also produces explanations.
But, in case I split this ontology in one providing the classes and object property assertions (inc2) and a second one which imports the first one and defines the individuals and relations (inc2u), Openllet says the ontology is consistent.
inconsistency_wo_import.owl.txt
inc2.owl.txt
inc2u.owl.txt
Hi, I wanna know if there is a list of Built-In for SWRL that aren't supported by Openllet.
It is "only" a warning but the rule is quite important in my Ontology !
2017-10-31 18:12:06 WARNING openllet.core.KnowledgeBaseImpl consistency Ignoring rule Rule(bnode(-7972c0ca:15f736b33a9:-7fb1) [hasPreviousItem(?x,?y), hasInput(?x,?a), hasOutput(?y,?b), differentFrom([?a, ?b])] => [hasError(?x,"Error : The I/O Data are not valid."^^string)]): No builtin for http://www.w3.org/2002/07/owl#differentFrom
The rule is enabled in Protégé using Pellet.
Thank you in advance !
Hi all,
Thanks for your efforts in keeping an up-to-date version of Pellet available!
I'm using Openllet to get a Protege-like inference experience within Apache Jena Fuseki, but I experience some problems after the repository in which inference is enabled is modified. After I remove (SPARQL: DELETE) the triples from which new triples are derived, the derived triples remain in the repository (i.e. they come up in SPARQL queries). I'm not sure yet, whether adding (SPARQL: CONSTRUCT) triples also gives problems.
Does anyone recognize this behaviour? Is this a bug, or is it a feature? For example, are the inferred triples 'converted' to real triples (after which there is no distinction between them)? I would say the ideal situation would be the distinction between stated and derived triples remains and after each modification the inference engine should update the inferred triples (like Sychronize in Protege).
Hope someone can help!
Regards, Barry
Hello.
My ontology has about twenty equivalent classes with datatype ranges, for instance:
(concreteDrug some Clozapin)
and (dose some xsd:integer[>= 100 , <= 250])
(I'm using the Protege syntax)
The Openllet reasoner throws me an InternalReasonerException like this:
Exception in thread "main" openllet.core.exceptions.InternalReasonerException: Backtrack: Trying to backtrack to _branch 1978 but has only 1970 branches. Clash found: [Clash "anon(25149)" EMPTY_DATATYPE DS{branch:NO_BRANCH(-1), depends:[0, 1969, 1978]} [FunNot(FunRestrictedDatatype(http://www.w3.org/2001/XMLSchema#integer,[FunFacet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(1,(),http://www.w3.org/2001/XMLSchema#integer)),FunFacet(http://www.w3.org/2001/XMLSchema#maxInclusive,literal(4,(),http://www.w3.org/2001/XMLSchema#integer))])), FunNot(FunRestrictedDatatype(http://www.w3.org/2001/XMLSchema#integer,[FunFacet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(2,(),http://www.w3.org/2001/XMLSchema#integer)),FunFacet(http://www.w3.org/2001/XMLSchema#maxInclusive,literal(10,(),http://www.w3.org/2001/XMLSchema#integer))])), FunNot(http://www.w3.org/2001/XMLSchema#integer), FunRestrictedDatatype(http://www.w3.org/2001/XMLSchema#integer,[FunFacet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(60,(),http://www.w3.org/2001/XMLSchema#integer)),FunFacet(http://www.w3.org/2001/XMLSchema#maxInclusive,literal(61,(),http://www.w3.org/2001/XMLSchema#integer))]), http://www.w3.org/2001/XMLSchema#integer]]
at openllet.core.tableau.completion.SROIQStrategy.backtrack(SROIQStrategy.java:53)
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:276)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1423)
at openllet.core.boxes.abox.ABoxImpl.isSatisfiable(ABoxImpl.java:622)
at openllet.core.boxes.abox.ABoxImpl.isSubClassOf(ABoxImpl.java:567)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.subsumes(CDOptimizedTaxonomyBuilder.java:1169)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.subCheckWithCache(CDOptimizedTaxonomyBuilder.java:1127)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.nodeSubsumes(CDOptimizedTaxonomyBuilder.java:1136)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.search(CDOptimizedTaxonomyBuilder.java:1051)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.doTopSearch(CDOptimizedTaxonomyBuilder.java:970)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:834)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:270)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:216)
at openllet.core.KnowledgeBaseImpl.classify(KnowledgeBaseImpl.java:2360)
at openllet.core.KnowledgeBaseImpl.realize(KnowledgeBaseImpl.java:2379)
at openllet.core.KnowledgeBaseImpl.getTypes(KnowledgeBaseImpl.java:3728)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:360)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:307)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:250)
at openllet.query.sparqldl.engine.QueryEngine.execSingleQuery(QueryEngine.java:330)
at openllet.query.sparqldl.engine.QueryEngine.exec(QueryEngine.java:127)
at openllet.query.sparqldl.jena.SparqlDLExecution.exec(SparqlDLExecution.java:241)
at openllet.query.sparqldl.jena.SparqlDLExecution.execSelect(SparqlDLExecution.java:204)
My current Openllet version is 2.6.2. The newer version 2.6.3 fails as well, as does the pellet reasoner version 4.5 used by protege.
The exact error message differs with each run because it is caused at another place it seems.
For instance:
Exception in thread "main" openllet.core.exceptions.InternalReasonerException: Backtrack: Trying to backtrack to _branch 1211 but has only 1192 branches. Clash found: [Clash _C_ ATOMIC DS{branch:NO_BRANCH(-1), depends:[0, 1181, 1182, 1183, 1188, 1194, 1198, 1199, 1201, 1202, 1207, 12
11]}]
at openllet.core.tableau.completion.SROIQStrategy.backtrack(SROIQStrategy.java:53)
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:276)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1423)
at openllet.core.boxes.abox.ABoxImpl.isSatisfiable(ABoxImpl.java:622)
at openllet.core.boxes.abox.ABoxImpl.isSubClassOf(ABoxImpl.java:567)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.subsumes(CDOptimizedTaxonomyBuilder.java:1169)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.subCheckWithCache(CDOptimizedTaxonomyBuilder.java:1127)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.nodeSubsumes(CDOptimizedTaxonomyBuilder.java:1136)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.search(CDOptimizedTaxonomyBuilder.java:1051)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.doTopSearch(CDOptimizedTaxonomyBuilder.java:970)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:834)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:270)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:216)
at openllet.core.KnowledgeBaseImpl.classify(KnowledgeBaseImpl.java:2360)
at openllet.core.KnowledgeBaseImpl.realize(KnowledgeBaseImpl.java:2379)
at openllet.core.KnowledgeBaseImpl.getTypes(KnowledgeBaseImpl.java:3728)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:360)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:307)
at openllet.query.sparqldl.engine.CombinedQueryEngine.exec(CombinedQueryEngine.java:250)
at openllet.query.sparqldl.engine.QueryEngine.execSingleQuery(QueryEngine.java:330)
at openllet.query.sparqldl.engine.QueryEngine.exec(QueryEngine.java:127)
at openllet.query.sparqldl.jena.SparqlDLExecution.exec(SparqlDLExecution.java:241)
at openllet.query.sparqldl.jena.SparqlDLExecution.execSelect(SparqlDLExecution.java:204)
Yesterday the reasoner was able to successfully finish the reasoning and did then fail again without any changes made in the ontology.
Futhermore I can assure, that these datatype ranges are causing this exception. After removing them, the reasoner works without any issues.
Best regards,
Christian
Hi, I get another InternalReasonerException, that happens when I call isConsistent
after adding any axiom. I'm using owlapi 5.1.5 and openllet-owlapi 2.6.5-SNAPSHOT / 9c5928a.
Relevant code:
reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
reasoner.instances(CLASS_PROCESSMODEL).forEach(p -> {
manager.addAxiom(ont, factory.getOWLDataPropertyAssertionAxiom(DATA_PROPERTY_HASMODELCOMPONENTID, p, "AddingEdgeTest"));
});
reasoner.flush();
if (!reasoner.isConsistent()) { // throws InternalReasonerException
throw new InternalError("inconsistent after adding a ModelID!");
}
Stacktrace:
openllet.core.exceptions.InternalReasonerException: Adding edge to a pruned _node anon(1) hasSourceState state89971606167054
at openllet.core.boxes.abox.Individual.addEdge(Individual.java:1080)
at openllet.core.tableau.completion.CompletionStrategy.addEdge(CompletionStrategy.java:516)
at openllet.core.rules.ContinuousRulesStrategy.addEdge(ContinuousRulesStrategy.java:84)
at openllet.core.rules.rete.ProductionNode$Edge.activate(ProductionNode.java:158)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaTopNode.activate(BetaTopNode.java:33)
at openllet.core.rules.rete.AlphaNode.lambda$activate$1(AlphaNode.java:49)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at openllet.core.rules.rete.AlphaNode.activate(AlphaNode.java:49)
at openllet.core.rules.rete.AlphaTypeNode.activate(AlphaTypeNode.java:60)
at openllet.core.rules.rete.AlphaNetwork.activateType(AlphaNetwork.java:150)
at openllet.core.rules.rete.AlphaNetwork.activateIndividual(AlphaNetwork.java:133)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at openllet.core.rules.rete.AlphaNetwork.activateAll(AlphaNetwork.java:119)
at openllet.core.rules.rete.Interpreter.run(Interpreter.java:60)
at openllet.core.rules.ContinuousRulesStrategy.applyRete(ContinuousRulesStrategy.java:145)
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:224)
at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417)
at openllet.core.utils.Timers.execute(Timers.java:118)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1417)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1269)
at openllet.core.KnowledgeBaseImpl.consistency(KnowledgeBaseImpl.java:1802)
at openllet.core.KnowledgeBaseImpl.isConsistent(KnowledgeBaseImpl.java:1877)
at openllet.core.KnowledgeBaseImplFullSync.isConsistent(KnowledgeBaseImplFullSync.java:403)
at openllet.owlapi.PelletReasoner.isConsistent(PelletReasoner.java:1032)
at de.athalis.owl.PrunedNode.printProcesses(PrunedNode.java:75)
at de.athalis.owl.PrunedNode.main(PrunedNode.java:29)
This happens with both the default reasoner and also with the buffering one. I generated seven minimal ontologies with a modified SearchMinimalBug: it calls addAxiom and tests specifically for this InternalReasonerException, and also doesn't perform the anonymization to keep the ontologies understandable / comparable. I uploaded the files along the Java code here: https://github.com/Locke/pruned_node
I am integrating openllet with jena and fuseki server and I have rules written in swrl. all the rule that is using the eval function is being ignored. is there anything I am missing. or another way to do calculations in swrl rules.
It' working fine in protege.
WARNING openllet.core.KnowledgeBaseImpl consistency Ignoring rule Rule(bnode(835f98b4-2720-4651-a0c8-ddde37746067) [HealthProfile(?hp), Hight(?hp,?h), Weight(?hp,?w), eval([?bmi, "w / ( h * h ) "^^string, ?w, ?h])] => [BMI(?hp,?bmi)]): No builtin for http://swrl.stanford.edu/ontologies/built-ins/3.4/swrlm.owl#eval
Dear all,
I try to get Openllet reasoner in my OWLAPI5 application. When I run it, it produces this Class Version Error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: openllet/owlapi/OpenlletReasonerFactory has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at OpenlletTest.main(OpenlletTest.java:25)
Someone knows how can I fix it? My java version is 8.
Thanks, Rita
In order to create a release using the owlapi5, I have disable some modularity tests.
There is a problem in the comparisons between axioms.
Not sure if able to fix because I am short of time.
Hi
I write a program to run DL queries similar to the example given in https://github.com/phillord/owl-api/blob/master/contract/src/test/java/org/coode/owlapi/examples/DLQueryExample.java to run
However, DL queries that contain chain properties did not work well when using Openllet reasoner.
I run the DL query: "Pest and affects value Brinjal" where Pest is a class, affects is a chain property and Brinjal is an individual of Crop class.
The query is successfully run when using the Hermit reasoner with the java code. Also, I run the same query using Protege with Pellet 2.2.0 reasoner. It also worked.
However, when I run the same query with Openllet reasoner, it returns answers none.
I much prefer to use Openllet as it gives the answers in less time than HermiT
When using a threaded environment, you can sometime experiment the following problem:
openllet.atom.OpenError: Invalid _branch created: -1 != 1
openllet.core.tableau.completion.CompletionStrategy.addBranch(CompletionStrategy.java:1178)
openllet.core.tableau.completion.rule.DisjunctionRule.applyDisjunctionRule(DisjunctionRule.java:105)
openllet.core.tableau.completion.rule.DisjunctionRule.apply(DisjunctionRule.java:64)
openllet.core.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:75)
openllet.core.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:150)
openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1427)
openllet.core.boxes.abox.ABoxImpl.isType(ABoxImpl.java:895)
openllet.core.KnowledgeBaseImpl.partitionInstanceRetrieval(KnowledgeBaseImpl.java:4807)
openllet.core.KnowledgeBaseImpl.binaryInstanceRetrieval(KnowledgeBaseImpl.java:4796)
openllet.core.KnowledgeBaseImpl.retrieve(KnowledgeBaseImpl.java:4700)
openllet.core.KnowledgeBaseImpl.getInstances(KnowledgeBaseImpl.java:3859)
openllet.core.KnowledgeBaseImpl.getInstances(KnowledgeBaseImpl.java:3887)
openllet.owlapi.PelletReasoner.getInstances(PelletReasoner.java:665)
org.semanticweb.owlapi.reasoner.OWLReasoner.getInstances(OWLReasoner.java:1841)
The is due to the branching system that use an index to differentiate multiple kind of branches.
In multi-threading environment, this strategy is broken.
Hello, I am interested in using open pellet with Jena fuseki to setup a SPAQL server. However I am lost on how to this. I was not able to find any documentation or guides.
Is there a docket environment that is already setup? How can I accomplish this?
Thank you.
The tableau algorithm make liitle (if not) usage of interface, that make it harder to maintain.
Also this could lead to the resolution of various crash/concurrency issues.
When copying the openllet-protege-2.6.2-SNAPSHOT.jar or an earlier version to the Protege plugin directory Protege reports an error:
Error starting file:/home/jensp/protege/plugins/openllet-protege-2.6.2-SNAPSHOT.jar
org.osgi.framework.BundleException: Unresolved constraint in bundle openllet-protege [45]: Unable to resolve 45.0: missing requirement [45.0] osgi.wiring.bundle; (&(osgi.wiring.bundle=org.semanticweb.owl.owlapi)(bundle-version>=5.1.0))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002) ~[org.apache.felix.main.jar:na]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2045) ~[org.apache.felix.main.jar:na]
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299) ~[org.apache.felix.main.jar:na]
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) [org.apache.felix.main.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
I suspect the reason for this is that Protege still uses the OWLAPI version 4, but Openllet and its Protege plugin already use version 5 of the OWLAPI.
If I'm correct I would suggest to put at least some warning into the readme.
Thanks, Jens
Given the code in https://github.com/Locke/pruned_node and the ontology npe.owl
from that project I get a NullPointerException with this stacktrace:
java.lang.NullPointerException
at openllet.core.rules.rete.JoinCondition.test(JoinCondition.java:29)
at openllet.core.rules.rete.BetaMemoryNode.testConditions(BetaMemoryNode.java:83)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:73)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaMemoryNode.activate(BetaMemoryNode.java:74)
at openllet.core.rules.rete.BetaNode.activateChildren(BetaNode.java:28)
at openllet.core.rules.rete.BetaTopNode.activate(BetaTopNode.java:33)
at openllet.core.rules.rete.AlphaNode.lambda$activate$1(AlphaNode.java:49)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at openllet.core.rules.rete.AlphaNode.activate(AlphaNode.java:49)
at openllet.core.rules.rete.AlphaTypeNode.activate(AlphaTypeNode.java:60)
at openllet.core.rules.rete.AlphaNetwork.activateType(AlphaNetwork.java:150)
at openllet.core.rules.rete.AlphaNetwork.activateIndividual(AlphaNetwork.java:133)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at openllet.core.rules.rete.AlphaNetwork.activateAll(AlphaNetwork.java:119)
at openllet.core.rules.rete.Interpreter.run(Interpreter.java:60)
at openllet.core.rules.ContinuousRulesStrategy.applyRete(ContinuousRulesStrategy.java:145)
at openllet.core.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:224)
at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417)
at openllet.core.utils.Timers.execute(Timers.java:118)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1417)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1269)
at openllet.core.KnowledgeBaseImpl.consistency(KnowledgeBaseImpl.java:1802)
at openllet.core.KnowledgeBaseImpl.isConsistent(KnowledgeBaseImpl.java:1877)
at openllet.core.KnowledgeBaseImplFullSync.isConsistent(KnowledgeBaseImplFullSync.java:403)
at openllet.owlapi.PelletReasoner.isConsistent(PelletReasoner.java:1032)
at de.athalis.owl.PrunedNode.printProcesses(PrunedNode.java:77)
at de.athalis.owl.PrunedNode.main(PrunedNode.java:31)
Simply changing the corresponding line from return _wmeProvider.getNode(wme, token).getTerm().equals(_tokenProvider.getNode(wme, token).getTerm());
to return java.util.Objects.equals(_wmeProvider.getNode(wme, token).getTerm(), _tokenProvider.getNode(wme, token).getTerm());
seems like an easy fix. I applied that change locally and didn't discover any drawbacks yet.
However I can't tell whether that is just fixing a symptom that is causing my other issues (in particular #38 as that happens in the same region). It might be that it is unexpected to have an anonymous literal with no value at this place?..
Note that this is independent of whether I set OpenlletOptions.TRACK_BRANCH_EFFECTS = true;
or not.
While debugging an inconsistency I stumbled upon an unrelated InternalReasonerException in an ontology which was generated by SearchMinimalBug.
Although that Exception doesn't occur in my real application / ontology I thought it might be worth sharing with you, as it looks like an internal bug that you might want to take a look at. Feel free to just ignore / close this issue report, as it is an arbitrary ontology. I'm using version 2.6.5-SNAPSHOT / 9c5928a.
You can find the ontology here (I flavored the original minimal ontology a bit with a random example so that it is easier to understand): https://gist.github.com/Locke/3b6e316a9efb963fb8d1da82cf539757#file-singleredcarownerinternalreasonerexception-owl
In the ontology is a class Owner
. Its subclass SingleRedCarOwner
should be someone who has one car, and the color of the car must be red: hasCar exactly 1 (Car and (hasColour value Red))
.
When I call kb.realize();
on that ontology an InternalReasonerException
is thrown:
openllet.core.exceptions.InternalReasonerException: Nominal FunValue(http://de.athalis.owl.App.main()#Red) is not found in the KB!
at openllet.core.tableau.completion.rule.SomeValuesRule.applySomeValuesRule(SomeValuesRule.java:210)
at openllet.core.tableau.completion.rule.SomeValuesRule.apply(SomeValuesRule.java:60)
at openllet.core.tableau.completion.EmptySRIQStrategy.expand(EmptySRIQStrategy.java:300)
at openllet.core.tableau.completion.EmptySRIQStrategy.complete(EmptySRIQStrategy.java:156)
at openllet.core.boxes.abox.ABoxImpl.lambda$isConsistent$12(ABoxImpl.java:1417)
at openllet.core.utils.Timers.execute(Timers.java:118)
at openllet.core.boxes.abox.ABoxImpl.isConsistent(ABoxImpl.java:1417)
at openllet.core.boxes.abox.ABoxImpl.isSatisfiable(ABoxImpl.java:621)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.checkSatisfiability(CDOptimizedTaxonomyBuilder.java:757)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:804)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:266)
at openllet.core.taxonomy.CDOptimizedTaxonomyBuilder.classify(CDOptimizedTaxonomyBuilder.java:211)
at openllet.core.KnowledgeBaseImpl.classify(KnowledgeBaseImpl.java:1919)
at openllet.core.KnowledgeBaseImplFullSync.classify(KnowledgeBaseImplFullSync.java:385)
at openllet.core.KnowledgeBaseImpl.realize(KnowledgeBaseImpl.java:1938)
at openllet.core.KnowledgeBaseImplFullSync.realize(KnowledgeBaseImplFullSync.java:391)
As a workaround I added another definition: hasCar only (Car and (hasColour value Red))
, see https://gist.github.com/Locke/3b6e316a9efb963fb8d1da82cf539757#file-singleredcarowner-owl
With this additional definition present the InternalReasonerException isn't thrown. That seems to support my theory of an internal bug.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.