Open main menu


Joined 31 October 2012
(Redirected from User:Waldir)

Work in progressEdit

To doEdit



Cape VerdeEdit

Scripts / gadgetsEdit

  • Auto-fill item titles (labels) with corresponding language's article title (using the same algorithm as link piping to cut out parentheticals, etc.)
  • Suggest content for unfilled descriptions, with:
    • First sentence of corresponding language's article
    • Automatic translation of description in other languages, in the order defined by translatewiki's fallback chain (should be accessible through API), ultimately falling back to English
  • Highlight (bolden) the label for the current interface language, or move it to the top


Goal: Add items for the TEDxPraia event (, TED event ID 19377) and talks

Guitar chordsEdit

Goal: model guitar chords in Wikidata.

Software dataEdit

  • Example query: free software that can read the OBJ file format -->

Unix distro manifestsEdit

I.e. the set of packages that come pre-installed with (specific versions of) Unix-like operating systems (distros)


Try replacing the table at pt:Prémio Camões#Premiados with Listeria, based on a query like this:

Useful stuffEdit


  • languages to skip on wikidata game: zh,ja,ru,uk,hu,ko,pl,tr,et,el,ar,bg,vi
  • languages to prefer on wikidata game: pt,gl,es,it,ro,fr
  • wikitext to produce a link to an item by giving one of its sitelinks: {{Item}} (there's no option for "item by label", since multiple items with the same label can't be automatically disambiguated)
  • Narrowing down search results: To search for Wikidata items by their title on a given site, use Special:ItemByTitle.

Data modelEdit


  • TABernacle: provide a list of items for the rows, and a list of properties for the columns; the tool fills up the matrix and helps identify missing data, and add it directly.
  • There are short descriptions at Wikidata:Tools/Query data and the Tools directory
  • Issues / needed improvements
    • No way to sort the table columns (e.g. to locate empty cells)
    • Should be able to auto-complete items and properties by name, like the query service does
    • image (P18) shown as a link, not as an actual image


Query building interfacesEdit


  • Neither VizQuery nor Wikidata Query Builder allow combining conditions with OR
  • Neither VizQuery nor Wikidata Query Builder allow specifying non-property conditions (number of sitelinks, label/description, ...)

REST endpointEdit


  • Introduction / general reference
  • prefixes (full list) to specify elements of a query (operators and operands):
    • wd = Wikidata entity (e.g. ___)
      • wds = Wikidata statement (e.g. ___)
      • wdv = Wikidata value (e.g. ___)
      • wdt = Wikidata property (equivalent to p + ps as shown below)
    • p = a property statement (e.g. ?item p:P123 ?prop.)
      • ps = prop/statement/ — the value of a property statement (e.g. ?item p:P123 ?prop. ?prop ps:P123 ?propValue.)
        • psv = prop/statement/value/ — the numeric value of a property as written in the statement (i.e. disregarding the unit)
        • psn = prop/statement/value-normalized/ — the numeric value of a property, normalized to the base unit of the measured quantity.
      • pq = prop/qualifier/ — a qualifier for a property statement (e.g. ?item p:P123 ?prop. ?prop pq:P456 ?propQualifier.)
        • pqv = prop/qualifier/value/ — ?
      • pr = prop/reference/ — ?
        • prv = prop/reference/value/ — ?
    • TODO: add examples above where missing
  • Query syntax cheatsheet (condensed/edited from the excellent —but awfully verbose— Wikidata:SPARQL tutorial):
    • The core structure of any query is a semantic triple (subject, predicate, object).
      The "predicate" represents the relationship between subject and object, so I'll call it "relation" to make this clearer:
      • ?subject wdt:relation wd:object.
    • The object of one triple can be the subject of another triple, which allows building more complex queries:
      • ?itemA wdt:relation1 ?itemB. ?itemB wdt:relation2 wd:itemC.
    • Use , to append another object to the previous triple, reusing both the subject and the predicate:
    • Use ; to append a predicate-object to the previous triple's subject:
      • ?subject wdt:relation1 wd:object1;
        wdt:relation2 wd:object2.
    • Use [] to "nest" a triple inside another, using a predicate-object as a way to represent an entity in the outer triple:
      • ?subject wdt:relation1 [ wdt:relation2 wd:object2 ]. (here, object1 is implied)
    • Predicates can be combined using regex-like syntax:
      • Use / to chain predicates together, to create "property paths":
        • ?nephew wdt:child/wdt:brother ?uncle.
      • Use the regex-like quantifiers *, + and ? to represent how many times a predicate appears in the query:
        • ?descendant wdt:child+ ?ancestor.
      • The two constructs above are commonly used to specify the notion "instance of X or of any subclass of X":
        • ?subject wdt:P31/wdt:P279* ?object.
      • Again, as in regex, | means OR, and () groups expressions.
    • More useful info:
      • UNION / MINUS (slide 8)
      • literal values (strings, numbers, ...)
      • comparison operators (!, &&, ||, <, =, !=, ...)
      • more predicate path operators (^, !, ...)
      • underspecified triples (e.g. two or even 3 variables)
    • Wikidata-specific helpers
      • label and description
        • Include SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
        • for a variable ?foo representing an item, that automatically binds its label to ?fooLabel, and its description to ?fooDescription

Example queriesEdit

Tools to work with scholarly worksEdit

QuickStatements referenceEdit

QuickStatements examples:



Thanks to the Wikidata Game, it will be possible to move quickly to a state where we Wikidata will have all the information needed to build automated mini-bios in the form

<label> (<place of birth, <date of birth> — <place of death>, <date of death>) was a <country of citizenship> <occupation> who <description>.

In fact, the description field for people in Wikidata should probably forgo occupation and nationality, and go straight to their claim to notability, since the former are redundant with the corresponding fields.

This proposal was originally posted here.

Related resourcesEdit