OPTIONAL with empty default graph produces SPARQL compiler error #452

Open
depressiveRobot opened this Issue Jul 29, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@depressiveRobot

When executing the following query:

SELECT ?s
FROM NAMED <urn:graph>
WHERE {
  OPTIONAL { ?s ?p ?o . }
}

Virtuoso throws this error:

Virtuoso 37000 Error SP031: SPARQL compiler: Variable 's' can not be bound due to mutually exclusive restrictions on its value

SPARQL query:
define sql:big-data-const 0 
#output-format:text/html
define sql:signal-void-variables 1 SELECT ?s
FROM NAMED <urn:graph>
WHERE {
  OPTIONAL { ?s ?p ?o . }
}

According to the SPARQL specification the default graph of the query's dataset is empty:

If there is no FROM clause, but there is one or more FROM NAMED clauses, then the dataset includes an empty graph for the default graph.

So my opinion is that the compiler is aware of this fact and therefore produces this error.

But, I see no reason why this should happen as this is a correct SPARQL query.

Tested with Virtuoso 7.2.1

@HughWilliams

This comment has been minimized.

Show comment
Hide comment
@HughWilliams

HughWilliams Jul 29, 2015

Collaborator

@depressiveRobot:

We are checking this ...

Collaborator

HughWilliams commented Jul 29, 2015

@depressiveRobot:

We are checking this ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment