use of org.apache.jena.sparql.exec.http.GSP in project jena by apache.
the class ExModification01 method exampleMod.
private static void exampleMod() {
AtomicLong counter = new AtomicLong(0);
HttpRequestModifier modifier = (params, headers) -> {
long x = counter.incrementAndGet();
headers.put("X-Tracker", "Call=" + x);
};
RegistryRequestModifier.get().addPrefix(serverURL, modifier);
// RegistryRequestModifier.get().add(dataURL, modifier);
// GSP : NO MODIFICATION no call to modifyByService
// GSP : calls HttpRDF
// Pass in request or at least request type.
/*
org.apache.jena.http.sys.RegistryRequestModifier.get()
auth.examples.ExModification01.exampleMod()
org.apache.jena.http.HttpLib.modifyByService(String, Context, Params, Map<String, String>)
org.apache.jena.sparql.exec.http.UpdateExecHTTP.execute()
org.apache.jena.sparql.exec.http.QueryExecHTTP.query(String)
==> SERVICE via QueryExecHTTP
==> GSP ?
org.apache.jena.sparql.exec.http.TestService.runWithModifier(String, HttpRequestModifier, Runnable)
*/
GSP.service(dataURL).defaultGraph().GET();
try (RDFLink link = RDFLinkHTTP.service(dataURL).build()) {
boolean b = link.queryAsk("ASK{}");
}
}
Aggregations