Could you share the script that dumps one or more graphs to file?

Could use that for our customer to export all data and modify it in a 3rd party 
tool such as Protege.

-Magnus


-----Opprinnelig melding-----
Fra: Sebastian Trueg [mailto:[email protected]]
Sendt: ma 14.12.2009 14:05
Til: Virtuoso Users
Emne: [Virtuoso-users] Question regarding a stored procedure
 
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


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to