Wikidata: the open knowledge database

3rd January 2021 at 12:22am

Wikidata is a free knowledge database that has more than 90 million items.

You can query it using sparql (SQL-like) language. For example, a query to find rock bands that start with "M":

# P31 is for 'instance of'
# Q5741069 is for 'rock group'
SELECT DISTINCT ?band ?bandLabel
  ?band wdt:P31 wd:Q5741069 .
  ?band rdfs:label ?bandLabel .
  FILTER(STRSTARTS(?bandLabel, 'M')) .

Another one to find the capital of France:

# Q6256 is for 'country'
# P36 is for 'capital'
SELECT DISTINCT ?country ?countryLabel ?capital WHERE {
  ?country wdt:P31 wd:Q6256 .
  ?country rdfs:label ?countryLabel .
  ?country wdt:P36 ?capital .
  FILTER(STR(?countryLabel) = "France")

Related to

Backlinks: Archive 22/03/2021, Semantic MediaWiki is a free form database