繁体   English   中英

Jena Fuseki Sparlql在Java中插入和删除

[英]Jena Fuseki Sparlql INSERT and DELETE in java

我正在使用uri像uri中一样使用apache jena sparql api与远程jena fuseki服务器进行通信: http:// localhost:3030 / Test 除了select之外,我还希望对sparql进行插入和删除查询。 这是我选择查询的代码:

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查询和SPARQL更新是不同的语言

使用UpdateExecutionFactory创建SPARQL更新的执行。

端点将不是“ http:// localhost:3030 / Test ”-更有可能是“ http:// localhost:3030 / Test / update ”。 查询服务是/ Test / query,尽管直接在数据集上通常可以使用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM