Comments (7)
Can you inspect the error message of e
to see what is going wrong? (just adding a console.log
should be sufficient) https://github.com/LinkedDataFragments/Server.js/blob/master/packages/datasource-sparql/lib/datasources/SparqlDatasource.js#L48
from server.js.
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.
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:
if (quad.graph && quad.graph.termType !== '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.
from server.js.
Same here:
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)
from server.js.
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).
from server.js.
Ok, I will change this and see if I can fix the tests too.
from server.js.
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/server
etc.)
from server.js.
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.
from server.js.
Related Issues (20)
- Error: Cannot find module 'rdf-string' in core package HOT 2
- Invalid path to components file HOT 12
- TypeError: Cannot set property graph of #<Quad> which has only a getter HOT 2
- Dependency Dashboard
- No matches in readme data example HOT 4
- how to setup a local fuseki server ? HOT 5
- Only first page is returned when using proxy HOT 2
- Composite data source is empty in 3.x (worked in 2.x) HOT 2
- Shouldn't it be SPARQL Endpoint instead of HDT file? HOT 1
- Is it possible to add the server as a dependency of another server? HOT 1
- Invalid filename for HDT source HOT 2
- Consistently use file to refer to file paths (and not e.g. htdFile).
- Replace Request dependency HOT 3
- Does the server support searching/filtering by string literals' language tags? HOT 1
- `void:triples` has page as subject instead of dataset. HOT 1
- SIGTERM no longer reloads data properly - just adds more workers HOT 2
- Uncontrolled Resource Consumption in parse-link-header HOT 3
- Server-Side Request Forgery in Request
- Checking WAC permissions with LDF ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from server.js.