Durable DBpedia search by name

I need to write a SPARQL query to get movies from dbpedia. I wrote almost the entire query, but I have this problem:

I have all these names and they should give me the same wikipedia resource:

  • Spider man
  • Spiderman
  • Movie: Spider-Man
  • Spiderman 1
  • Spider-Man: The Beginning

Target Wikipedia: http://en.wikipedia.org/wiki/Spider-Man_(film )

I need a sparql query that will let me find the same Wikipedia resource by name

Furthermore, is there a way to get the β€œrelevance” of each result as well?

+4
source share
2 answers

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 . } } 
+3
source

Is it possible to show the request?

for text search, if you are using the official dbpedia endpoint, you can probably use virtuoso text search tools.

see here: http://dbpedia.aksw.org/dbpedia_demo/dbpedia/tutorials/ranked_keyword_search/demo.php

0
source

All Articles