I want to write a sparql query to return the WikiPageRedirects attribute for a given dbpedia resource.
For example: MongoDB has 3 as depicted here https://dbpedia.org/page/MongoDB
I write this query to get them:
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?alias
WHERE {
VALUES (?resource) { (dbo:MongoDB) }
?resource dbo:wikiPageRedirects ?alias .
}
but it does not display anything sparql
There are two issues involved:
The URI of the the resource MongoDB is not
dbo:MongoDB(→http://dbpedia.org/ontology/MongoDB), butdbr:MongoDB(→http://dbpedia.org/resource/MongoDB).The property
dbo:wikiPageRedirectshas to be used in the other direction. On the linked MongoDB page, this is indicated by the "is … of" ("isdbo:wikiPageRedirectsof").So your query could be:
or: