Search code examples
sparqldbpedia

dbpedia SPARQL query for finding artist properties


I'm trying to get details about an artist via DBPedia and the SPARQL query language, however, it seems almost impossible (with my understanding) of how to get certain pieces of information.

I'm trying to get an Artist and pull information such as their Hometown. I'm guessing the query should be something similar to that of:

SELECT ?c WHERE {
  ?b <http://dbpedia.org/property/Artist> <http://dbpedia.org/resource/Arctic_Monkeys>.
  ?b <http://www.w3.org/2002/07/owl#ObjectProperty> <http://dbpedia.org/ontology/hometown>.
  ?b rdfs:label ?c.
}

If anyone could enlighten me to how it should be done, that would be amazing.

I've been trying out the queries at:

http://dbpedia.org/sparql


Solution

  • If you want to find the label of their hometown, try this:

    SELECT ?hometownLabel WHERE {
      <http://dbpedia.org/resource/Arctic_Monkeys> <http://dbpedia.org/ontology/hometown> ?hometown .
      ?hometown <http://www.w3.org/2000/01/rdf-schema#label> ?hometownLabel .
    }