FEDERATED spqrl request doen't work in Protege 5.5 in sparql tab
Open
ARomanovna
opened this issue 2 years ago
•
8 comments
I would like to create the request below to get something from resource http://dbpedia.org/resource/Weather_forecasting
I tried different examples, but it is still no working, what am I doing wrong?
did you check the log files - it shows an error which indicates that some classes are missing in the classpath which indicates that the bundle doesn't contain all necessary Java libraries. Long story short, doesn't work until somebody is fixing the RDF/SPARQL bundle
ERROR 12:08:35 Uncaught Exception in thread 'AWT-EventQueue-0'
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
at org.openrdf.repository.sparql.SPARQLRepository.createHTTPClient(SPARQLRepository.java:92) ~[na:na]
at org.openrdf.repository.sparql.SPARQLRepository.(SPARQLRepository.java:78) ~[na:na]
at org.openrdf.repository.sparql.SPARQLRepository.(SPARQLRepository.java:58) ~[na:na]
at org.openrdf.query.algebra.evaluation.federation.SPARQLFederatedService.(SPARQLFederatedService.java:121) ~[na:na]
at org.openrdf.query.algebra.evaluation.federation.FederatedServiceManager.getService(FederatedServiceManager.java:129) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:301) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:586) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[na:na]
at org.openrdf.query.algebra.evaluation.iterator.JoinIterator.(JoinIterator.java:54) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:793) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:756) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:200) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:662) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:577) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:724) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:595) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:689) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:589) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:607) ~[na:na]
at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[na:na]
at org.openrdf.sail.memory.MemoryStoreConnection.evaluateInternal(MemoryStoreConnection.java:163) ~[na:na]
at org.openrdf.sail.helpers.SailConnectionBase.evaluate(SailConnectionBase.java:298) ~[na:na]
at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:60) ~[na:na]
at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:75) ~[na:na]
at org.protege.editor.owl.rdf.repository.BasicSparqlReasoner.handleTupleQuery(BasicSparqlReasoner.java:96) ~[na:na]
at org.protege.editor.owl.rdf.repository.BasicSparqlReasoner.executeQuery(BasicSparqlReasoner.java:71) ~[na:na]
at org.protege.editor.owl.rdf.SparqlQueryView.lambda$createBottomComponent$0(SparqlQueryView.java:67) ~[na:na]
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) ~[na:1.8.0_121]
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) ~[na:1.8.0_121]
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) ~[na:1.8.0_121]
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) ~[na:1.8.0_121]
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) ~[na:1.8.0_121]
at java.awt.Component.processMouseEvent(Component.java:6533) ~[na:1.8.0_121]
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) ~[na:1.8.0_121]
at java.awt.Component.processEvent(Component.java:6298) ~[na:1.8.0_121]
at java.awt.Container.processEvent(Container.java:2236) ~[na:1.8.0_121]
at java.awt.Component.dispatchEventImpl(Component.java:4889) ~[na:1.8.0_121]
at java.awt.Container.dispatchEventImpl(Container.java:2294) ~[na:1.8.0_121]
at java.awt.Component.dispatchEvent(Component.java:4711) ~[na:1.8.0_121]
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) ~[na:1.8.0_121]
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) ~[na:1.8.0_121]
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) ~[na:1.8.0_121]
at java.awt.Container.dispatchEventImpl(Container.java:2280) ~[na:1.8.0_121]
at java.awt.Window.dispatchEventImpl(Window.java:2746) ~[na:1.8.0_121]
at java.awt.Component.dispatchEvent(Component.java:4711) ~[na:1.8.0_121]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) ~[na:1.8.0_121]
at java.awt.EventQueue.access$500(EventQueue.java:97) ~[na:1.8.0_121]
at java.awt.EventQueue$3.run(EventQueue.java:709) ~[na:1.8.0_121]
at java.awt.EventQueue$3.run(EventQueue.java:703) ~[na:1.8.0_121]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) ~[na:1.8.0_121]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) ~[na:1.8.0_121]
at java.awt.EventQueue$4.run(EventQueue.java:731) ~[na:1.8.0_121]
at java.awt.EventQueue$4.run(EventQueue.java:729) ~[na:1.8.0_121]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) ~[na:1.8.0_121]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) ~[na:1.8.0_121]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [na:1.8.0_121]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [na:1.8.0_121]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [na:1.8.0_121]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [na:1.8.0_121]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [na:1.8.0_121]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [na:1.8.0_121]
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod not found by org.protege.owl.rdf [35]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574) ~[org.apache.felix.main.jar:na]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) ~[org.apache.felix.main.jar:na]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018) ~[org.apache.felix.main.jar:na]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_121]
... 66 common frames omitted
Just wanted to add to what Lorenz said: there are a lot of features that unfortunately aren't included in either the SPARQL tab or the Snap SPARQL plugin. Of the two I prefer the Snap SPARQL plugin. The UI is a bit nicer, doing color coded highlighting. Also, Snap SPARQL sees changes made by the reasoner (I don't think the SPARQL tab does) and offers you the option to add new triples to the ontology. You can't do INSERT or DELETE in either implementation of SPARQL but you can use CONSTRUCT in Snap SPARQL and it will offer you the option to add the new triples to the ontology so it functions the same as INSERT.
We also have some issues with the current support of SPARQL in Protege 5. As far as i understand, this is related to Sesame 2.7 being subpar. I am wondering whether rebuilding Protege with Sesame 2.9 would be enough to remove those limitations. Anyone has an idea?
Yes, we tried doing this last year when we were upgrading libraries. Unfortunately upgrading the sesame version above 2.7.x (through 2.9) doesn't work, some functionalities were broken in those versions and a number of our queries were not terminating (tested at first in the GUI and then with standalone programs). [After testing rdf4j, we wound up sticking with sesame 2.7.12; rdf4j had various performance issues at the time, but we'll go back to it eventually.]
As mentioned above, the sparql plugin needs additional sesame libraries to cover federation, among other sparql 1.1 functionalities. We added the missing jar files, plus made some modifications to the sparql plugin in our fork & it's working very well. The plugin in our fork, however, won't work in protege 5.5, we've bumped the owlapi version and are not using osgi. But hopefully this info saves people's time testing with the higher versions of sesame.
There was some discussion about this in the past in the respective plug-in projects, see https://github.com/protegeproject/sparql-query-plugin/issues/18 and https://github.com/protegeproject/snap-sparql-query/issues/26. In short, SPARQL 1.1 Federation may be expected to work in the "normal" SPARQL plug-in, but it is not expected to work in SNAP. If you found a problem and solution or workaround, better to report to the respective plug-in projects.