Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote sparql queries always use POST #2878

Open
lalewis1 opened this issue Aug 7, 2024 · 1 comment
Open

remote sparql queries always use POST #2878

lalewis1 opened this issue Aug 7, 2024 · 1 comment

Comments

@lalewis1
Copy link

lalewis1 commented Aug 7, 2024

Hi All,

Looks like the logic in the way that the _buildQueryStringForServiceCall function gets called is flawed.
code here:

parser.parseQuery(service_query)

The function only gets passed the inner text from the SERVICE query and then the sparql parser tries to parse it which fails. This then results in a bunch of prefixes being added to the query. making the query always longer than 600 characters.

In turn this then means that a POST request is always used, due to the logic here:

if len(service_query) < 600:

@lalewis1
Copy link
Author

lalewis1 commented Aug 12, 2024

More Info.

This works as expected because the internal service query is valid sparql on its own.

...
    service <my-service> {
        select ?s ?p ?o
        where {
                ?s ?p ?o
        }
    }
...

This results in a POST request because the internal service query is not valid on its own

...
    service <my-service> {
        ?s ?p ?o
    }
...

However, the above is still valid sparql, and is how Federated queries are documented by the W3C

Suggested Solution
Only bind required prefixes to the query if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant