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)
- open repository want copy from.
- select 'export'.
- choose suitable export format ('trig' or 'binaryrdf' choices these both preserve context information), , hit 'download' button save data export local disk.
- open repository want copy to.
- select 'add'.
- choose 'select file containing rdf data wish upload'
- click 'browse' find data export file on local disk.
- make sure 'use base uri context identifier' not selected.
- hit 'upload', , sit back.
programmatically
first, open repositoryconnnection
s 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
Post a Comment