use of org.apache.jena.sparql.modify.UpdateSink in project jena by apache.
the class UpdateAction method parseExecute.
/**
* Parse update operations into a GraphStore by parsing from an InputStream.
* @param usingList A list of USING or USING NAMED statements that be added to all {@link UpdateWithUsing} queries
* @param dataset The dataset to apply the changes to
* @param input The source of the update request (must be UTF-8).
* @param inputBinding Initial binding to be applied to Update operations that can apply an initial binding
* (i.e. UpdateDeleteWhere, UpdateModify). May be <code>null</code>
* @param baseURI The base URI for resolving relative URIs (may be <code>null</code>)
* @param syntax The update language syntax
*/
public static void parseExecute(UsingList usingList, DatasetGraph dataset, InputStream input, Binding inputBinding, String baseURI, Syntax syntax) {
UpdateProcessorStreaming uProc = UpdateExecutionFactory.createStreaming(dataset, inputBinding);
if (uProc == null)
throw new ARQException("No suitable update procesors are registered/able to execute your updates");
uProc.startRequest();
try {
UpdateSink sink = new UsingUpdateSink(uProc.getUpdateSink(), usingList);
try {
UpdateParser parser = UpdateFactory.setupParser(sink.getPrologue(), baseURI, syntax);
parser.parse(sink, input);
} finally {
sink.close();
}
} finally {
uProc.finishRequest();
}
}
use of org.apache.jena.sparql.modify.UpdateSink in project jena by apache.
the class UpdateFactory method make.
/** Append update operations to a request */
private static void make(UpdateRequest request, UsingList usingList, InputStream input, String baseURI, Syntax syntax) {
UpdateParser parser = setupParser(request, baseURI, syntax);
UpdateSink sink = new UsingUpdateSink(new UpdateRequestSink(request), usingList);
try {
parser.parse(sink, input);
} finally {
sink.close();
}
}
Aggregations