Wikidata:Tools/inteGraality

From Wikidata
Jump to navigation Jump to search

integraality is a tool to create dashboards of property coverage for a given part of Wikidata.

The dashboard are configured using the {{Property dashboard}} template, and a bot will then update it − every week or on demand.

Usage[edit]

Premise[edit]

Outcomes[edit]

Advanced usage[edit]

Advanced selection[edit]

The selector_sparql can be used in the most straightforward way (like -instance of (P31)painting (Q3305213)), but you can also make more advanced selection. Some examples:

Display the flag of a country[edit]

You can (ab)use the higher-grouping mechanism to display the flag image (P41) of a country-grouping: |higher_grouping=wdt:P41 (example)

Advanced grouping[edit]

On the face of it, the grouping parameter just takes the name of a property, eg `P475`. However as this is used to construct SPARQL queries, you can inject additional SPARQL to achieve creative things.

Using one-property above for grouping[edit]

Example: User:Multichill/Windmill_sandbox − using |grouping_property=wdt:P131/wdt:P131 allows to group the windmills one administrative entity above.

Using two properties as alternative groupings[edit]

Example: WikiProject Music/Statistics/Albums by country of performer − the performer (P175) of an album can be a person (the country is then country of citizenship (P27)) or a musical group (country is country of origin (P495))

You can inject the | SPARQL “OR” operator − but it must be escaped with {{!}}: |grouping_property=P175/(wdt:P495{{!}}wdt:P27)

Restrict the groupings[edit]

You can limit the domain of the groupings by adding a SPARQL condition − using a reverse path expression so that the final query is still valid: |grouping_property=P39 ?grouping . wd:Q16707842 ^wdt:P279

Using a qualifier for grouping[edit]

Let’s take the example of member of the Chamber of Deputies of the Italian Republic, whose office is modeled as:

position held
Normal rank member of the Chamber of Deputies of the Italian Republic (Q18558478)
parliamentary term 17th Legislature of Italy (Q5487948)
electoral district constituency of Lombardie 2 (1993-2017)
start time 5 March 2013
0 references
add reference


add value

You can group per parliamentary term (P2937) using this expression: |grouping_property=P39 wd:Q18558478 ; p:P39 ?pstmt. ?pstmt ps:P39 wd:Q18558478 ; pq:P2937

Advanced description[edit]

Describing on a qualifier[edit]

The properties (aka columns) parameter has support not only for properties, but also qualifier:

See also[edit]