简体   繁体   中英

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. 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. Can any one help me to make a SPARQL query that after given a URI, it can find the label and type.

I hope it is clear.

learn 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

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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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