我有一个SPARQL查询,如下所示,选择具有我从DBpedia定义的特定标签的主题。
SELECT ?subject WHERE { ?subject rdfs:label ?label. FILTER ( regex (?label,"^json$", "i") ) }这个对我有用。
现在我试图通过此查询检索rdf:type每个主题的rdf:type 。
SELECT ?subject ?type WHERE { ?subject rdfs:label ?label; rdf:type ?type. FILTER ( regex (?label,"^json$", "i") ) }但是我得到了一个空洞的结果。
如果用特定资源替换?subject ,它会再次起作用。
SELECT ?type WHERE { <http://dbpedia.org/resource/JSON> rdf:type ?type. }无法弄清楚会发生什么。 如何按预期获得结果?
I have a SPARQL query shown below to select subjects having specific labels I defined from DBpedia.
SELECT ?subject WHERE { ?subject rdfs:label ?label. FILTER ( regex (?label,"^json$", "i") ) }It works for me.
And now I am trying to retrieve rdf:type of each subject by this query.
SELECT ?subject ?type WHERE { ?subject rdfs:label ?label; rdf:type ?type. FILTER ( regex (?label,"^json$", "i") ) }But I get an empty result from this.
If replacing ?subject with a specific resource, it works again.
SELECT ?type WHERE { <http://dbpedia.org/resource/JSON> rdf:type ?type. }Cannot figure out what happens. How can I get results as expected?
最满意答案
从语法上讲,您的查询没有任何问题。 我想你看到DbPedia超时了。 尝试添加一个limit子句,看看是否能给你一些结果。
有关DbPedia 在网站上的合理使用政策的更多信息。
Syntactically, there's nothing wrong with your query. I think you're seeing a timeout from DbPedia. Try adding a limit clause, to see if that gives you some results.
There is more information on DbPedia's fair use policy on the web site.
更多推荐
发布评论