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

Incorrect handling of SPARQL VALUES clause #350

Closed
mdesalvo opened this issue Dec 4, 2024 · 0 comments
Closed

Incorrect handling of SPARQL VALUES clause #350

mdesalvo opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
bug Indicates a glitch in existing logics, causing crashes or any unexpected behaviour
Milestone

Comments

@mdesalvo
Copy link
Owner

mdesalvo commented Dec 4, 2024

The following query:

SELECT ?X ?Y ?N
WHERE {
  {
    {
      ?Y <ex:dogOf> ?X .
      OPTIONAL { ?X <ex:hasName> ?N } .
    }
    MINUS
    {
      {
        SELECT *
        WHERE {
          {
            ?Y <ex:dogOf> ?X .
            ?X <ex:hasColor> ?C .
          }
        }
      }
      UNION
      {
        VALUES (?Y ?X) {
          ( <ex:balto> <ex:whoever> )
        } .
      }
    }
  }
}
ORDER BY ASC(?X)

on the following datatset:

<ex:pluto> <ex:dogOf> <ex:topolino> .
<ex:topolino> <ex:hasName> "Mickey Mouse"@EN-US .
<ex:fido> <ex:dogOf> <ex:paperino> .
<ex:paperino> <ex:hasName> "Donald Duck"@EN-US .
<ex:balto> <ex:dogOf> <ex:whoever> .
<ex:baubau> <ex:dogOf> <ex:paperoga> .
<ex:paperoga> <ex:hasColor> "white" .
<ex:snoopie> <ex:dogOf> <ex:linus> .

produces 0 results, instead it should produce 3 results.
The reason is probably that we propagate the VALUES clause up to the mother query, but this clause has no a direct mother query since it lives inside a UNION/MINUS pattern group.

@mdesalvo mdesalvo added the bug Indicates a glitch in existing logics, causing crashes or any unexpected behaviour label Dec 4, 2024
@mdesalvo mdesalvo added this to the 3.14.0 milestone Dec 4, 2024
@mdesalvo mdesalvo self-assigned this Dec 4, 2024
@mdesalvo mdesalvo mentioned this issue Dec 4, 2024
mdesalvo added a commit that referenced this issue Dec 4, 2024
Address #350 and #351 for v3.14 development cycle
@mdesalvo mdesalvo closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates a glitch in existing logics, causing crashes or any unexpected behaviour
Projects
None yet
Development

No branches or pull requests

1 participant