Code Monkey home page Code Monkey logo

Comments (7)

tkuhn avatar tkuhn commented on August 24, 2024 1

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.

tkuhn avatar tkuhn commented on August 24, 2024

ps: I forgot to add that both queries work fine when directly submitted to the SPARQL endpoint.

from grlc.

tkuhn avatar tkuhn commented on August 24, 2024

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.

tkuhn avatar tkuhn commented on August 24, 2024

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.

c-martinez avatar c-martinez commented on August 24, 2024

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.

tkuhn avatar tkuhn commented on August 24, 2024

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.

c-martinez avatar c-martinez commented on August 24, 2024

This is fixed in release v1.3.9

from grlc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.