Wrong result with multiple FROM in SPARQL query #109

Open
ghirardinicola opened this Issue Nov 21, 2013 · 3 comments

Projects

None yet

3 participants

@ghirardinicola

According to the SPARQL reference, multiple FROM clauses should mean a
query over the merge of all specified datasets.
http://www.w3.org/TR/sparql11-query/#unnamedGraph

I used multiple graph in a query and a combination of filter and minus operators in "where" clause in this way:

SELECT ?s
FROM
FROM
WHERE
{
?s rdf:type
MINUS { ?s ?p1 .
}
?s ?p2 FILTER ( ?p2='p2_1' || ?p2='p2_2' )
}

The result is 0 (it should not).
It does not happen removing the first graph or removing the "or" in the filter (or the minus clause).
There are other example where a mix of filter and filter not exist with multiple from gives wrong results.

Thanks for the help

Nicola Ghirardi
CINECA
Italy

PS.
I'm using Virtuoso version 07.00.3203 on Linux (x86_64-pc-linux-gnu), Single Server Edition

This the query "explain":

{

Precode:
0: __rdflit := Call __rdflit (rdflit1067587)
5: __rdflit := Call __rdflit (rdflit1067586)
10: BReturn 0
RDF_QUAD_POGS 4.2e+02 rows(s_13_8_t2.O, s_13_8_t2.S, s_13_8_t2.G)
P = #ssd , O = $32 "in_iter"
END Node
After test:
0: one_of_these := Call one_of_these (s_13_8_t2.G, #database/repositories/rlink/config , #database/repositories/rlink/researchUgovData )
5: if ( 0 < one_of_these) then 9 else 31 unkn 31
9: if ({
RDF_QUAD 0.41 rows(s_12_4_t0.G)
inlined P = #hasVersion , S = k_s_13_8_t2.S
END Node
After test:
0: one_of_these := Call one_of_these (s_12_4_t0.G, #database/repositories/rlink/config , #database/repositories/rlink/researchUgovData )
5: if ( 0 < one_of_these) then 9 else 10 unkn 10
9: BReturn 1
10: BReturn 0
Subquery Select( )
}
) then 31 else 13 unkn 31
13: isiri_id := Call isiri_id (s_13_8_t2.O)
18: temp := artm 1 - isiri_id
22: temp := artm 1 - isiri_id
26: if ( 0 = temp) then 31 else 30 unkn 31
30: BReturn 1
31: BReturn 0
in iterates in_iter over ( #database/repositories/rlink/config , #database/repositories/rlink/researchUgovData )
RDF_QUAD 0.18 rows(s_13_8_t1.S)
inlined P = #type , S = k_s_13_8_t2.S , O = #ResearchContent , G = k_in_iter

After code:
0: istanza := Call __id2in (s_13_8_t1.S)
5: BReturn 0
Select (istanza)
}

@openlink
Owner

As far as i am aware, this problem has been fixed in the develop/7 branch which we are about to release. Is it possible you retest your queries and let us know if the problem still occurs?

@iv-an-ru iv-an-ru was assigned by openlink Feb 13, 2014
@ghirardinicola

No it is not.
Here an example query involving only only filters and or (but it happens also with multiple from)
SELECT ?s
WHERE
{
?s http://purl.org/dc/terms/subject ?p2 .
FILTER NOT EXISTS { ?s http://dbpedia.org/ontology/alias "The Bad Samaritans" . }
FILTER ( ?p2=http://dbpedia.org/resource/Category:British_punk_rock_groups || ?p2=http://dbpedia.org/resource/Category:English_rock_music_groups )
}

@openlink
Owner

I have passed this issue back to development.

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