Wikidata:Tools/inteGraality
inteGraality is a tool for querying Wikidata by creating a dashboard of property values for a specific set of items.
The dashboard is configured using the {{Property dashboard}}
template, and a bot will then update it − every week or on demand.
Usefulness
[edit]When inspected, the display of the queried Wikidata creates room for more data-driven questions that, when further analyzed, would provide valuable insights into the questioned areas and reveal data inaccuracies.
Usage
[edit]Premise
[edit]- Select a subset of Wikidata
- all album (Q482994), all red panda (Q41960), all painting (Q3305213), all British MPs…
- slice it along a dimension (ie, a property)
- red pandas by residence (P551), paintings by collection (P195), albums by genre, language, year…, camera models by manufacturer (P176)
- optionally group the slices along a higher dimension
- the country of the collections of the paintings, the country of the residence of the red pandas, the continent of the country of the lighthouses
- choose how the subset should be described: properties, labels, descriptions
Outcomes
[edit]- Surface errors of grouping
- 5 albums published in 1849
- Identify patterns
- Most Russian rock (Q2624785) albums are missing a producer (P162) ; all paintings in the Condé Museum (Q1236032) collection have an image (P18)…
- Work on completion piece-meal − a given property for a given grouping
- Work only on the Rijksmuseum paintings missing a title (P1476), on the Dreamcast video games missing a genre, etc.
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:
- Humans with National Library of Wales Authority ID (P2966):
|selector_sparql=wdt:P9495 []; wdt:P31 wd:Q5
- Alumnis of two related universities:
|selector_sparql=wdt:P69 ?edu . VALUES ?edu { wd:Q309350 wd:Q6806876 } .
- British MPs:
|selector_sparql=p:P39 [ ps:P39 [ wdt:P279 wd:Q18018860 ] ]
- Collection highlights National Library of the Netherlands:
|selector_sparql= wdt:P195 wd:Q1526131; p:P195 [ ps:P195 ?id ; pq:P2868 wd:Q29188408 ]
- Editions with a sitelink to French Wikisource:
|selector_sparql=wdt:P31 wd:Q3331189. ?sitelink schema:about ?entity; schema:isPartOf <https://fr.wikisource.org/>
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 |
| ||||||||||||||||
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:
P39/Q18558478/P580
will check if the relevant position held (P39) statement has a start time (P580) qualifier − -position held (P39)member of the Chamber of Deputies of the Italian Republic (Q18558478)start time (P580)xyz (example)
See also
[edit]- wikitech:Tool:InteGraality
- The Wikipedia Workbook for Cultural Institutions (2024) has a user guide for inteGraality starting on page 42. (see phab:T376902)