Jena Fuseki-使用汇编器文件远程创建数据集

时间:2019-04-19 20:24:05

标签: java jena fuseki

我正在运行Fuseki服务器,并且可以通过在@prefix : <http://base/#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix fuseki: <http://jena.apache.org/fuseki#> . :service_tdb_all a fuseki:Service ; rdfs:label "TDB dds" ; fuseki:dataset :tdb_dataset_readwrite ; fuseki:name "dds" ; fuseki:serviceQuery "query" , "sparql" ; fuseki:serviceReadGraphStore "get" ; fuseki:serviceReadWriteGraphStore "data" ; fuseki:serviceUpdate "update" ; fuseki:serviceUpload "upload" . :tdb_dataset_readwrite a tdb:DatasetTDB; tdb:unionDefaultGraph true. 上执行HTTP POST请求来创建新的数据集。我现在正尝试使用描述服务的汇编文件来做到这一点。

汇编器文件:

URL url = new URL(<path-to-graphstore>?dbType=tdb&dbName=<name>);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setRequestMethod("POST");
con.addRequestProperty("Authorization", this.auth);
con.addRequestProperty("Content-type", "application/octet-stream");
con.connect();

OutputStream os = con.getOutputStream();
File file = new File(<path-to-assembler>);
byte[] fileContent = Files.readAllBytes(file.toPath());
os.write(fileContent);

con.disconnect();

代码:

.wrapper {
  background: linear-gradient(#222, #222), 
              linear-gradient(to right, red, purple);
  background-origin: padding-box, border-box;
  background-repeat: no-repeat; /* this is important */
  border: 5px solid transparent;
}

但是当我在localhost中检查创建的数据集时,它具有默认的汇编器文件。我只希望能够在查询SPARQL端点时将所有命名的图合并到默认图。有任何想法吗?谢谢。

0 个答案:

没有答案