Hi to everybody
I am developing a Virtuoso stored procedure. I want to perform a loop over
the result of a SPARQL query. The problem comes when the query contains a
reference to a graph. In all my attempts I get no error but an empty result
set as well. I tried the following
create procedure R2RML.DBA.try() returns integer{
for (sparql define input:storage ""
select ?s ?p
from <http://example.com/resource>
where {
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o .
} LIMIT 5 ) do
{
use_the_value("s");
}};
and also the following
create procedure R2RML.DBA.try() returns integer{
declare srcgraph varchar;
srcgraph := 'http://ec.example.com/resource';
for (sparql define input:storage ""
select ?s ?p
where {
GRAPH `iri(?:srcgraph)`
{
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o .
}
} LIMIT 5 ) do
{
use_the_value("s");
}};
In both cases no iteration is performed, despite the same query, when
executed in the SPARQL endpoint, returns a result.
If I remove the reference to the graph the iterations are executed:
create procedure R2RML.DBA.try() returns integer{
for (sparql define input:storage ""
select ?s ?p
where {
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o .
} LIMIT 5 ) do
{
use_the_value("s");
}};
I am using the following Virtuoso Open Source Version
Virtuoso Open Source Edition (Column Store) (multi threaded)
Version 7.2.4.2.3217-pthreads as of Feb 3 2017
Compiled for Linux (x86_64-unknown-linux-gnu)
Has anybody an idea of what I get wrong?
Thanks!
Cheers
Beppe
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users