####### HOW TO DUMP LARGE NUMBER OF TRIPLES

### CREATE GRAPH WITH SELECTED TRIPLES
### NOTE: WE HAVE TO INCREASE TransactionAfterImageLimit in virtuoso.ini (from default of 50MB to e.g., 5GB)

SPARQL INSERT 
  { 
    GRAPH <http://www.sdi4apps.eu/czech>
      {
        ?Resource ?p ?o
      }
  }
WHERE
  { 
    GRAPH  <http://www.sdi4apps.eu/poi.rdf> 
      {
  	     ?Resource a ?POI_Class .
         ?Resource ?p ?o .
  	     ?Resource <http://www.opengis.net/ont/geosparql#sfWithin> <http://dbpedia.org/resource/Czech_Republic> .
  	   
      } 
  }


#### CREATED STORED PROCEDURE FROM http://docs.openlinksw.com/virtuoso/rdfperfdumpandreloadgraphs/ 
#### BUT HAD TO FIX LINE 
#### env := VECTOR (dict_new (16000), 0, '', '', '', 0, 0, 0, 0, 0);
#### should be (or reverse)
#### env := VECTOR (dict_new (16000), 0, '', '', '', 0, 0, 0, 0);

dump_one_graph ('http://www.sdi4apps.eu/czech', './SPOI-CZ_', 1000000000);


dump_one_graph ('http://foodie-vm3.man.poznan.pl/semanticAnnotation', './semanticAnnotation_', 1000000000);
dump_one_graph ('http://marketplace.foodie-cloud.org/empty', './empty', 1000000000);
dump_one_graph ('http://www.sdi4apps.eu/poi_changes.rdf', './poi_changes', 1000000000);
dump_one_graph ('http://marketplace.foodie-cloud.org/demo', './demo', 1000000000);
log_enable(3,1);
SPARQL CLEAR GRAPH  <http://foodie-vm3.man.poznan.pl/semanticAnnotation>; 
SPARQL CLEAR GRAPH  <http://marketplace.foodie-cloud.org/empty>; 
SPARQL CLEAR GRAPH  <http://www.sdi4apps.eu/poi_changes.rdf>; 
SPARQL CLEAR GRAPH  <http://marketplace.foodie-cloud.org/demo>; 


grep -n 'rdf:type' SPOI-CZ_000001.ttl | wc -l


log_enable(3,1);
SPARQL CLEAR GRAPH  <http://www.sdi4apps.eu/czech>;

TOTAL TRIPLES: 3778964
TOTAL INSTANCES: 262926


#### LOAD CZECH FOR TESTS

./virtuoso/bin/isql 1111 dba Virtu0s0 exec="ld_dir ('/home/virtuoso/data_hslayers', 'SPOI-CZ_000001.ttl', 'http://www.sdi4apps.eu/poi/czech');" 
./virtuoso/bin/isql 1111 dba Virtu0s0 exec="delete from db.dba.load_list where ll_graph='http://www.sdi4apps.eu/poi/czech';"
./virtuoso/bin/isql 1111 dba Virtu0s0 exec="select * from DB.DBA.load_list where ll_graph='http://www.sdi4apps.eu/poi/czech';"
