Wikidata Query

From Wikimedia Belgium
Jump to navigation Jump to search

Wikidata Query allows you to search in the Wikidata database.

Missing Labels[edit]

With Wikidata it frequently happens that labels are missing for certain languages.

With Wikidata Query and QuickStatements you can create labels in other languages. This increases knowledge sharing amongst languages. It invites other languages to document "foreign" items. Then descriptions can be added for each of the newly created items.

Example: imagine that you want to create missing lables for Belgian persons.

SELECT ?item ?itemLabel ?itemDescription WHERE {
 ?item wdt:P31 wd:Q5.
 ?item wdt:P27 wd:Q31.

 SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,pt,es,no". }
 FILTER(NOT EXISTS {
   ?item rdfs:label ?lang_label.
   FILTER(LANG(?lang_label) = "nl")
 })
}
ORDER BY ?itemLabel
  • Download the results.
  • Generate a QuickStatements transaction file, e.g. using Excel
  • Now you can automatically create labels.

Tip: Use the Lxx command

Missing Descriptions[edit]

SELECT ?item ?itemLabel ?sexLabel ?beroepLabel ?domainLabel ?ambtLabel ?itemDescription WHERE {
  ?item wdt:P31 wd:Q5.
  ?item wdt:P27 wd:Q31.
optional{ ?item wdt:P21 ?sex.}
optional{ ?item wdt:P106 ?beroep.}
optional{ ?item wdt:P101 ?domain.}
optional{ ?item wdt:P39 ?ambt.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl,fr,en,de,pt,es,no". }
  FILTER(NOT EXISTS {
    ?item schema:description ?itemdesc.
    FILTER(LANG(?itemdesc) = "nl")
  })
}
order by ?itemLabel

Tip: Use the Dxx command

External links[edit]