From: Ignazio P. <ipa...@gm...> - 2021-08-04 04:11:10
|
On Wed, 4 Aug 2021, 05:56 Shyama, <shy...@gm...> wrote: > Hi > > Please find the result of that code.......... > Thanks, that revealed the guilty jar: C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi- osgidistribution\4.1.3\owlapi-osgidistribution-4.1.3.jar I'm guessing this might be coming in via version 2.0.0 of the explanation library. Try version 5.0.0 instead. Maven should have spotted the conflict and resolved to the latest version, but there's a possibility that would not have worked either. Version 5 should solve the issue cleanly. Cheers, I. ---------------------------------------------------- > OWL API Versions....................... > C:\Users\HP\Documents\NetBeansProjects\TestOWLExplanation\target\classes;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-distribution\5.1.17\owlapi-distribution-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-compatibility\5.1.17\owlapi-compatibility-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-apibinding\5.1.17\owlapi-apibinding-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-api\5.1.17\owlapi-api-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-impl\5.1.17\owlapi-impl-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-parsers\5.1.17\owlapi-parsers-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-oboformat\5.1.17\owlapi-oboformat-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-tools\5.1.17\owlapi-tools-5.1.17.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-rio\5.1.17\owlapi-rio-5.1.17.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.10\jackson-core-2.9.10.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.10.5\jackson-databind-2.9.10.5.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.10\jackson-annotations-2.9.10.jar;C:\Users\HP\.m2\repository\org\apache\commons\commons-rdf-api\0.5.0\commons-rdf-api-0.5.0.jar;C:\Users\HP\.m2\repository\org\tukaani\xz\1.6\xz-1.6.jar;C:\Users\HP\.m2\repository\org\slf4j\slf4j-api\1.7.22\slf4j-api-1.7.22.jar;C:\Users\HP\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.22\jcl-over-slf4j-1.7.22.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-model\3.4.3\rdf4j-model-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-api\3.4.3\rdf4j-rio-api-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-languages\3.4.3\rdf4j-rio-languages-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-datatypes\3.4.3\rdf4j-rio-datatypes-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-binary\3.4.3\rdf4j-rio-binary-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-n3\3.4.3\rdf4j-rio-n3-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-nquads\3.4.3\rdf4j-rio-nquads-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-ntriples\3.4.3\rdf4j-rio-ntriples-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-rdfjson\3.4.3\rdf4j-rio-rdfjson-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-jsonld\3.4.3\rdf4j-rio-jsonld-3.4.3.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\httpclient\4.5.10\httpclient-4.5.10.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\httpclient-cache\4.5.10\httpclient-cache-4.5.10.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-rdfxml\3.4.3\rdf4j-rio-rdfxml-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-trix\3.4.3\rdf4j-rio-trix-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-turtle\3.4.3\rdf4j-rio-turtle-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-trig\3.4.3\rdf4j-rio-trig-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-rio-hdt\3.4.3\rdf4j-rio-hdt-3.4.3.jar;C:\Users\HP\.m2\repository\org\eclipse\rdf4j\rdf4j-util\3.4.3\rdf4j-util-3.4.3.jar;C:\Users\HP\.m2\repository\com\github\jsonld-java\jsonld-java\0.13.0\jsonld-java-0.13.0.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\httpclient-osgi\4.5.10\httpclient-osgi-4.5.10.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\httpmime\4.5.10\httpmime-4.5.10.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\fluent-hc\4.5.10\fluent-hc-4.5.10.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\httpcore-osgi\4.4.12\httpcore-osgi-4.4.12.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\httpcore-nio\4.4.12\httpcore-nio-4.SLF4J: > Failed to load class "org.slf4j.impl.StaticLoggerBinder". > SLF4J: Defaulting to no-operation (NOP) logger implementation > 4.12.jar;C:\Users\HP\.m2\repository\com\github\vsonnier\hppcrt\0.7.5\hppcrt-0.7.5.jar;C:\Users\HP\.m2\repository\com\github\ben-SLF4J: > See http://www.slf4j.org/codes.html#StaticLoggerBinder for further > details. > > manes\caffeine\caffeine\2.8.1\caffeine-2.8.1.jar;C:\Users\HP\.m2\repository\org\checkerframework\checker-qual\3.1.0\checker-qual-3.1.0.jar;C:\Users\HP\.m2\repository\com\google\errorprone\error_prone_annotations\2.3.4\error_prone_annotations-2.3.4.jar;C:\Users\HP\.m2\repository\com\google\guava\guava\30.0-jre\guava-30.0-jre.jar;C:\Users\HP\.m2\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;C:\Users\HP\.m2\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\Users\HP\.m2\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;C:\Users\HP\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\Users\HP\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\org.semanticweb.hermit\1.4.3.517\org.semanticweb.hermit-1.4.3.517.jar;C:\Users\HP\.m2\repository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;C:\Users\HP\.m2\repository\org\apache\ws\commons\axiom\axiom-api\1.2.14\axiom-api-1.2.14.jar;C:\Users\HP\.m2\repository\org\apache\geronimo\specs\geronimo-activation_1.1_spec\1.1\geronimo-activation_1.1_spec-1.1.jar;C:\Users\HP\.m2\repository\org\apache\geronimo\specs\geronimo-javamail_1.4_spec\1.7.1\geronimo-javamail_1.4_spec-1.7.1.jar;C:\Users\HP\.m2\repository\jaxen\jaxen\1.1.4\jaxen-1.1.4.jar;C:\Users\HP\.m2\repository\org\apache\geronimo\specs\geronimo-stax-api_1.0_spec\1.0.1\geronimo-stax-api_1.0_spec-1.0.1.jar;C:\Users\HP\.m2\repository\org\apache\james\apache-mime4j-core\0.7.2\apache-mime4j-core-0.7.2.jar;C:\Users\HP\.m2\repository\org\apache\ws\commons\axiom\axiom-c14n\1.2.14\axiom-c14n-1.2.14.jar;C:\Users\HP\.m2\repository\org\apache\ws\commons\axiom\axiom-impl\1.2.14\axiom-impl-1.2.14.jar;C:\Users\HP\.m2\repository\org\codehaus\woodstox\woodstox-core-asl\4.1.4\woodstox-core-asl-4.1.4.jar;C:\Users\HP\.m2\repository\org\codehaus\woodstox\stax2-api\3.1.1\stax2-api-3.1.1.jar;C:\Users\HP\.m2\repository\org\apache\ws\commons\axiom\axiom-dom\1.2.14\axiom-dom-1.2.14.jar;C:\Users\HP\.m2\repository\dk\brics\automaton\automaton\1.11-8\automaton-1.11-8.jar;C:\Users\HP\.m2\repository\gnu\getopt\java-getopt\1.0.13\java-getopt-1.0.13.jar;C:\Users\HP\.m2\repository\net\sf\trove4j\trove4j\3.0.3\trove4j-3.0.3.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlexplanation\2.0.0\owlexplanation-2.0.0.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\owlapi-osgidistribution\4.1.3\owlapi-osgidistribution-4.1.3.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-model\2.7.12\sesame-model-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-api\2.7.12\sesame-rio-api-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-languages\2.7.12\sesame-rio-languages-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-datatypes\2.7.12\sesame-rio-datatypes-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-binary\2.7.12\sesame-rio-binary-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-n3\2.7.12\sesame-rio-n3-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-nquads\2.7.12\sesame-rio-nquads-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-ntriples\2.7.12\sesame-rio-ntriples-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-rdfjson\2.7.12\sesame-rio-rdfjson-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-rdfxml\2.7.12\sesame-rio-rdfxml-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-trix\2.7.12\sesame-rio-trix-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-turtle\2.7.12\sesame-rio-turtle-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-rio-trig\2.7.12\sesame-rio-trig-2.7.12.jar;C:\Users\HP\.m2\repository\org\openrdf\sesame\sesame-util\2.7.12\sesame-util-2.7.12.jar;C:\Users\HP\.m2\repository\com\github\jsonld-java\jsonld-java-sesame\0.5.0\jsonld-java-sesame-0.5.0.jar;C:\Users\HP\.m2\repository\org\apache\httpcomponents\httpcore\4.4.3\httpcore-4.4.3.jar;C:\Users\HP\.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;C:\Users\HP\.m2\repository\org\semarglproject\semargl-sesame\0.6.1\semargl-sesame-0.6.1.jar;C:\Users\HP\.m2\repository\org\semarglproject\semargl-core\0.6.1\semargl-core-0.6.1.jar;C:\Users\HP\.m2\repository\org\semarglproject\semargl-rdfa\0.6.1\semargl-rdfa-0.6.1.jar;C:\Users\HP\.m2\repository\org\semarglproject\semargl-rdf\0.6.1\semargl-rdf-0.6.1.jar;C:\Users\HP\.m2\repository\org\apache\servicemix\bundles\org.apache.servicemix.bundles.javax-inject\1_2\org.apache.servicemix.bundles.javax-inject-1_2.jar;C:\Users\HP\.m2\repository\org\apache\servicemix\bundles\org.apache.servicemix.bundles.aopalliance\1.0_6\org.apache.servicemix.bundles.aopalliance-1.0_6.jar;C:\Users\HP\.m2\repository\com\google\inject\guice\4.0\guice-4.0.jar;C:\Users\HP\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\HP\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\HP\.m2\repository\com\google\inject\extensions\guice-assistedinject\4.0\guice-assistedinject-4.0.jar;C:\Users\HP\.m2\repository\com\google\inject\extensions\guice-multibindings\4.0\guice-multibindings-4.0.jar;C:\Users\HP\.m2\repository\net\sourceforge\owlapi\telemetry\2.0.0\telemetry-2.0.0.jar > My Code Results....................... > Ontology(OntologyID(OntologyIRI(< > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1>) > VersionIRI(<null>))) [Axioms: 5 Logical Axioms: 4] First 20 axioms: > {Declaration(ObjectProperty(< > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#hasValue>)) > ClassAssertion(<http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#A> < > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#testInv>) > ClassAssertion(<http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#B> < > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#testInv>) > DisjointClasses(<http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#A> > <http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#B>) > SubClassOf(ObjectSomeValuesFrom(< > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#R> < > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#A>) > ObjectSomeValuesFrom(< > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#S> < > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1#B>)) } > > check consistency: false > > Exception in thread "main" java.lang.NoSuchMethodError: > org.semanticweb.owlapi.model.OWLOntologyManager.createOntology(Ljava/util/Set;)Lorg/semanticweb/owlapi/model/OWLOntology; > at > org.semanticweb.owl.explanation.impl.blackbox.checker.ConsistencyEntailmentChecker.isEntailed(ConsistencyEntailmentChecker.java:110) > at > org.semanticweb.owl.explanation.impl.blackbox.InconsistentOntologyExpansionStrategy.doExpansion(InconsistentOntologyExpansionStrategy.java:44) > at > org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.doExpansion(BlackBoxExplanationGenerator2.java:258) > at > org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.computeExplanation(BlackBoxExplanationGenerator2.java:179) > at > org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.generateExplanation(BlackBoxExplanationGenerator2.java:289) > at > org.semanticweb.owl.explanation.impl.blackbox.hst.HittingSetTree.buildHittingSetTree(HittingSetTree.java:116) > at > org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.getExplanations(BlackBoxExplanationGenerator2.java:114) > at > org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.getExplanations(BlackBoxExplanationGenerator2.java:91) > at > com.mycompany.testowlexplanation.OWLExplainationTest.main(OWLExplainationTest.java:81) > Command execution failed. > org.apache.commons.exec.ExecuteException: Process exited with an error: 1 > (Exit value: 1) > at org.apache.commons.exec.DefaultExecutor.executeInternal > (DefaultExecutor.java:404) > at org.apache.commons.exec.DefaultExecutor.execute > (DefaultExecutor.java:166) > at org.codehaus.mojo.exec.ExecMojo.executeCommandLine > (ExecMojo.java:982) > at org.codehaus.mojo.exec.ExecMojo.executeCommandLine > (ExecMojo.java:929) > at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:457) > 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:957) > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) > at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) > 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.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) > --------------------------------------------------- > > > My Test Example code----------------------------------------- > > public class OWLExplainationTest { > public static void main(String[] args) throws IOException, > OWLOntologyCreationException { > > System.out.println("OWL API Versions......................."); > > System.out.println(System.getProperty("java.class.path")); > > System.out.println("My Code Results......................."); > OWLOntologyManager man = OWLManager.createOWLOntologyManager(); > > IRI IOR = IRI.create(" > http://www.sln4mop.org/ontologies/2021/GoviOntologyV1"); > > OWLOntology o; > > o = man.createOntology(IOR); > OWLDataFactory df = > o.getOWLOntologyManager().getOWLDataFactory(); > > > OWLClass A = df.getOWLClass(IOR + "#A"); > OWLClass B = df.getOWLClass(IOR + "#B"); > OWLClass X = df.getOWLClass(IOR + "#X"); > OWLObjectProperty R = df.getOWLObjectProperty(IOR + "#R"); > OWLObjectProperty S = df.getOWLObjectProperty(IOR + "#S"); > OWLSubClassOfAxiom ax = > df.getOWLSubClassOfAxiom(df.getOWLObjectSomeValuesFrom(R, A), > df.getOWLObjectSomeValuesFrom(S, B)); > o.add(ax); > > OWLObjectProperty hasValue = df.getOWLObjectProperty(IOR + > "#hasValue"); > OWLDeclarationAxiom d_hasValue = > df.getOWLDeclarationAxiom(hasValue); > o.add(d_hasValue); > > // create an inconsistent ontology by declaring an individual > member of two disjoint classes > OWLIndividual i = df.getOWLNamedIndividual(IOR + > "#testInv"); > OWLDisjointClassesAxiom ax2 = > df.getOWLDisjointClassesAxiom(A, B); > o.add(ax2 ); > o.add(df.getOWLClassAssertionAxiom(A, i)); > o.add( df.getOWLClassAssertionAxiom(B, i)); > > System.out.println(o); > > OWLReasonerFactory hermitreasonerFactory = new > Reasoner.ReasonerFactory(); > OWLReasoner r = hermitreasonerFactory.createReasoner(o); > > System.out.println("check consistency: "+ r.isConsistent()); > > //create the explanation generator --- this code is not > working.............. > ExplanationGenerator<OWLAxiom> explainInconsistency = new > InconsistentOntologyExplanationGeneratorFactory(hermitreasonerFactory,1000L).createExplanationGenerator(o); > //Ask for an explanation of `Thing subclass of Nothing` - this axiom > is entailed in any inconsistent ontology > Set<Explanation<OWLAxiom>> explanations = > explainInconsistency.getExplanations(df.getOWLSubClassOfAxiom(df > .getOWLThing(), df.getOWLNothing())); > System.out.println("TestExplanation.main() " + explanations); > > } > > > -------------------------------------- > > On Wed, Aug 4, 2021 at 1:13 AM Ignazio Palmisano < > ipa...@gm...> wrote: > >> >> >> On Tue, 3 Aug 2021, 22:23 Shyama Wilson, <sh...@uw...> wrote: >> >>> Thank You very much for your prompt reply >>> >>> I used the below dependencies only. Please kindly let me know still I >>> have version issue with regards to my issue. >>> >>> <dependencies> >>> <dependency> >>> <groupId>net.sourceforge.owlapi</groupId> >>> <artifactId>owlapi-distribution</artifactId> >>> <version>5.1.17</version> >>> </dependency> >>> <dependency> >>> <groupId>net.sourceforge.owlapi</groupId> >>> <artifactId>org.semanticweb.hermit</artifactId> >>> <version>1.4.3.517</version> >>> </dependency> >>> <dependency> >>> <groupId>net.sourceforge.owlapi</groupId> >>> <artifactId>owlexplanation</artifactId> >>> <version>2.0.0</version> >>> <type>jar</type> >>> </dependency> >>> >>> >> >> These look correct. >> Can you add this as first line to your Java code and post back the result? >> >> System.out.println(System.getProperty("java.class.path")); >> >> Cheers, >> Ignazio >> >> >>> ------------------ >>> >>> Cheers! >>> >>> On Wed, Aug 4, 2021 at 12:08 AM Ignazio Palmisano < >>> ipa...@gm...> wrote: >>> >>>> >>>> >>>> On Tue, 3 Aug 2021, 21:30 Shyama, <shy...@gm...> wrote: >>>> >>>>> HI >>>>> >>>>> Could Anyone please kindly assists me to resolve this issue. >>>>> >>>>> I have written a code to test an inconsistency Explanation. The code >>>>> does not show any syntax error, but it got exceptions while running the >>>>> code as follows; For your information, the code and the OWL explanation >>>>> dependency are attached at the end. >>>>> ------------------------------------------- >>>>> Exception in thread "main" java.lang.NoSuchMethodError: >>>>> org.semanticweb.owlapi.model.OWLOntologyManager.createOntology(Ljava/util/Set;)Lorg/semanticweb/owlapi/model/OWLOntology; >>>>> >>>> -------------------------------------------- >>>>> >>>>> Used HermiT reasoner >>>>> >>>> >>>> >>>> Hi, >>>> Which version of HermiT? >>>> >>>> The stack trace is typical of situations where two versions of OWLAPI >>>> are on the classpath, and old versions of HermiT (1.3.8, for example) >>>> include the OWLAPI classes in the HermiT jar, making it very hard to use >>>> with newer libraries. At compile time this goes unnoticed because classpath >>>> order differs. >>>> >>>> Cheers, >>>> Ignazio >>>> >>>> >>>>> Dependency used >>>>> --------------------- >>>>> <dependency> >>>>> <groupId>net.sourceforge.owlapi</groupId> >>>>> <artifactId>owlexplanation</artifactId> >>>>> <version>2.0.0</version> >>>>> <type>jar</type> >>>>> </dependency> >>>>> ------------------------------- >>>>> >>>>> *code Snippet* >>>>> >>>>> public static void main(String[] args) throws IOException, >>>>> OWLOntologyCreationException { >>>>> OWLOntologyManager man = OWLManager.createOWLOntologyManager(); >>>>> IRI IOR = IRI.create(" >>>>> http://www.sln4mop.org/ontologies/2021/GoviOntologyV1"); >>>>> >>>>> OWLOntology o; >>>>> >>>>> >>>>> o = man.createOntology(IOR); >>>>> OWLDataFactory df = >>>>> o.getOWLOntologyManager().getOWLDataFactory(); >>>>> >>>>> OWLClass A = df.getOWLClass(IOR + "#A"); >>>>> OWLClass B = df.getOWLClass(IOR + "#B"); >>>>> OWLClass X = df.getOWLClass(IOR + "#X"); >>>>> OWLObjectProperty R = df.getOWLObjectProperty(IOR + >>>>> "#R"); >>>>> OWLObjectProperty S = df.getOWLObjectProperty(IOR + >>>>> "#S"); >>>>> OWLSubClassOfAxiom ax = >>>>> df.getOWLSubClassOfAxiom(df.getOWLObjectSomeValuesFrom(R, A), >>>>> df.getOWLObjectSomeValuesFrom(S, B)); >>>>> o.add(ax); >>>>> >>>>> // create an inconsistent ontology by declaring an >>>>> individual member of two disjoint classes >>>>> OWLIndividual i = df.getOWLNamedIndividual(IOR + >>>>> "#testInv"); >>>>> OWLDisjointClassesAxiom ax2 = >>>>> df.getOWLDisjointClassesAxiom(A, B); >>>>> o.add(ax2 ); >>>>> o.add(df.getOWLClassAssertionAxiom(A, i)); >>>>> o.add( df.getOWLClassAssertionAxiom(B, i)) >>>>> >>>>> OWLReasonerFactory hermitreasonerFactory = new >>>>> ReasonerFactory(); >>>>> OWLReasoner r = hermitreasonerFactory.createReasoner(o); >>>>> >>>>> System.out.println("check consistency"+ r.isConsistent()); >>>>> >>>>> //create the explanation generator --- this code is not >>>>> working.............. >>>>> >>>>> >>>>> >>>>> >>>>> * ExplanationGenerator<OWLAxiom> explainInconsistency = new >>>>> InconsistentOntologyExplanationGeneratorFactory(hermitreasonerFactory,1000L).createExplanationGenerator(o); >>>>> // Ask for an explanation of `Thing subclass of Nothing` - this axiom is >>>>> entailed in any inconsistent ontology Set<Explanation<OWLAxiom>> >>>>> explanations = >>>>> explainInconsistency.getExplanations(df.getOWLSubClassOfAxiom(df >>>>> .getOWLThing(), df.getOWLNothing())); >>>>> System.out.println("TestExplanation.main() " + explanations);* >>>>> >>>>> } >>>>> >>>>> >>>>> Cheers! >>>>> >>>>> -- >>>>> Shyama Wilson >>>>> Department of Computer Science and Informatics >>>>> Uva Wellassa University: www.uwu.ac.lk >>>>> Badulla, Sri Lanka >>>>> email: sh...@uw... <am...@uw...> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Owlapi-developer mailing list >>>>> Owl...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>>>> >>>> _______________________________________________ >>>> Owlapi-developer mailing list >>>> Owl...@li... >>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>>> >>> >>> >>> -- >>> Department of Computer Science and Informatics >>> Faculty of Applied Sciences >>> Uva Wellassa University >>> Badulla >>> _______________________________________________ >>> Owlapi-developer mailing list >>> Owl...@li... >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>> >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> > > > -- > Shyama Wilson > Department of Computer Science and Informatics > Uva Wellassa University: www.uwu.ac.lk > Badulla, Sri Lanka > email: sh...@uw... <am...@uw...> > > > > > > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > |