protegeproject / swrlapi

Java API for working with the SWRL rule and SQWRL query languages
Other
99 stars 40 forks source link

No method isPrefixOWLOntologyFormat() #57

Closed thomakl closed 5 years ago

thomakl commented 5 years ago

Hi, I'm using the OWLAPI 5.1.0 with the SWRLAPI 2.0.6 and I'm trying to execute the basic example on the swrlapi README. I'm facing a issue: org.semanticweb.owlapi.model.OWLDocumentFormat.isPrefixOWLOntologyFormat()Z

I found out that the isPrefixOWLOntologyFormat() is replaced with isPrefixOWLDocumentFormat.

I don't know where to change the method.


EXAMPLE `Create OWLOntology instance using the OWLAPI OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = ontologyManager.loadOntologyFromOntologyDocument(new File("/ont/Ont1.owl"));

// Create SQWRL query engine using the SWRLAPI SQWRLQueryEngine queryEngine = SWRLAPIFactory.createSQWRLQueryEngine(ontology);

// Create and execute a SQWRL query using the SWRLAPI SQWRLResult result = queryEngine.runSQWRLQuery("q1","swrlb:add(?x, 2, 2) -> sqwrl:select(?x)");

// Process the SQWRL result if (result.next()) System.out.println("Name: " + result.getLiteral("x").getInteger());`

ERROR: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Exception in thread "main" org.swrlapi.exceptions.SWRLRuleEngineException: Error creating query engine Drools. Exception: java.lang.NoSuchMethodError. Message: org.semanticweb.owlapi.model.OWLDocumentFormat.isPrefixOWLOntologyFormat()Z at org.swrlapi.factory.DefaultSWRLRuleAndQueryEngineFactory.createSQWRLQueryEngine(DefaultSWRLRuleAndQueryEngineFactory.java:111) at org.swrlapi.factory.DefaultSWRLRuleAndQueryEngineFactory.createSQWRLQueryEngine(DefaultSWRLRuleAndQueryEngineFactory.java:82) at org.swrlapi.factory.SWRLAPIFactory.createSQWRLQueryEngine(SWRLAPIFactory.java:61) at msc.OntologyManager.RunSWRLAPI(OntologyManager.java:245) at msc.DecisionSWRLRule.main(DecisionSWRLRule.java:18) Caused by: java.lang.NoSuchMethodError: org.semanticweb.owlapi.model.OWLDocumentFormat.isPrefixOWLOntologyFormat()Z at org.swrlapi.factory.DefaultIRIResolver.updatePrefixes(DefaultIRIResolver.java:165) at org.swrlapi.factory.DefaultSWRLAPIOWLOntology.<init>(DefaultSWRLAPIOWLOntology.java:163) at org.swrlapi.factory.SWRLAPIInternalFactory.createSWRLAPIOntology(SWRLAPIInternalFactory.java:266) at org.swrlapi.factory.DefaultSWRLRuleAndQueryEngineFactory.createSQWRLQueryEngine(DefaultSWRLRuleAndQueryEngineFactory.java:92) ... 4 more

martinjoconnor commented 5 years ago

The SWRLAPI works with the 4.x release series of the OWLAPI.

See the following POM for dependency information:

https://github.com/protegeproject/swrlapi-parent/blob/master/pom.xml

The 5.x release series of the OWLAPI is not backwards compatible with previous versions.

thomakl commented 5 years ago

I understand. Thank you for your time.