[英]Jena Fuseki Sparlql INSERT and DELETE in java
I am using the apache jena sparql api to communicate with a remote jena fuseki server using the uri as in the uri: http://localhost:3030/Test . 我正在使用uri像uri中一样使用apache jena sparql api与远程jena fuseki服务器进行通信: http:// localhost:3030 / Test 。 I would like to preform sparql insert and delete queries in addition to select.
除了select之外,我还希望对sparql进行插入和删除查询。 Here is my code for select queries:
这是我选择查询的代码:
private String serviceURI = "http://localhost:3030/Test";
/**
* This method prints the result of a sparql query as table
* @param Query to get the result of
*/
public void printSparqlResult(String query){
QueryExecution q = QueryExecutionFactory.sparqlService(this.serviceURI,query);
ResultSet results = q.execSelect(); // get result-set
ResultSetFormatter.out(System.out, results); // print results
}
SPARQL Query and SPARQL Update are different languages SPARQL查询和SPARQL更新是不同的语言
Use UpdateExecutionFactory to create an execution of a SPARQL Update. 使用UpdateExecutionFactory创建SPARQL更新的执行。
The endpoint will not be " http://localhost:3030/Test " -- more likely " http://localhost:3030/Test/update ". 端点将不是“ http:// localhost:3030 / Test ”-更有可能是“ http:// localhost:3030 / Test / update ”。 The query service is /Test/query though directly on the dataset usually works.
查询服务是/ Test / query,尽管直接在数据集上通常可以使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.