Linked Open Data DBpedia practical

authored by Frank Lynam at 01/12/2014 16:38:44


Ask DBpedia how many universities are in each country in the world.


  1. Go to DBpedia’s SPARQL endpoint at
  2. If the main SPARQL endpoint is down for some reason, go to
  3. Enter the following query:

#Get a count of universities per country from DBPedia
PREFIX rdf: <>
PREFIX dbpedia: <>
PREFIX dbpedia-owl: <>
SELECT ?country COUNT(?uni) AS ?uniCount WHERE { ?uni rdf:type dbpedia-owl:University . ?uni dbpedia:country ?country } GROUP BY ?country
  1. Read through and make sure that you understand the logic of the query.
  2. Choose an output format. What is the difference between the options?
  3. Click <Run Query> to run the query.
  4. Navigate the data if viewing as HTML.
  5. Why are some entries URIs and some text?
  6. Enter the following query:

#Get an overview of the predicates associated with the dbpedia-owl:University type
PREFIX rdf: <>
PREFIX dbpedia: <>
PREFIX dbpedia-owl: <>
DESCRIBE ?uni WHERE { ?uni rdf:type dbpedia-owl:University } LIMIT 1
  1. What do you think this query is asking?

Further work

Get the geo-coordinates for all of the universities hosted by DBpedia.