protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
1.02k stars 231 forks source link

Federated SPARQL queries not working #977

Open daxid opened 4 years ago

daxid commented 4 years ago

In Protégé 5.5.0 Linux, when I execute the following federated query in the SPARQL tab :

PREFIX dbo: <http://dbpedia.org/ontology/>

SELECT ?subject ?predicate ?object
WHERE { 
    SERVICE <http://live.dbpedia.org/sparql/>
    {
        BIND (dbo:Battery AS ?subject)
        ?subject ?predicate ?object 
    }
}

I get no result and the following error :

Uncaught Exception in thread 'AWT-EventQueue-0' 
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/Credentials
        at org.openrdf.repository.sparql.SPARQLRepository.createHTTPClient(SPARQLRepository.java:92) ~[na:na]
        at org.openrdf.repository.sparql.SPARQLRepository.<init>(SPARQLRepository.java:78) ~[na:na]
        at org.openrdf.repository.sparql.SPARQLRepository.<init>(SPARQLRepository.java:58) ~[na:na]
        at org.openrdf.query.algebra.evaluation.federation.SPARQLFederatedService.<init>(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.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: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$2.actionPerformed(SparqlQueryView.java:76) ~[na:na]
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) ~[na:1.8.0_265]
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) ~[na:1.8.0_265]
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) ~[na:1.8.0_265]
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) ~[na:1.8.0_265]
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) ~[na:1.8.0_265]
        at java.awt.Component.processMouseEvent(Component.java:6539) ~[na:1.8.0_265]
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) ~[na:1.8.0_265]
        at java.awt.Component.processEvent(Component.java:6304) ~[na:1.8.0_265]
        at java.awt.Container.processEvent(Container.java:2239) ~[na:1.8.0_265]
        at java.awt.Component.dispatchEventImpl(Component.java:4889) ~[na:1.8.0_265]
        at java.awt.Container.dispatchEventImpl(Container.java:2297) ~[na:1.8.0_265]
        at java.awt.Component.dispatchEvent(Component.java:4711) ~[na:1.8.0_265]
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) ~[na:1.8.0_265]
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) ~[na:1.8.0_265]
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) ~[na:1.8.0_265]
        at java.awt.Container.dispatchEventImpl(Container.java:2283) ~[na:1.8.0_265]
        at java.awt.Window.dispatchEventImpl(Window.java:2746) ~[na:1.8.0_265]
        at java.awt.Component.dispatchEvent(Component.java:4711) ~[na:1.8.0_265]
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) ~[na:1.8.0_265]
        at java.awt.EventQueue.access$500(EventQueue.java:97) ~[na:1.8.0_265]
        at java.awt.EventQueue$3.run(EventQueue.java:709) ~[na:1.8.0_265]
        at java.awt.EventQueue$3.run(EventQueue.java:703) ~[na:1.8.0_265]
        at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_265]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) ~[na:1.8.0_265]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) ~[na:1.8.0_265]
        at java.awt.EventQueue$4.run(EventQueue.java:733) ~[na:1.8.0_265]
        at java.awt.EventQueue$4.run(EventQueue.java:731) ~[na:1.8.0_265]
        at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_265]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) ~[na:1.8.0_265]
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) ~[na:1.8.0_265]
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) [na:1.8.0_265]
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [na:1.8.0_265]
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [na:1.8.0_265]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [na:1.8.0_265]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [na:1.8.0_265]
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [na:1.8.0_265]
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.Credentials not found by org.protege.owl.rdf [23]
        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:351) ~[na:1.8.0_265]
        ... 56 common frames omitted

Note : the same request gives plenty of results in Topbraid Composer, so it is correct...

daxid commented 4 years ago

We looked a bit further into it, it seems to be a weird one !

Java complains : NoClassDefFoundError: org/apache/commons/httpclient/Credentials

But in all versions of httpclient we looked, Credentials is an interface, not a class !

I hope it can help...