use of org.apache.jena.sparql.modify.request.UpdateLoad in project jena by apache.
the class UpdateProgrammatic method main.
public static void main(String[] args) {
Dataset dataset = DatasetFactory.createTxnMem();
UpdateRequest request = UpdateFactory.create();
request.add(new UpdateDrop(Target.ALL));
request.add(new UpdateCreate("http://example/g2"));
request.add(new UpdateLoad("file:etc/update-data.ttl", "http://example/g2"));
UpdateAction.execute(request, dataset);
System.out.println("# Debug format");
SSE.write(dataset);
System.out.println();
System.out.println("# N-Quads: S P O G");
RDFDataMgr.write(System.out, dataset, Lang.NQUADS);
}
use of org.apache.jena.sparql.modify.request.UpdateLoad in project jena by apache.
the class load method execUpdate.
@Override
protected void execUpdate(DatasetGraph graphStore) {
if (loadFiles.size() == 0)
throw new CmdException("Nothing to do");
UpdateRequest req = new UpdateRequest();
for (String filename : loadFiles) {
UpdateLoad loadReq = new UpdateLoad(filename, graphName);
req.add(loadReq);
}
if (true) {
// Need a better way
monitor(graphStore.getDefaultGraph());
for (Iterator<Node> iter = graphStore.listGraphNodes(); iter.hasNext(); ) {
Graph g = graphStore.getGraph(iter.next());
monitor(g);
}
}
UpdateExecutionFactory.create(req, graphStore).execute();
if (dump) {
IndentedWriter out = IndentedWriter.stdout;
SSE.write(graphStore);
out.flush();
}
}
Aggregations