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

FEDERATED SERVICE query fails on VALUES assignment #5218

Open
milung opened this issue Dec 20, 2024 · 2 comments
Open

FEDERATED SERVICE query fails on VALUES assignment #5218

milung opened this issue Dec 20, 2024 · 2 comments
Labels
🐞 bug issue is a bug

Comments

@milung
Copy link

milung commented Dec 20, 2024

Current Behavior

When executing following query :

SELECT * WHERE {
SERVICE <http://localhost:8080/rdf4j-server/repositories/test> {
    VALUES   ?o   { "a" } 
    ?s a ?o.
} }

I got response :

Query evaluation error: org.eclipse.rdf4j.query.QueryEvaluationException: Encountered " <STRING_LITERAL2> "\"a\" "" at line 1, column 388. Was expecting one of: "(" ... <NIL> ... <VAR1> ... <VAR2> ...

This is the most simple materialization of the error originally found in a more complex queries involving graph patterns and subqueries.

The error is not materialized if

  • variable ?o is not present in the subsequent triple, e.g. renaming it to o2
  • non federate query - if SERVICE is not used,
  • using BIND( "a" AS ?o) instead of VALUES clause.

The error materializes:

  • if subquery in SERVICE is used,
  • with var value being IRI or literal
  • with subject or object variable used
  • with subgroups usage (graph or simple)

Expected Behavior

there shall be no difference between usage of query through FEDERATED query or directly on the sparql endpoint

Steps To Reproduce

  1. Run dockerized rdf4j-workbench as per instructions at https://hub.docker.com/r/eclipse/rdf4j-workbench (tag: 5.1.0)
    2.Open the site http://localhost:8080/rdf4j-workbench

  2. Create new repository test (Native Store, no changed configurations)

  3. go to Query page and executed query:

    SELECT * WHERE {
    SERVICE <http://localhost:8080/rdf4j-server/repositories/test> {
      VALUES   ?o   { "a" } 
      ?s a ?o.
      } }
  4. See error:

    Query evaluation error: org.eclipse.rdf4j.query.QueryEvaluationException: Encountered " <STRING_LITERAL2> "\"a\" "" at line 1,  column 388. Was expecting one of: "(" ... <NIL> ... <VAR1> ... <VAR2> ...
    
  5. Execute query (non federated)

    SELECT * WHERE {
         VALUES   ?o   { "a" } 
      ?s a ?o.
      }
  6. You get empty result set as expected.

Version

5.1.0

Are you interested in contributing a solution yourself?

Perhaps?

Anything else?

May be also related to this issue: #4522, it seems to be a result of sending optimized/simplified query to a federated service. An ability to disable optimization for federated queries will be at least a good workaround for such issues.

@milung milung added the 🐞 bug issue is a bug label Dec 20, 2024
@hmottestad
Copy link
Contributor

Does it happen if you use the full syntax?

VALUES ( ?o ) { ( "a" ) }

@milung
Copy link
Author

milung commented Dec 22, 2024

Does it happen if you use the full syntax?

VALUES ( ?o ) { ( "a" ) }

Yes, I tried variaous forms, including multiple variables form. Except of BIND syntax it always failed

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

No branches or pull requests

2 participants