You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Error accessing SPARQL endpoint https://query.wikidata.org/sparql: The endpoint returned an invalid SPARQL results JSON response.
at emitError (/usr/local/lib/node_modules/@ldf/server/node_modules/@ldf/datasource-sparql/lib/datasources/SparqlDatasource.js:74:33)
at Request.<anonymous> (/usr/local/lib/node_modules/@ldf/server/node_modules/@ldf/datasource-sparql/lib/datasources/SparqlDatasource.js:48:28)
at Request.emit (events.js:327:22)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/@ldf/server/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:421:28)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Error accessing SPARQL endpoint https://query.wikidata.org/sparql: The endpoint returned an invalid SPARQL results JSON response.
at emitError (.../.nvm/versions/node/v14.19.0/lib/node_modules/@ldf/server/node_modules/@ldf/datasource-sparql/lib/datasources/SparqlDatasource.js:74:33)
at Request.<anonymous> (.../.nvm/versions/node/v14.19.0/lib/node_modules/@ldf/server/node_modules/@ldf/datasource-sparql/lib/datasources/SparqlDatasource.js:48:28)
at Request.emit (events.js:412:35)
at IncomingMessage.<anonymous> (....nvm/versions/node/v14.19.0/lib/node_modules/@ldf/server/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:519:28)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1334:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Furthermore I think this logic is wrong. I believe the correct condition is to add the GRAPH clause only when the quad.graph is defined and it is different from DefaultGraph:
(2) The deprecated library request doesn't know how to handle this request (I don't know exactly why).
Changing the condition as I mentioned and replacing request to the node-fetch library everything worked like a charm. However, many tests failed exactly because the condition was changed , which imho is wrong.
So the following lines that add the GRAPH in the query causes problems on the server.
Oh, good catch. That looks wrong indeed!
The deprecated library require doesn't know how to handle this request (I don't know exactly why).
Changing the condition as I mentioned and replacing request to the node-fetch library everything worked like a charm. However, many tests failed exactly because the condition was changed , which imho is wrong.
We could even go a step further, and use fetch-sparql-endpoint, which would simplify the code quite a bit (and also simplify mocking in the unit tests).
I use a simple LDF server encompassing three data sources: an HDT dump, a TTL dump, and an active SPARQL endpoint.
But I have the same issue when trying to query my server (or when I try to go an the source's page on the server website, in 'Available Datasets') I get the same error than in this issue.
Hi @RdNetwork, sorry for the delay.
The solution is described in the issue, however I still haven't had time to replace the request library nor to change the tests.
Activity
rubensworks commentedon Jun 9, 2022
Can you inspect the error message of
eto see what is going wrong? (just adding aconsole.logshould be sufficient) https://github.com/LinkedDataFragments/Server.js/blob/master/packages/datasource-sparql/lib/datasources/SparqlDatasource.js#L48marcelomachado commentedon Aug 10, 2022
Same here:
marcelomachado commentedon Nov 8, 2022
This problem is caused by two reasons:
(1) Wikidata (Blazegraph) does not support queries with GRAPH. So the following lines that add the GRAPH in the query causes problems on the server.
Server.js/packages/datasource-sparql/lib/datasources/SparqlDatasource.js
Line 145 in 2861f58
Server.js/packages/datasource-sparql/lib/datasources/SparqlDatasource.js
Line 160 in 2861f58
Furthermore I think this logic is wrong. I believe the correct condition is to add the GRAPH clause only when the quad.graph is defined and it is different from DefaultGraph:
(2) The deprecated library
requestdoesn't know how to handle this request (I don't know exactly why).Changing the condition as I mentioned and replacing request to the
node-fetchlibrary everything worked like a charm. However, many tests failed exactly because the condition was changed , which imho is wrong.rubensworks commentedon Nov 8, 2022
Oh, good catch. That looks wrong indeed!
We could even go a step further, and use fetch-sparql-endpoint, which would simplify the code quite a bit (and also simplify mocking in the unit tests).
marcelomachado commentedon Nov 8, 2022
Ok, I will change this and see if I can fix the tests too.
RdNetwork commentedon Apr 17, 2023
Hi,
I use a simple LDF server encompassing three data sources: an HDT dump, a TTL dump, and an active SPARQL endpoint.
But I have the same issue when trying to query my server (or when I try to go an the source's page on the server website, in 'Available Datasets') I get the same error than in this issue.
The SPARQL endpoint I want to query is this one: https://mediag.bunka.go.jp/sparql
(This page doesn't work, but the endpoint is working, and is the one queried through this page: https://mediag.bunka.go.jp/madb_lab/lod/sparql/ )
Is there a way to solve this? Did I miss an update?
I use a standard Node/NPM setup of LDF (
npm install -g @ldf/serveretc.)marcelomachado commentedon Sep 5, 2023
Hi @RdNetwork, sorry for the delay.
The solution is described in the issue, however I still haven't had time to replace the
requestlibrary nor to change the tests.