I need to write a SPARQL query to get movies from dbpedia. I have wrote almost all the query but I have this problem:
I have all of these titles, and they have to give me the same wikipedia resource:
Target Wikipedia: http://en.wikipedia.org/wiki/Spider-Man_(film)
I would want a sparql query that let me find the same Wikipedia resource searching by title
Moreover, is there a way to get also the "relevancy" of each result?
try this, it should return either the original page or any other page that redirects to the main page:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?s WHERE {
{
?s rdfs:label "Spider-man"@en .
}
UNION
{
?altName rdfs:label "Spider-man"@en ;
dbo:wikiPageRedirects ?s .
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With