【问题标题】:Jena Fuseki Sparlql INSERT and DELETE in javaJena Fuseki Sparlql 在 java 中的 INSERT 和 DELETE
【发布时间】:2016-02-28 00:42:06
【问题描述】:

我正在使用 apache jena sparql api 使用 uri 与远程 jena fuseki 服务器通信,如 uri:http://localhost:3030/Test。除了选择之外,我还想执行 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
    }

【问题讨论】:

    标签: java insert sparql jena apache-jena


    【解决方案1】:

    SPARQL 查询和 SPARQL 更新是不同的语言

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

    端点不会是“http://localhost:3030/Test”——更可能是“http://localhost:3030/Test/update”。查询服务是 /Test/query 虽然通常直接在数据集上工作。

    【讨论】:

      猜你喜欢
      • 2023-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-02
      • 1970-01-01
      • 2020-02-19
      • 2020-06-15
      • 1970-01-01
      相关资源
      最近更新 更多