I would use a TDB baked Fuseki.
The code to do this is not more complex than what you use.

First, the data can resist to a power shudown.
Second, it is easy to obtain a dump, by the utility program
tdb.tdbdump
or by an HTTP service that triggers the dump without having to stop the
server.


2018-07-04 16:04 GMT+02:00 jena melina <jena.melin...@gmail.com>:

> hello ,
>
> I'm using fuseki server (in-memory ) to manipulate RDF data
> And i don't use any TDB backend. My question is how to save modification
> that i do using sparql update ?
>
> 1/ if I need to write the data back to disk , how can 'i do it ?
> 2/ if i need to connect my Fuseki to a TDB  how can 'i do it  ?
>
> To upload tata into fuseki server i use :
>
> public static void uploadRDF(String rdf, String serviceURI) {
>
>     Model m = ModelFactory.createDefaultModel();
>     m.read(Insert.class.getResource("/" + rdf).getFile(), "RDF/XML");
>     // upload the resulting model
>     DatasetAccessor accessor = DatasetAccessorFactory.
> createHTTP(serviceURI);
>     accessor.putModel(m);
>
>
> }
>
> and to query my Data i use :
>
> public static ResultSet execSelectAndPrintquery(String serviceURI,
> String query) {
>     QueryExecution q = QueryExecutionFactory.sparqlService(serviceURI,
>             Constants.SPARQL_PREFIX+query);
>
>     ResultSet  results = q.execSelect();
>     ResultSetFormatter.out(System.out, results);
>     return results;
> }
>
> and to update data i use :
>
> public static void performUpdate (    String updateCommand,String
> datasetUrl) {
>     String id = UUID.randomUUID().toString();
>     System.out.println(String.format("Adding %s", id));
>     UpdateProcessor upp =
> UpdateExecutionFactory.createRemote(UpdateFactory.create(String.format(
> EngineConstants.SPARQL_PREFIX+updateCommand
>  , id)),datasetUrl );
>     upp.execute();
> }
>
>
> And i need to save all modifications , so ho can i do it ?
>
> thanks for your help ..
>



-- 
Jean-Marc Vanel
http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
<http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
Rule-based programming, Semantic Web
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui

Reply via email to