Open zify85 opened 2 years ago
Hi @howellzify I faced a similar issue and found out it's related to this issue from Virtuoso. I think you need to turn of ASK queries for this endpoints.
<http://DBpedia> a sd:Service ;
fedx:store "SPARQLEndpoint";
sd:endpoint "http://dbpedia.org/sparql";
fedx:supportsASKQueries false .
Thanks for supplying a pointer to the solution @patrickwyler !
In the same link, they also posted a workaround. Could you please look into that and update the code?
In the same link, they also posted a workaround. Could you please look into that and update the code?
I'm not sure what you're asking. The bug is on Virtuoso's side as it returns text/html on ASK queries. I don't think there's anything we can do on our end to make this work. Or did I overlook something?
I would like to draw your attention to the last two comments and this code snippet given as a workaround:
SPARQLRepository repo = new SPARQLRepository(host);
Map<String, String> headers =new HashMap<>();
headers.put("Accept", "application/sparql-results+json");
repo.setAdditionalHttpHeaders(headers);
Is this possible to integrate this into FedX?
Not sure, but we can take another look! Reopened.
Current Behavior
While setting up RDF4J Server I tested the federation capability using the sample located in the documentation at https://rdf4j.org/documentation/programming/federation/#using-a-java-program
Instead of using Java, I used the workbench and setup individual SparlQL Endpoint Proxies repositories for DBPedia and Wikidata per the example. I then created a federated respository using the two repos.
When I run the following query I received an error:
Error
Query evaluation error: org.eclipse.rdf4j.federated.exception.OptimizationException: Error checking results for endpoint DBPedia: @ DBPedia - HTTP Error: 406 Not Acceptable. Subquery: ASK { ?country <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/class/yago/WikicatMemberStatesOfTheEuropeanUnion> . }
NOTE: I can run queries successfully against DBPedia or Wikidata using the individual repos but the federated endpoint does not work.
Expected Behavior
I expected the federated repository to work using the sample listed in the documentation https://rdf4j.org/documentation/programming/federation/#using-a-java-program
I attempted to repeat the Java code sample using the workbench.
Steps To Reproduce
SELECT * WHERE { ?country a http://dbpedia.org/class/yago/WikicatMemberStatesOfTheEuropeanUnion . ?country http://www.w3.org/2002/07/owl#sameAs ?countrySameAs . ?countrySameAs wdt:P2131 ?gdp . }`
Query evaluation error: org.eclipse.rdf4j.federated.exception.OptimizationException: Error checking results for endpoint DBPedia: @ DBPedia - HTTP Error: 406 Not Acceptable. Subquery: ASK { ?country <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/class/yago/WikicatMemberStatesOfTheEuropeanUnion> . }
Version
4.0.0
Are you interested in contributing a solution yourself?
Perhaps?
Anything else?
No response