sparql - Copy a Sesame repository into a new one -


i'd copy data existing sesame repository new one. need migration use owl-inferencing on triplestore not possible using owlim in in memory repository (the type of existing repository).

what efficient way copy triples repository new one?

update 1:

i'm curious understand why using sparql insert cannot valid approach. tried code under sparql update section of new repository:

prefix : <http://dbpedia.org/resource/> insert{?s ?p ?o}   {  service <http://my.ip.ad.here:8080/openrdf-workbench/repositories/rep_name> {  ?s ?p ?o  }  } 

i following error:

org.openrdf.query.updateexecutionexception: org.openrdf.sail.sailexception: org.openrdf.query.queryevaluationexception: 

is there error in query or can data not inserted way? i've inserted data dbpedia using queries of similar structure.

manually (workbench)

  1. open repository want copy from.
  2. select 'export'.
  3. choose suitable export format ('trig' or 'binaryrdf' choices these both preserve context information), , hit 'download' button save data export local disk.
  4. open repository want copy to.
  5. select 'add'.
  6. choose 'select file containing rdf data wish upload'
  7. click 'browse' find data export file on local disk.
  8. make sure 'use base uri context identifier' not selected.
  9. hit 'upload', , sit back.

programmatically

first, open repositoryconnnections both repositories:

repositoryconnection source = sourcerepo.getconnection(); repositoryconnection target = targetrepo.getconnection(); 

then, read statements source , insert target:

target.add(source.getstatements(null, null, null, true));  

either basic method should work fine repository several million triples in size. of course there plenty of more advanced methods larger bulk sizes.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -