简体   繁体   English

针对Jena数据集的默认图形的SPARQL查询

[英]SPARQL Query against default graph of Jena dataset

In thingweb-repository in file ThingDescriptionCollectionHandler.java on line 173: 在第173行的ThingDescriptionCollectionHandler.java文件中的thingweb-repository中:

tdb = dataset.getDefaultModel();
tdb.createResource(resourceUri.toString()).addProperty(DC.source, data);

Question: I am trying to write a SPARQL query to run against the default graph of a dataset to check if the data is present and return that data resourceUri from the graph. 问题:我正在尝试编写SPARQL查询以针对数据集的默认图运行,以检查数据是否存在并从图中返回该数据resourceUri。

I tried to follow different tutorials of writing a SPARQL query but did not succeed so far. 我尝试按照编写SPARQL查询的不同教程但到目前为止没有成功。 Any suggestion how to write a query against dataset default graph and which parameters are there in Jena RDF Dataset that can be queried? 有关如何针对数据集默认图编写查询以及Jena RDF Dataset中哪些参数可以查询的建议?

I think you want something like: 我想你想要的东西:

SELECT ?s ?p ?o
WHERE {GRAPH <urn:x-arq:DefaultGraph> { ?s ?p ?o.} }

You should take a look at this part of the docs. 你应该看一下这部分文档。 Jena special graph names 耶拿特殊的图形名称

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

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