简体   繁体   English

提供的URI,SPARQL查询以查找标签和类型

[英]provided URIs, a SPARQL query to find labels and types

I have many DBpedia URIs I want to find the label and the type of these URIs. 我想查找许多DBpedia URI的标签和类型。 When I say type, I mean a relation that tells me that a specific URI refers to Apple the company while the other URI refers to Apple the fruit. 当我说类型时,我的意思是告诉我一个特定的URI指苹果公司,而另一个URI指苹果水果。 Can any one help me to make a SPARQL query that after given a URI, it can find the label and type. 有人可以帮我做一个SPARQL查询吗,在给定URI之后,它可以找到标签和类型。

I hope it is clear. 我希望这很清楚。

learn SPARQL. 学习SPARQL。 its not difficult as it looks 它看起来并不难

try this query 试试这个查询

replace my uri with the uri of apple change the value of prefix with the prefix you are using 用苹果的uri替换我的uri用您正在使用的前缀更改前缀的值

PREFIX pref: <http://xyz/abc#> 
SELECT ?s ?label ?type 
WHERE {
   ?s ?p ?o .
   FILTER (str(?s) = 'myURI').
   ?s pref:label ?label .
   ?s pref:type ?type
}

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

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