-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When running a query where FILTER is used in one group of a UNION and makes use of a variable bound outside either group, results from the other half of the union appear to be discarded.
RDF:
@base <http:>.
<test>
<has> "1";
<knows> <A> .
<A>
<has> "2";
<knows> <test> ;
<knows> <B> .
<B>
<has> "1";
<knows> <test> ;
<knows> <A> .
<C>
<has> "2";
<knows> <A> .
QUERY:
BASE <http:>
SELECT ?person ?num
WHERE {
?person <has> ?num .
{
?person <knows> <test>.
}
UNION
{
?person <has> ?num FILTER (?num = "2").
}
}
RESULTS:
<http:A> | "2"
<http:C> | "2"
EXPECTED RESULTS (by changing ?num variable name in the second union group):
<http:A> | "2"
<http:B> | "1"
<http:A> | "2"
<http:C> | "2"
I have tested this here: https://www.leskoff.com/s02217-0
My query does produce the intended results there.
RDF
@base <http:a\>.
<:test>
<:has> "1";
<:knows> <:A> .
<:A>
<:has> "2";
<:knows> <:test> ;
<:knows> <:B> .
<:B>
<:has> "1";
<:knows> <:test> ;
<:knows> <:A> .
<:C>
<:has> "2";
<:knows> <:A> .
QUERY
SELSELECT ?person ?num
WHERE {
?person <:has> ?num .
{
?person <:knows> <:test>.
}
UNION
{
?person <:has> ?num FILTER (?num = "2").
}
}
RESULTS
?person | ?num
<:B> | "1"
<:A> | "2"
<:A> | "2"
<:C> | "2"
Metadata
Metadata
Assignees
Labels
No labels