Hi
A very similar query not working as expected is this one.
In this case multiple form is not involved but It's a very similar
pattern and I suppose is related.
This query return 0:
SELECT ?s
WHERE
{
?s rdf:type <http://dbpedia.org/ontology/Agent>.
?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> )
}
This query return lots of result (removing or):
SELECT ?s
WHERE
{
?s rdf:type <http://dbpedia.org/ontology/Agent>.
?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> )
}
Nicola
On 06/12/2013 18:43, Hugh Williams wrote:
Hi Nicola,
Are you able to provide a test case to recreate this behaviour we can
setup locally ?
Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc. // http://www.openlinksw.com/
Weblog -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter -- http://twitter.com/OpenLink
Google+ -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers
On 20 Nov 2013, at 19:20, ghirardi nicola <n.ghira...@cineca.it
<mailto:n.ghira...@cineca.it>> wrote:
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 <graph1>
FROM <graph2>
WHERE
{
?s rdf:type <type1>
MINUS { ?s <p1> ?p1 .
}
?s <p2> ?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).
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( <none> )
}
) 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)
}
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users