VALUES in OPTIONAL returns incorrect query results

Description

Reported on the mailinglist by Drew Perttula:

I want to sort results by the presence of a class:

I stumbled on VALUES, but I welcome other suggestions for how to accomplish my query. Meanwhile, this query seems to reveal a bug in VALUES.

Without the VALUES block in there, I get rows with ?comp and ?label, and of course ?isServiceComponent is always undef. All rows are returned. This seems correct.

With the query as written above, a few things go wrong at once: all ?label results become undefined, and rows with no ?isServiceComponent are omitted, like this:

It's kind of like the rdfs:label constraint and the OPTIONAL keyword both got ignored, turning the '?comp a :ServiceComponent' pattern from optional to required and turning the VALUES into something that's always applied.

Environment

None

Status

Assignee

Jeen Broekstra

Reporter

Jeen Broekstra

Labels

None

Fix versions

Affects versions

Priority

Major
Configure