Comments (7)
OK, found it! :)
sparql.rq
seems to be dead code, or at least not the commonly executed part.
This solved it: b09824a
It works on my own Virtoso and RDF4J SPARQL endpoints. But for some reason, it doesn't work on the default https://dbpedia.org/sparql .
That's why I didn't make a pull request yet. And maybe this should rather be triggered by an argument like endpoint-method
to it can manually be set to GET
and POST
.
from grlc.
ps: I forgot to add that both queries work fine when directly submitted to the SPARQL endpoint.
from grlc.
Investigating a bit further, this problem could be related to URL length exceeding its limit.
This query reproduces the problem: https://github.com/knowledgepixels/grlc-test/blob/main/minimal-comments-2.rq
The query itself is minimal, but the whole query file is larger due to long comments.
Trying it on grlc.io with the standard endpoint (http://dbpedia.org/sparql), I get a 414 Request-URI Too Large error: https://grlc.knowledgepixels.com/api-git/knowledgepixels/grlc-test/#/default/post_minimal_comments_2
If I run it against my own endpoint (https://query.np.trustyuri.net/repo/meta), which I have configured to allow for long URLs, I get the error from above: 500 Internal Server Error (but the query works when issued directly to the SPARQL endpoint).
I have set method to POST, but I suppose that's only how the client is accessing the grlc server, not how grlc is accessing the SPARQL endpoint, right? If so, is there a way to configure the SPARQL endpoint requests to be POST too? I suppose that might be the problem.
from grlc.
After a bit more investigation, I am suspecting that adding
client.setMethod(SPARQLWrapper.Wrapper.POST)
around line 42 in sparql.py should solve the problem.
But I haven't figured out yet how to build it and test it on my own. When I build it through Docker it doesn't seem to pick up the updated code...
from grlc.
Hi @tkuhn -- thanks! That looks like it was a hard issue to track down, so thanks for your hard work! I am not sure if it is standard for endpoints to receive requests via GET
or POST
or are both possible? In which case, maybe we should do as you say and make it optional with a parameter (with the default being POST
perhaps?)
from grlc.
If I understand the SPARQL protocol (https://www.w3.org/TR/sparql11-protocol/) correctly, then endpoints need to provide both, GET and POST support.
POST as default sounds reasonable to me, except possibly for backwards compatibility, if not all endpoints implement the protocol fully (as with DBpedia, it seems)?
from grlc.
This is fixed in release v1.3.9
from grlc.
Related Issues (20)
- Returning JSON-LD HOT 16
- PIP package isntallation doesn't seem to work... HOT 5
- Restore Flake8 linting on Github testing action HOT 2
- Help me to install most fresh version HOT 4
- Pip install from GitHub does not work HOT 1
- Add GitLab tests HOT 1
- Adding GitLab testing repo HOT 2
- Document GitLab functionality HOT 1
- Server throws HTTP 500 error when there is no accept header in the request HOT 3
- Allow to describe parameters HOT 3
- Allowing values to be inserted from the body into a query HOT 3
- Python version upgrade
- Tweet on release
- Support for SPARQL queries stored in nanopubs HOT 1
- "No API definition provided." for subdirectory in github HOT 4
- Avoid clashes with other files present in repository? HOT 3
- SARS-CoV-2-Queries API not working HOT 2
- "cannot access local variable ‘query_metadata’ where it is not associated with a value" HOT 3
- Documenting JSON queries HOT 2
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 grlc.