2

I'm trying to list all the cities in Denmark from Wikipedia/dbpedia by using SPARQL.

I've tried a lot of things and I can't get it to work. This is what I have come up with:

SELECT *
WHERE
{
    <http://dbpedia.org/resource/List_of_cities_in_Denmark_by_population> <http://dbpedia.org/ontology/PopulatedPlace>  ?city                  
}

Any suggestions or ideas? Anyone know how to find out which entities are present in a wikipedia article?

This is a school assignment, so I'm just looking for advice or guidance, not a complete solution. Here's a good site for doing the queries.

Sane
  • 574
  • 1
  • 6
  • 15

1 Answers1

2

The query you have will probably be limited to the cities for which dbpedia knows the population. This one might be better:

select ?s where { 
?s a <http://dbpedia.org/class/yago/CitiesAndTownsInDenmark>
}

It returns 318 entities.

Manuel Salvadores
  • 15,398
  • 4
  • 33
  • 56