Wikidata:WikiProject University of Virginia/gaps in data
Event details | |
---|---|
Date: | Monday 4 June 2023 |
Time | 9-10am |
Where: | Elliewood conference room |
Slides | Gaps in general reference data |
. |
Gaps in general reference data is an overview of the coverage in some popular data sets. Using Wikidata as a starting point, we will review art at museums, university research, and news events. Attendees will gain new perspectives on structured versus unstructured data, intentional data sharing, and who contributes to the global media ecosystem.
Program edit
- 0:00-0:05 - Welcome
- 0:05-0:30 - Data Gaps
- 0:30-1:00 - Wiki workshop
- 1:00-1:20 - Show and tell
- 1:20-1:30 - Thanks! You can edit wiki anytime
Lists of queries edit
Queries edit
Largest city with a female mayor edit
#Largest cities with female mayor
#added before 2016-10
#TEMPLATE={"template":"Largest ?c with ?sex head of government","variables":{"?sex":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q48264 . } "},"?c":{"query":"SELECT DISTINCT ?id WHERE { ?c wdt:P31 ?id. ?c p:P6 ?mayor. }"} } }
SELECT DISTINCT ?city ?cityLabel ?mayor ?mayorLabel
WHERE
{
BIND(wd:Q6581072 AS ?sex)
BIND(wd:Q515 AS ?c)
?city wdt:P31/wdt:P279* ?c . # find instances of subclasses of city
?city p:P6 ?statement . # with a P6 (head of goverment) statement
?statement ps:P6 ?mayor . # ... that has the value ?mayor
?mayor wdt:P21 ?sex . # ... where the ?mayor has P21 (sex or gender) female
FILTER NOT EXISTS { ?statement pq:P582 ?x } # ... but the statement has no P582 (end date) qualifier
# Now select the population value of the ?city
# (wdt: properties use only statements of "preferred" rank if any, usually meaning "current population")
?city wdt:P1082 ?population .
# Optionally, find English labels for city and mayor:
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
}
}
ORDER BY DESC(?population)
LIMIT 10
List of milkmaids edit
SELECT ?item ?itemLabel (GROUP_CONCAT(?country; SEPARATOR = ", ") as ?countries) ?itemDescription {
?item wdt:P106 wd:Q1934482 ; wdt:P27 [rdfs:label ?country] FILTER(LANG(?country) = "en")
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,ru,uk". }
} GROUP BY ?item ?itemLabel ?itemDescription
Map of hospitals edit
#defaultView:Map
SELECT distinct * WHERE {
?item wdt:P31/wdt:P279* wd:Q16917;
wdt:P625 ?geo .
}
Most famous child of a librarian edit
#Children of librarians with the most number of sitelinks (as a proxy for fame)
SELECT ?person ?personLabel ?parentLabel ?linkcount WHERE {
?parent wdt:P106 wd:Q182436 .
?parent wdt:P40 ?person .
?person wikibase:sitelinks ?linkcount .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,de,es,ar,fr" }
}
GROUP BY ?linkcount ?person ?personLabel ?parent ?parentLabel
ORDER BY DESC(?linkcount)
Humans born in China edit
#title: Humans born in China
select distinct ?item ?itemLabel ?itemDescription ?sitelinks where {
?item wdt:P31 wd:Q5; # Any instance of a human.
wdt:P19/wdt:P131* wd:Q60; # Who was born in any value (eg. a hospital)
# that has the property of 'administrative area of' New York City or New York City itself.
wikibase:sitelinks ?sitelinks.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,nl" }
}
ORDER BY DESC(?sitelinks)
Candidates for the Dutch general election in 2017 edit
SELECT ?item ?itemLabel ?twitter ?LinkedIN ?politieke_partij ?politieke_partijLabel ?positie_op_lijst
WHERE {
?item p:P3602 ?node .
OPTIONAL { ?item wdt:P2002 ?twitter }
OPTIONAL { ?item wdt:P2035 ?LinkedIN }
?node ps:P3602 wd:Q16061881 .
OPTIONAL { ?node pq:P1545 ?positie_op_lijst }
OPTIONAL { ?node pq:P1268 ?politieke_partij }
OPTIONAL { ?node pq:P2035 ?LinkedIN }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl" }
}
All museums (including subclass of museum) in Washington, D.C. with coordinates edit
#defaultView:Map
SELECT DISTINCT ?item ?name ?coord ?lat ?lon
WHERE {
hint:Query hint:optimizer "None" .
?item wdt:P131* wd:Q61 .
?item wdt:P31/wdt:P279* wd:Q33506 .
?item wdt:P625 ?coord .
?item p:P625 ?coordinate .
?coordinate psv:P625 ?coordinate_node .
?coordinate_node wikibase:geoLatitude ?lat .
?coordinate_node wikibase:geoLongitude ?lon .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?item rdfs:label ?name
}
}
ORDER BY ASC (?name)
Famous nonbinary people edit
#title:Famous nonbinary people
#defaultView:ImageGrid
SELECT
?item ?itemLabel
(SAMPLE(?pic) as ?sample_pic)
?sitelinks
WHERE
{
?item wdt:P18 ?pic .
?item wikibase:sitelinks ?sitelinks .
?item wdt:P21 wd:Q48270.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language
}
GROUP BY
?item ?itemLabel
?sitelinks
ORDER BY
DESC(?sitelinks)
Contact edit
- Lane Rasberry (user:bluerasberry)