Me again. :P
The Virtuoso team provided my with a script to dump all graphs. Thanks a
lot for that, guys.
Now I have a question about an extension I would like to do on the
script. I would like to exclude graphs of a certain type by using a
sparql ask query. I did the following which does not work:
create procedure dump_graphs (in dir varchar := 'dumps', in
exclude_strigi integer := 0, in exclude_ontos integer := 0, in
file_length_limit integer := 1000000000)
{
declare inx int;
inx := 1;
set isolation = 'uncommitted';
for (select * from (sparql define input:storage "" select distinct ?g
{ graph ?g { ?s ?p ?o } . filter ( ?g != virtrdf: ) } ) as sub option
(loop)) do
{
-- THIS IS THE PART I ADDED --
select (sparql define input:storage "" ask where { "g"
<http://www.strigi.org/fields#indexGraphFor> ?r . } ) into is_strigi_graph;
-----------------------------------------------
if( is_strigi_graph > 0 ) {
dump_one_graph ("g", sprintf ('%s/strigigraph%06d_', dir,
inx), file_length_limit);
}
else {
dump_one_graph ("g", sprintf ('%s/graph%06d_', dir, inx),
file_length_limit);
}
inx := inx + 1;
}
}
Thanks again,
Sebastian Trueg