User:MartinPoulter/queries

From Wikidata
Jump to navigation Jump to search

For many more examples of these queries, see Wikidata:SPARQL query service/queries/examples and Wikidata:SPARQL_query_service/queries. For a tutorial, see User:TweetsFactsAndQueries/A Guide To WDQS. For biomedical query examples, see [1].

Also of interest: mw:Help:Extension:Kartographer

Contents

Electronic Enlightenment[edit]

See separate page

Hillforts[edit]

See separate page

Global collections[edit]

See separate page

Botanic expeditions[edit]

See separate page

From Sappho to Suffrage[edit]

See separate page

Counting stuff on Wikidata[edit]

Go to Wikidata:Statistics for counts of people, organizations, occurrences etc.

Count of scientific articles[edit]

The following query uses these:

Count of fictional characters[edit]

SELECT (COUNT(?article) AS ?count)
WHERE {
?article wdt:P31/wdt:P279* wd:Q95074
}

Try it!

Count of items with coordinate locations[edit]

SELECT (COUNT(?item) AS ?count)
WHERE { ?item wdt:P625 [] }

Try it!

Voltaire[edit]

Wikipedia articles about works[edit]

The following query uses these:

  • Properties: author (P50) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID
    1 SELECT ?work ?title ?year ?english ?french WHERE {
    2   ?work wdt:P50 wd:Q9068
    3 OPTIONAL{?work wdt:P577 ?pubdate}
    4 BIND(YEAR(?pubdate) as ?year)
    5 OPTIONAL{ ?english schema:about ?work ; schema:isPartOf <https://en.wikipedia.org/> }
    6 OPTIONAL{ ?french schema:about ?work ; schema:isPartOf <https://fr.wikipedia.org/> }
    7 #OPTIONAL{ ?german schema:about ?work ; schema:isPartOf <https://de.wikipedia.org/> }
    8 OPTIONAL{ ?work rdfs:label ?title filter(lang(?title) = "en") }
    9 }
    

Categorised timeline of works[edit]

This query was improved by Navino Evans.

The following query uses these:

  • Properties: author (P50) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, image (P18) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID
     1 SELECT ?workLabel ?pubdate ?pubdatePrecision ?image ?typelabel ?english  
     2 (URI(CONCAT("https://tools.wmflabs.org/reasonator/?q=", SUBSTR(STR(?work),32) )) as ?reasonator) #build a reasonator link
     3 (IF(BOUND(?english), ?english, ?reasonator) as ?link) # link to English Wikipedia article, if available
     4 WHERE {
     5 ?work wdt:P50 wd:Q9068; # author: Voltaire
     6    wdt:P31 ?type; # What is the work? poem, play, historical work etc.? 
     7    p:P577/psv:P577 ?pubdateStatementNode
     8 MINUS {?work wdt:P31 wd:Q3331189} # exclude editions
     9 MINUS {?work wdt:P31 wd:Q105420} # exclude anthologies
    10 ?pubdateStatementNode wikibase:timeValue ?pubdate ;
    11    wikibase:timePrecision ?pubdatePrecision # get precision of the publication date
    12 OPTIONAL {?work wdt:P18 ?image}
    13 OPTIONAL{ ?english schema:about ?work ; schema:isPartOf <https://en.wikipedia.org/> }
    14 SERVICE wikibase:label {bd:serviceParam wikibase:language "fr,en,de"} # Prefer labels in French but fall back to English and German
    15 ?type rdfs:label ?typelabel FILTER(lang(?typelabel) ="en") # English labels for the types
    16 }
    

Works ordered by how many language versions of Wikipedia have an article about them[edit]

SELECT ?work ?workLabel (COUNT(DISTINCT ?sitelink) as ?linkcount) WHERE {
  ?work wdt:P50 wd:Q9068.  # works by Voltaire
MINUS {?work wdt:P31 wd:Q39811647} # translations
MINUS {?work wdt:P31 wd:Q3331189} # editions
MINUS {?work wdt:P31 wd:Q105420} # anthologies
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,de". }
OPTIONAL{?sitelink schema:about ?work . # get Wikimedia pages about the work
FILTER(SUBSTR(str(?sitelink), 12, 14) = "wikipedia.org/")} # only Wikipedia links
} GROUP BY ?work ?workLabel ORDER BY DESC(?linkcount)

Try it!

Economics[edit]

Birthplaces of economists[edit]

On 28 April 2016:

  • 2062 found for occupation:economist
  • 4997 found for occupation:economist or field:economics
  • 4969 found for occupation:economist or field:economics minus double-counting. DISTINCT had no effect. Still some duplicate rows due to some places having multiple co-ordinates

03 June 2016:

  • 6868 results. No change in the query explains the extra couple of thousand. Just more data?

02 November 2016:

  • 8832 results.

The map was getting frustratingly slow, and sometimes timing out, so I've split it into two.

Dead[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map{"hide": ["?coord", "?layer"]}
 2 SELECT DISTINCT ?person ?name ?birthplace ?birthyear ?coord ?layer WHERE {
 3    {?person wdt:P106 wd:Q188094} UNION {?person wdt:P101 wd:Q8134} MINUS {?person wdt:P106 wd:Q188094; wdt:P101 wd:Q8134}
 4    ?person wdt:P570 ?dod;
 5      wdt:P19 ?place .
 6    ?place wdt:P625 ?coord
 7    OPTIONAL { ?person wdt:P569 ?dob }
 8    BIND(YEAR(?dob) as ?birthyear)
 9   BIND(IF( (?birthyear < 1700), "Pre-1700", IF((?birthyear < 1751), "1700-1750", IF((?birthyear < 1801), "1751-1800", IF((?birthyear < 1851), "1801-1850", IF((?birthyear < 1901), "1851-1900", IF((?birthyear < 1951), "1901-1950", "Post-1950") ) ) ) )) AS ?layer )
10 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".?person rdfs:label ?name. ?place rdfs:label ?birthplace }
11 } ORDER BY ?birthyear

Living[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map{"hide": ["?coord"]}
 2 SELECT ?coord ?birthyear ?birthplace ?name ?person WHERE {
 3    {?person wdt:P106 wd:Q188094 } UNION {?person wdt:P101 wd:Q8134} MINUS {?person wdt:P106 wd:Q188094; wdt:P101 wd:Q8134}
 4    ?person wdt:P19 ?place .
 5    ?place wdt:P625 ?coord .
 6    OPTIONAL { ?person wdt:P569 ?dob }.
 7    MINUS { ?person wdt:P570 ?dod }.
 8    BIND(YEAR(?dob) as ?birthyear).
 9 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?person rdfs:label ?name. ?place rdfs:label ?birthplace}
10 }

Economics Nobel Laureates' workplace location, with Wikipedia links[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map{"hide": ["?coord"]}
 2 SELECT ?name ?coord ?image ?workplace ?article WHERE {
 3 ?person wdt:P166 wd:Q47170 ;
 4      wdt:P108 ?place .
 5 ?place wdt:P625 ?coord
 6 OPTIONAL{ ?person wdt:P18 ?image }
 7 OPTIONAL{ ?article schema:about ?person ; schema:isPartOf <https://en.wikipedia.org/> }
 8 MINUS{ ?person wdt:P31/wdt:P279? wd:Q15632617 } # exclude fictional people
 9 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?place rdfs:label ?workplace. ?person rdfs:label ?name}
10 }

Economics Nobel Laureates' alma mater location[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map{"hide": ["?coord"]}
 2 SELECT ?name ?coord ?image ?almamater ?article WHERE {
 3 ?person wdt:P166 wd:Q47170 ;
 4         wdt:P69 ?place .
 5 ?place wdt:P625 ?coord
 6 OPTIONAL{ ?person wdt:P18 ?image }
 7 OPTIONAL{ ?article schema:about ?person ; schema:isPartOf <https://en.wikipedia.org/> }
 8 MINUS{ ?person wdt:P31/wdt:P279? wd:Q15632617 } # Exclude fictional people
 9 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?place rdfs:label ?almamater. ?person rdfs:label ?name}
10 }

Specialisms within economics and related nationalities[edit]

The following query uses these:

  • Properties: field of work (P101) View with Reasonator View with SQID, country of citizenship (P27) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
    1 SELECT ?person ?name ?field ?fieldname ?nationality WHERE {
    2    ?person wdt:P101 ?field; #?field = Q39680 for macroeconomics # Q39072 for microeconomics
    3      wdt:P27 ?place .
    4    ?field wdt:P279+ wd:Q8134 .
    5    ?person rdfs:label ?name filter (lang(?name) = "en")
    6    ?place rdfs:label ?nationality filter (lang(?nationality) = "en")
    7    ?field rdfs:label ?fieldname filter (lang(?fieldname) = "en")
    8 MINUS{ ?person wdt:P31/wdt:P279? wd:Q15632617 } # exclude fictional people
    9 } ORDER BY ASC(?fieldname)
    

Only four with field:macroeconomics One with field:microeconomics

Economists with a Project Gutenberg ID and optionally an English Wikisource profile[edit]

The following query uses these:

  • Properties: occupation (P106) View with Reasonator View with SQID, Project Gutenberg author ID (P1938) View with Reasonator View with SQID, date of death (P570) View with Reasonator View with SQID
     1 SELECT DISTINCT ?person ?name ?deathyear (URI(CONCAT("https://www.gutenberg.org/ebooks/author/", ?gutenberg_id)) AS ?gutenberg) ?enws WHERE {
     2 { ?person wdt:P106 wd:Q188094 }
     3 UNION
     4 { ?person wd:P101 wd:Q8134 }
     5 ?person wdt:P1938 ?gutenberg_id
     6 OPTIONAL { ?person wdt:P570 ?death }
     7 BIND(YEAR(?death) AS ?deathyear)
     8 OPTIONAL {
     9   ?enws schema:about ?person ;
    10   schema:isPartOf <https://en.wikisource.org/>
    11 }
    12 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?person rdfs:label ?name }
    13 }
    14 ORDER BY ?deathyear
    

Economics awards and their recipients, by year[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, award received (P166) View with Reasonator View with SQID, point in time (P585) View with Reasonator View with SQID
    1 SELECT DISTINCT ?person ?personLabel ?award ?awardLabel ?year WHERE {
    2   ?person p:P166 ?statement.
    3   ?statement ps:P166 ?award.
    4   ?award wdt:P31 wd:Q17701409 
    5   OPTIONAL { ?statement pq:P585 ?date. BIND(YEAR(?date) AS ?year) }
    6 MINUS{ ?person wdt:P31/wdt:P279? wd:Q15632617 } # exclude fictional people
    7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 } ORDER BY ASC(?awardLabel) ASC(?year)
    

Winners of multiple economics awards[edit]

The following query uses these:

  • Properties: award received (P166) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
    1 SELECT DISTINCT ?person ?personLabel (COUNT(?award) AS ?awards) (GROUP_CONCAT(?awardLabel; separator=", ") as ?list) WHERE {
    2   ?person wdt:P166 ?award.
    3   ?award wdt:P31 wd:Q17701409 
    4 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?award rdfs:label ?awardLabel . ?person rdfs:label ?personLabel }
    5 } GROUP BY ?person ?personLabel
    6 HAVING ( ?awards > 1 )
    7 ORDER BY DESC(?awards)
    

People who won economics awards but are not listed as economists[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, occupation (P106) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, award received (P166) View with Reasonator View with SQID, point in time (P585) View with Reasonator View with SQID
    1 SELECT DISTINCT ?person ?personLabel ?award ?awardLabel ?year WHERE {
    2   ?person p:P166 ?statement.
    3   ?statement ps:P166 ?award.
    4   ?award wdt:P31 wd:Q17701409 
    5   MINUS { ?person wdt:P106 wd:Q188094 }
    6 MINUS{ ?person wdt:P31/wdt:P279? wd:Q15632617 } # exclude fictional people
    7   OPTIONAL { ?statement pq:P585 ?date. BIND(YEAR(?date) AS ?year) }
    8 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    9 } ORDER BY ASC(?awardLabel) ASC(?year)
    

Wikidata graph: fields of economics[edit]

Titles of (current) national finance ministers[edit]

The following query uses these:

University of Oxford[edit]

Colleges and Permanent Private Halls with coats of arms and official web sites[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map{"hide": ["?location"]}
 2 SELECT DISTINCT ?web ?collegeLabel (IF(BOUND(?hq), ?hq, ?coord) as ?location) ?arms WHERE {
 3   {?college wdt:P31 wd:Q2581649} UNION {?college wdt:P31 wd:Q3338504}
 4   MINUS {?college wdt:P576 []}
 5   OPTIONAL { ?college p:P159/pq:P625 ?hq }
 6   OPTIONAL { ?college wdt:P625 ?coord }
 7  ?college wdt:P94 ?arms;
 8           wdt:P856 ?web
 9   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
10 }

How many Wikidata entities were educated at the University of Oxford?[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID
    1 SELECT (COUNT(?alum) AS ?count)
    2 WHERE
    3 {
    4 	?alum wdt:P69 wd:Q34433. 
    5 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    6 }
    

Notable people educated at colleges of the University of Oxford[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, educated at (P69) View with Reasonator View with SQID
    1 SELECT ?college ?collegeLabel (COUNT(DISTINCT ?alum) AS ?count)
    2 WHERE {
    3 {?college wdt:P31 wd:Q2581649} UNION {?college wdt:P31 wd:Q3338504}. # college or private hall
    4 ?alum wdt:P69 ?college.
    5 MINUS { ?alum wdt:P31 wd:Q15632617 } # Exclude fictional people
    6 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    7                         ?college rdfs:label ?collegeLabel }
    8 } GROUP BY ?college ?collegeLabel
    9 ORDER BY DESC(?count)
    

How many Wikidata entities were educated at the University of Oxford or at individual colleges?[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
    1 SELECT (COUNT(?alum) AS ?count)
    2 WHERE {
    3 	{ ?alum wdt:P69 wd:Q34433 }
    4 UNION { ?alum wdt:P69/wdt:P31 wd:Q2581649 }
    5 }
    

Which of the above are fictional humans?[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, educated at (P69) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?alumDescription ?college ?collegeLabel
    2 WHERE {
    3 	?alum wdt:P31 wd:Q15632617
    4 {?alum wdt:P69 wd:Q34433 }
    5 UNION {?college wdt:P31 wd:Q2581649.
    6         ?alum wdt:P69 ?college}
    7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 }
    

Organisations founded by Oxford alumni (including colleges)[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, founded by (P112) View with Reasonator View with SQID
    1 SELECT DISTINCT ?alum ?alumLabel ?collegeLabel ?org ?orgLabel
    2 WHERE {
    3 	{?alum wdt:P69 wd:Q34433 }
    4 UNION { {?college wdt:P31 wd:Q2581649} UNION {?college wdt:P31 wd:Q3338504}.
    5         ?alum wdt:P69 ?college.}
    6         ?org wdt:P112 ?alum.
    7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 } ORDER BY ASC(?alumLabel)
    

Female graduates of Pembroke College[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, sex or gender (P21) View with Reasonator View with SQID, educated at (P69) View with Reasonator View with SQID
    1 SELECT ?person ?personLabel ?personDescription ?englishwp WHERE {
    2 ?person wdt:P31 wd:Q5; # human
    3         wdt:P21 wd:Q6581072; # sex or gender: female
    4         wdt:P69 wd:Q82606. # Educated at Pembroke College, Oxford
    5 OPTIONAL {?englishwp schema:about ?person; schema:isPartOf <https://en.wikipedia.org/> } # English Wikipedia page
    6 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    7 } ORDER BY ?personLabel
    

Awards won by international female Oxford alumni (including colleges)[edit]

The following query uses these:

Image grid of international female Oxford alumnae[edit]

The following query uses these:

Features: ImageGrid (Q24515278) View with Reasonator View with SQID

 1 #defaultView:ImageGrid
 2 SELECT DISTINCT ?alum ?alumLabel ?alumDescription ?image
 3 WHERE {
 4 	{?alum wdt:P69 wd:Q34433 .}
 5 UNION {?college wdt:P31 wd:Q2581649.
 6         ?alum wdt:P69 ?college.}
 7         ?alum wdt:P21 wd:Q6581072 .
 8        MINUS { ?alum wdt:P27 wd:Q145 }.
 9     OPTIONAL {?alum wdt:P18 ?image }.
10 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
11 }

Things discovered by Oxford alumni (including colleges & PP halls)[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, discoverer or inventor (P61) View with Reasonator View with SQID
    1 SELECT DISTINCT ?alum ?alumLabel ?collegeLabel ?discovered ?discoveredLabel
    2 WHERE {
    3 	{?alum wdt:P69 wd:Q34433 }
    4 UNION { { ?college wdt:P31 wd:Q2581649 } UNION { ?college wdt:P31 wd:Q3338504 }
    5         ?alum wdt:P69 ?college }
    6         ?discovered wdt:P61 ?alum
    7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 } ORDER BY ASC( ?alumLabel )
    

Recipients of the Bodley Medal[edit]

The following query uses these:

  • Properties: award received (P166) View with Reasonator View with SQID
    1 SELECT ?winner ?winnerLabel ?winnerDescription
    2 WHERE {
    3 	?winner wdt:P166 wd:Q4936657.
    4 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    5 }
    

Recent publications by living staff (or former staff) of the University of Oxford[edit]

The following query uses these:

  • Properties: employer (P108) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, date of death (P570) View with Reasonator View with SQID, author (P50) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID
     1 SELECT DISTINCT ?authorLabel ?publication ?publicationLabel ?date 
     2 WHERE {
     3       { ?author wdt:P108 wd:Q34433 } # Listed as employees of the university
     4 UNION { {?college wdt:P31 wd:Q2581649 } UNION { ?college wdt:P31 wd:Q3338504 }.
     5         ?author wdt:P108 ?college } # Listed as employees of a college or hall
     6         MINUS{ ?author wdt:P570 ?date } # No death date
     7         ?publication wdt:P50 ?author 
     8 	OPTIONAL { ?publication wdt:P577 ?date }
     9   
    10 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    11 } ORDER BY DESC(?date)
    

Map of things in Oxford and what they are named after[edit]

#defaultView:Map{"hide": ["?location"]}
SELECT ?personLabel (SAMPLE(?img) AS ?image) (SAMPLE(?loc) AS ?location) ?place ?placeLabel WHERE {
?place wdt:P131 wd:Q34217;
       wdt:P138 ?person.
OPTIONAL { ?place wdt:P625 ?coords }
OPTIONAL { ?place p:P159/pq:P625 ?hqcoords }
BIND (IF (BOUND(?coords), ?coords, ?hqcoords) AS ?loc)
OPTIONAL { ?person wdt:P18 ?img }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?personLabel ?place ?placeLabel

Try it!

Bodleian Libraries collections[edit]

See also commons:Category:Bodleian_Library_manuscripts and w:en:Category:Bodleian_Library_collection

Things in collections of the Bodleian[edit]

The following query uses these:

  • Properties: collection (P195) View with Reasonator View with SQID, inventory number (P217) View with Reasonator View with SQID, inception (P571) View with Reasonator View with SQID, language of work or name (P407) View with Reasonator View with SQID
    1 SELECT DISTINCT ?thing ?thingLabel (GROUP_CONCAT(DISTINCT ?year; separator=", ") as ?years) ?shelfmark (GROUP_CONCAT(DISTINCT ?langLabel ; separator=", ") as ?languages) WHERE {
    2 { ?thing wdt:P195 wd:Q82133} UNION { ?thing p:P217/pq:P195 wd:Q82133 } #wd:Q16147979 
    3 OPTIONAL {?thing wdt:P217 ?shelfmark}
    4 OPTIONAL {?thing wdt:P571 ?date. BIND(YEAR(?date) AS ?year) }
    5 OPTIONAL {?thing wdt:P407 ?lang }
    6 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?thing rdfs:label ?thingLabel . ?lang rdfs:label ?langLabel }
    7 } GROUP BY ?thing ?thingLabel ?shelfmark
    8 ORDER BY ?thingLabel
    

Bodleian manuscripts, with images and Commons categories[edit]

The following query uses these:

  • Properties: collection (P195) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, image (P18) View with Reasonator View with SQID, Commons category (P373) View with Reasonator View with SQID, inventory number (P217) View with Reasonator View with SQID
    1 SELECT DISTINCT ?thing ?thingLabel ?image (URI(CONCAT("https://commons.wikimedia.org/wiki/Category:",?cat) ) AS ?commons) WHERE {
    2 { ?thing wdt:P195 wd:Q82133 } UNION { ?thing p:P217/pq:P195 wd:Q82133 }
    3 { ?thing wdt:P31 wd:Q87167 } UNION { ?thing wdt:P31 wd:Q48498 }
    4 OPTIONAL { ?thing wdt:P18 ?image }
    5 OPTIONAL { ?thing wdt:P373 ?cat }
    6 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 } ORDER BY ?thingLabel
    

University of Edinburgh[edit]

Notable people whose doctoral advisor was a University of Edinburgh alum (+ academic field)[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, doctoral advisor (P184) View with Reasonator View with SQID, field of work (P101) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?supervisee ?superviseeLabel ?fieldLabel
    2 WHERE {
    3 	?alum wdt:P69 wd:Q160302. 
    4         ?supervisee wdt:P184 ?alum.
    5         OPTIONAL {?supervisee wdt:P101 ?field.}
    6 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 }
    

Awards won by women who attended the University of Edinburgh[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, sex or gender (P21) View with Reasonator View with SQID, award received (P166) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?award ?awardLabel
    2 WHERE {
    3 ?alum wdt:P69 wd:Q160302; 
    4   wdt:P21 wd:Q6581072;
    5   wdt:P166 ?award.
    6 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 }
    

Awards won by people employed by the University of Edinburgh[edit]

The following query uses these:

  • Properties: employer (P108) View with Reasonator View with SQID, award received (P166) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?award ?awardLabel
    2 WHERE {
    3 ?alum wdt:P108 wd:Q160302; 
    4   wdt:P166 ?award.
    5 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    6 }
    

Organisations founded by people born in Edinburgh[edit]

The following query uses these:

  • Properties: place of birth (P19) View with Reasonator View with SQID, founded by (P112) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?org ?orgLabel
    2 WHERE
    3 {
    4 	?alum wdt:P19 wd:Q23436. 
    5         ?org wdt:P112 ?alum.
    6 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 }
    

University of Bristol[edit]

Notable alumni of the University of Bristol whose citizenship is not UK[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, country of citizenship (P27) View with Reasonator View with SQID
     1 SELECT ?nationality ?nationalityLabel ?alum ?alumLabel ?alumDescription
     2 WHERE {
     3 	?alum wdt:P69 wd:Q459506. 
     4        ?alum wdt:P27 ?nationality.
     5        MINUS { ?alum wdt:P27 wd:Q145 } 
     6        OPTIONAL { ?alum schema:description ?alumDescription FILTER (lang(?alumDescription) = "en").}
     7 	   OPTIONAL { ?alum rdfs:label ?alumLabel FILTER (lang(?alumLabel) = "en").}
     8   	   OPTIONAL { ?nationality rdfs:label ?nationalityLabel FILTER (lang(?nationalityLabel) = "en")}
     9 }
    10 ORDER BY ?nationalityLabel
    

Notable people whose doctoral advisor was a University of Bristol alum (+ academic field)[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, doctoral advisor (P184) View with Reasonator View with SQID, field of work (P101) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?supervisee ?superviseeLabel ?fieldLabel
    2 WHERE
    3 {
    4 	?alum wdt:P69 wd:Q459506. 
    5         ?supervisee wdt:P184 ?alum.
    6         OPTIONAL {?supervisee wdt:P101 ?field.}
    7 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 }
    

Notable people whose doctoral advisor was a University of Bristol employee (+ academic field)[edit]

The following query uses these:

  • Properties: employer (P108) View with Reasonator View with SQID, doctoral advisor (P184) View with Reasonator View with SQID, field of work (P101) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?supervisee ?superviseeLabel ?fieldLabel
    2 WHERE
    3 {
    4 	?alum wdt:P108 wd:Q459506. 
    5         ?supervisee wdt:P184 ?alum.
    6         OPTIONAL {?supervisee wdt:P101 ?field.}
    7 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 }
    

Awards won by alumni of the University of Bristol[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, award received (P166) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?award ?awardLabel
    2 WHERE
    3 {
    4 	?alum wdt:P69 wd:Q459506. 
    5         ?alum wdt:P166 ?award.
    6 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 } ORDER BY ?awardLabel
    

Awards won by people employed by the University of Bristol (at some point in their career)[edit]

The following query uses these:

  • Properties: employer (P108) View with Reasonator View with SQID, award received (P166) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?award ?awardLabel
    2 WHERE
    3 {
    4 	?alum wdt:P108 wd:Q459506. 
    5         ?alum wdt:P166 ?award.
    6 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 } ORDER BY ?awardLabel
    

University of Reading[edit]

Awards won by alumni of the University of Reading[edit]

The following query uses these:

  • Properties: educated at (P69) View with Reasonator View with SQID, award received (P166) View with Reasonator View with SQID
    1 SELECT ?alum ?alumLabel ?awardLabel WHERE {
    2   ?alum wdt:P69 wd:Q1432632 .
    3   ?alum wdt:P166 ?award .
    4   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    5 } ORDER BY ?alumLabel
    

Universities of the UK[edit]

Map of universities[edit]

The following query uses these:

Museums[edit]

Museums with Twitter accounts[edit]

plus optional Instagram and Facebook

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, Twitter username (P2002) View with Reasonator View with SQID, country (P17) View with Reasonator View with SQID, Facebook profile ID (P2013) View with Reasonator View with SQID, Instagram username (P2003) View with Reasonator View with SQID
    1 SELECT DISTINCT ?museum ?museumLabel ?countryLabel (URI(CONCAT("https://www.facebook.com/",?facebook)) AS ?facebooklink) (URI(CONCAT("https://www.instagram.com/",?instagram)) AS ?instagramlink) (URI(CONCAT("https://twitter.com/",?twitter)) AS ?twitterlink)
    2 WHERE {
    3 ?museum wdt:P31/wdt:P279* wd:Q33506;
    4   wdt:P2002 ?twitter.
    5 OPTIONAL { ?museum wdt:P17 ?country}
    6 OPTIONAL { ?museum wdt:P2013 ?facebook}
    7 OPTIONAL { ?museum wdt:P2003 ?instagram}
    8 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl,fr,de,es,pt,bg,be,ru,hu,uk,ja"}
    9 } ORDER BY ?countryLabel ?museumLabel
    

Things that museums are named after[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, named after (P138) View with Reasonator View with SQID, country (P17) View with Reasonator View with SQID
    1 SELECT DISTINCT ?museum ?museumLabel ?countryLabel ?named ?namedLabel ?namedDescription
    2 WHERE {
    3 ?museum wdt:P31/wdt:P279* wd:Q33506;
    4   wdt:P138 ?named.
    5 OPTIONAL { ?museum wdt:P17 ?country}
    6 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl,fr,de,es,pt,bg,be,ru,hu,uk,ja"}
    7 } ORDER BY ?countryLabel ?museumLabel
    

Global map of art museums, with their web sites[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

1 #defaultView:Map
2 SELECT DISTINCT ?museum ?museumLabel ?coord ?image ?web
3 WHERE {
4 ?museum wdt:P31 wd:Q207694;
5    wdt:P625 ?coord .
6 OPTIONAL {?museum wdt:P18 ?image}.
7 OPTIONAL {?museum wdt:P856 ?web}.
8 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl,fr,de,es,pt"}
9 }

Map of museums in the UK, with images and web sites[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map
 2 SELECT DISTINCT ?web ?museum ?museumLabel (SAMPLE(?coord) AS ?coord) (SAMPLE(?image) AS ?image)
 3 WHERE {
 4 ?museum wdt:P31/wdt:P279* wd:Q33506;
 5    wdt:P17 wd:Q145;
 6    wdt:P625 ?coord.
 7 OPTIONAL {?museum wdt:P856 ?web}
 8 OPTIONAL {?museum wdt:P18 ?image}
 9 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
10 } GROUP BY ?web ?museum ?museumLabel

History of Science[edit]

Things that stars, galaxies, star clusters and nebulae are named after[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, named after (P138) View with Reasonator View with SQID
    1 SELECT DISTINCT ?obj ?objLabel ?objDescription ?nom ?nomLabel ?nomDescription
    2 WHERE {
    3    {?obj wdt:P31/wdt:P279* wd:Q318} UNION {?obj wdt:P31/wdt:P279* wd:Q523}
    4   UNION {?obj wdt:P31/wdt:P279* wd:Q1054444}
    5   UNION {?obj wdt:P31/wdt:P279* wd:Q168845}
    6     ?obj wdt:P138 ?nom
    7    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 } ORDER BY ASC(?objLabel)
    

Things that planets and their moons are named after[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, named after (P138) View with Reasonator View with SQID, parent astronomical body (P397) View with Reasonator View with SQID
    1 SELECT DISTINCT ?planet ?planetLabel ?planetDescription ?nom ?nomLabel ?nomDescription
    2 WHERE {
    3 	?planet wdt:P31/wdt:P279* wd:Q3132741 .
    4     ?planet wdt:P138 ?nom.
    5   ?planet wdt:P397 ?parent.
    6 	SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }.
    7 } ORDER BY DESC(?parent)
    

Things that spacecraft are named after[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, named after (P138) View with Reasonator View with SQID
    1 SELECT DISTINCT ?obj ?objLabel ?objDescription ?nom ?nomLabel ?nomDescription
    2 WHERE {
    3 {?obj wdt:P31/wdt:P279* wd:Q40218} # type of spacecraft
    4 UNION {?obj wdt:P31/wdt:P279* wd:Q13226541}. # or spaceflight programme
    5     ?obj wdt:P138 ?nom #named after
    6    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 } ORDER BY ASC(?objLabel)
    

Things that discovered stars[edit]

The following query uses these:

  • Properties: subclass of (P279) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, discoverer or inventor (P61) View with Reasonator View with SQID
     1 SELECT ?discoverer ?discovererLabel  
     2 	(COUNT(DISTINCT ?star) as ?count)
     3 	(GROUP_CONCAT(DISTINCT(?starLabel); separator=", ") as ?stars)
     4 WHERE
     5 {
     6 	?ppart wdt:P279* wd:Q523 .
     7 	?star wdt:P31 ?ppart .
     8 	?star wdt:P61 ?discoverer .
     9 	SERVICE wikibase:label {
    10 		bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
    11 		?discoverer rdfs:label ?discovererLabel .
    12 		?star rdfs:label ?starLabel            
    13 	}
    14 }
    15 GROUP BY ?discoverer ?discovererLabel
    16 ORDER BY DESC(?count)
    

People who invented scientific instruments[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, discoverer or inventor (P61) View with Reasonator View with SQID
    1 SELECT ?discoverer ?discovererLabel ?instrument ?instrumentLabel
    2 WHERE {
    3 	?instrument wdt:P31/wdt:P279* wd:Q3099911 ;
    4 	 wdt:P61 ?discoverer .
    5 	SERVICE wikibase:label {
    6 		bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    7 }
    

Biosphere[edit]

See w:Wikipedia:WikiProject_United_Nations/Biosphere_Reserve_Descriptions

Map of Biosphere reserves with an entry and location in Wikidata but not in English Wikipedia[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

1 #defaultView:Map
2 SELECT ?wikidata_item ?biosphere_reserve_name ?biosphereURL ?image ?location
3   WHERE {
4   ?wikidata_item wdt:P2520 ?biosphereURL ; # get a list of all biospheres
5    wdt:P625 ?location # and location
6   OPTIONAL{ ?wikidata_item wdt:P18 ?image }
7 FILTER NOT EXISTS { ?enwp schema:about ?wikidata_item ; schema:isPartOf <https://en.wikipedia.org/> } # No article in English wikipedia
8    ?wikidata_item rdfs:label ?biosphere_reserve_name filter (lang(?biosphere_reserve_name) = "en")
9 }

Map of Biosphere reserves with an entry and location in Wikidata and an English Wikipedia article[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map
 2 SELECT ?wikidata_item ?biosphere_reserve_name ?biosphereURL ?wikipedia_article ?image ?location
 3   WHERE {
 4   ?wikidata_item wdt:P2520 ?biosphereURL ; # get a list of all biospheres
 5      wdt:P625 ?location # and location
 6   OPTIONAL{ ?wikidata_item wdt:P18 ?image }
 7 ?wikipedia_article schema:about ?wikidata_item ;
 8   schema:isPartOf <https://en.wikipedia.org/>. # Must have an article in English wikipedia
 9   ?wikidata_item rdfs:label ?biosphere_reserve_name filter (lang(?biosphere_reserve_name) = "en")
10 }

Biosphere reserves with an entry but no location[edit]

The following query uses these:

  • Properties: UNESCO Biosphere Reserve url (P2520) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
    1 SELECT ?wikidata_item ?biosphere_reserve_name ?biosphereURL
    2   WHERE {
    3   ?wikidata_item wdt:P2520 ?biosphereURL . # get a list of all biospheres
    4   FILTER NOT EXISTS { ?wikidata_item wdt:P625 ?location.} # no location
    5 
    6   ?wikidata_item rdfs:label ?biosphere_reserve_name filter (lang(?biosphere_reserve_name) = "en").
    7  }
    

Music[edit]

Lutenists ordered by year of birth[edit]

The following query uses these:

  • Properties: instrument (P1303) View with Reasonator View with SQID, date of birth (P569) View with Reasonator View with SQID, place of birth (P19) View with Reasonator View with SQID
     1 SELECT ?player ?playerLabel ?article ?birthyear ?placeLabel
     2 WHERE {
     3   ?player wdt:P1303 wd:Q180733.
     4 OPTIONAL {?player wdt:P569 ?born}.
     5 OPTIONAL {?player wdt:P19 ?place}.
     6   BIND(YEAR(?born) as ?birthyear).
     7 OPTIONAL{ ?article schema:about ?player. ?article schema:isPartOf <https://en.wikipedia.org/>.  }
     8 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
     9 }
    10 ORDER BY ASC(?birthyear)
    

Artworks[edit]

Birthplaces of painters in the Rijksmuseum collection (based on query by Jane Darnell)[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map
 2 SELECT DISTINCT ?painter ?painterLabel ?birthplaceLabel ?geoloc where {
 3       ?painting wdt:P31/wdt:P279* wd:Q3305213 ;  # any painting (or type of painting)
 4        wdt:P195 wd:Q190804 ;  # in collection Rijksmuseum
 5        wdt:P170 ?painter . # get painter
 6       ?painter wdt:P19 ?birthplace . # get painter's birthplace
 7       ?birthplace wdt:P625 ?geoloc . #latitude and longitude
 8   SERVICE wikibase:label {
 9        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,es"
10     }
11 }

Image gallery of oil paintings from Rijksmuseum[edit]

The following query uses these:

Features: ImageGrid (Q24515278) View with Reasonator View with SQID

 1 #defaultView:ImageGrid
 2 SELECT DISTINCT ?painting ?paintingLabel ?painterLabel ?image where {
 3       ?painting wdt:P31/wdt:P279* wd:Q3305213 ;  # any painting (or type of painting)
 4        wdt:P195 wd:Q190804 ;  # in collection Rijksmuseum
 5        wdt:P170 ?painter ; # get painter
 6        wdt:P186 wd:Q296955 ; # Made with oil paint
 7        wdt:P18 ?image . # Image from Commons of the artwork
 8   SERVICE wikibase:label {
 9        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,es"
10     }
11 } LIMIT 160

Visual art works by African-American women[edit]

The following query uses these:

Features: Graph (Q24515287) View with Reasonator View with SQID

 1 #defaultView:Graph
 2 SELECT ?person ?personLabel ?personimage ?work ?workLabel ?workimage WHERE {
 3   ?person wdt:P172 wd:Q49085 ;  # African American
 4   wdt:P21 wd:Q6581072 ;      # women
 5   wdt:P106/wdt:P279* wd:Q3391743 .  # visual artists
 6  OPTIONAL{ ?person wdt:P18 ?personimage }
 7   ?work wdt:P170 ?person . # and their work
 8  OPTIONAL{ ?work wdt:P18 ?workimage }
 9   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
10   }

Trans people in the arts[edit]

The following query uses these:

Features: Graph (Q24515287) View with Reasonator View with SQID

 1 #defaultView:Graph
 2 SELECT DISTINCT ?person ?personLabel ?personimage ?field ?fieldLabel WHERE {
 3   {?person wdt:P21 wd:Q2449503 } UNION {?person wdt:P21 wd:Q1052281 }      # trans men and women
 4   ?person wdt:P106/wdt:P279* wd:Q483501 .  # artist
 5   ?person wdt:P106 ?field. 
 6   ?field wdt:P279* wd:Q483501
 7 MINUS {?field wdt:P279* wd:Q33999} # not actors
 8          OPTIONAL{ ?person wdt:P18 ?personimage }
 9   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
10   }

Art venues[edit]

Art venues in the UK, but not pubs[edit]

The following query uses these:

All art exhibitions known to Wikidata[edit]

The following query uses these:

Poems[edit]

Note: poems are sometimes represented as instance of (P31) literary work (Q7725634); genre (P136) poem (Q5185279)

Poems from the 18th century, with their authors and languages[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID, inception (P571) View with Reasonator View with SQID, author (P50) View with Reasonator View with SQID, original language of work (P364) View with Reasonator View with SQID
     1 SELECT ?poem ?poemLabel ?languageLabel ?authorLabel ?year WHERE {
     2 ?poem wdt:P31/wdt:P279? wd:Q5185279;
     3 OPTIONAL{?poem wdt:P577 ?pubdate}
     4 OPTIONAL{?poem wdt:P571 ?inception}
     5 OPTIONAL{?poem wdt:P50 ?author}
     6 OPTIONAL{?poem wdt:P364 ?language}
     7 BIND((IF (BOUND(?pubdate),?pubdate,?inception) ) AS ?date)
     8 BIND(YEAR(?date) AS ?year)
     9 FILTER (?year > 1699 && ?year < 1800)
    10 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru"}
    11 } ORDER BY ?authorLabel ?year ?poemLabel
    

Poems whose text is available online through Wikisource, or elsewhere[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, author (P50) View with Reasonator View with SQID, full work available at (P953) View with Reasonator View with SQID
    1 SELECT DISTINCT ?poem ?poemLabel ?authorLabel ?link WHERE {
    2 ?poem wdt:P31/wdt:P279? wd:Q5185279;
    3 OPTIONAL{?poem wdt:P50 ?author}
    4 OPTIONAL{?poem wdt:P953 ?text}
    5 OPTIONAL{?wikisource schema:about ?poem; schema:isPartOf <https://en.wikisource.org/>}
    6 BIND((IF (BOUND(?text),?text,?wikisource) ) AS ?link)
    7 FILTER BOUND(?link)
    8 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru"}
    9 } ORDER BY ?authorLabel
    
  • 875 results as of 23 March 2017

TODO: add links to text of volumes that a poem is published in.

Poets of the Kingdom of Great Britain whose birth and death years are known[edit]

The following query uses these:

  • Properties: occupation (P106) View with Reasonator View with SQID, country of citizenship (P27) View with Reasonator View with SQID, date of birth (P569) View with Reasonator View with SQID, date of death (P570) View with Reasonator View with SQID, VIAF ID (P214) View with Reasonator View with SQID
     1 SELECT DISTINCT ?person ?personLabel (URI(CONCAT("http://viaf.org/viaf/",?viaf)) AS ?viaf_id) ?birthyear ?deathyear WHERE {
     2 ?person wdt:P106 wd:Q49757;
     3         wdt:P27 wd:Q161885;
     4         wdt:P569 ?birthdate;
     5         wdt:P570 ?deathdate.
     6 FILTER (!isBLANK(?birthdate))
     7 FILTER (!isBLANK(?deathdate))
     8 OPTIONAL{ ?person wdt:P214 ?viaf}
     9 BIND(YEAR(?birthdate) AS ?birthyear)
    10 BIND(YEAR(?deathdate) AS ?deathyear)
    11 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru"}
    12 } ORDER BY ?birthyear
    

People who wrote a notable poem but do not have "poet" included in their occupations[edit]

The following query uses these:

  • Properties: author (P50) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, occupation (P106) View with Reasonator View with SQID
    1 SELECT DISTINCT ?work ?workLabel ?author ?authorLabel ?article WHERE {
    2 ?work wdt:P50 ?author ;
    3        wdt:P31/wdt:P279? wd:Q5185279. # ?work is a poem
    4 ?article schema:about ?work;
    5 	schema:isPartOf <https://en.wikipedia.org/> .
    6 MINUS {?author wdt:P106 wd:Q49757} # ?author is not listed as a poet
    7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 } ORDER BY ?authorLabel
    

Notable works (with an English Wikipedia article) by authors who have no notable works[edit]

The following query uses these:

  • Properties: author (P50) View with Reasonator View with SQID, occupation (P106) View with Reasonator View with SQID, notable work (P800) View with Reasonator View with SQID
    1 SELECT DISTINCT ?work ?workLabel ?author ?authorLabel ?article WHERE {
    2 ?work wdt:P50 ?author .
    3 ?article schema:about ?work;
    4 	schema:isPartOf <https://en.wikipedia.org/> .
    5 ?author wdt:P106 wd:Q49757
    6 MINUS {?author wdt:P800 []}
    7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 } ORDER BY ?authorLabel
    

Works of Florence Earle Coates[edit]

The following query uses these:

  • Properties: author (P50) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID, first line (P1922) View with Reasonator View with SQID
    1 SELECT ?work ?title ?firstline ?year ?enws ?enwp WHERE {
    2   ?work wdt:P50 wd:Q5460603
    3 OPTIONAL{?work wdt:P577 ?pubdate}
    4 OPTIONAL{?work wdt:P1922 ?firstline}
    5 BIND(YEAR(?pubdate) as ?year)
    6 OPTIONAL{ ?enws schema:about ?work ; schema:isPartOf <https://en.wikisource.org/> }
    7 OPTIONAL{ ?enwp schema:about ?work ; schema:isPartOf <https://en.wikipedia.org/> }
    8 OPTIONAL{ ?work rdfs:label ?title filter(lang(?title) = "en") }
    9 }
    

First lines[edit]

What kinds of things have first lines?[edit]

The following query uses these:

  • Properties: first line (P1922) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
    1 SELECT (COUNT(?thing) AS ?count) ?typeLabel WHERE {
    2 ?thing wdt:P1922 [];
    3        wdt:P31 ?type.
    4 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru"}
    5 } GROUP BY ?typeLabel
    6 ORDER BY DESC(?count)
    

Poems, their languages, and the languages of their first lines[edit]

The following query uses these:

  • Properties: first line (P1922) View with Reasonator View with SQID, ISO 639-1 code (P218) View with Reasonator View with SQID, original language of work (P364) View with Reasonator View with SQID
    1 SELECT (COUNT(?thing) AS ?count) ?langLabel ?langlineLabel WHERE {
    2 ?thing wdt:P1922 ?line.
    3 BIND(lang(?line) AS ?langlinecode)
    4 ?langline wdt:P218 ?langlinecode
    5 OPTIONAL { ?thing wdt:P364 ?lang }
    6 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru"}
    7 } GROUP BY ?langLabel ?langlineLabel
    8 ORDER BY ?langLabel DESC(?count)
    

Works where the language of the first line differs from the original language of the work[edit]

The following query uses these:

  • Properties: first line (P1922) View with Reasonator View with SQID, language of work or name (P407) View with Reasonator View with SQID, author (P50) View with Reasonator View with SQID, ISO 639-1 code (P218) View with Reasonator View with SQID
    1 SELECT ?work ?workLabel ?authorLabel ?langLabel ?langlineLabel WHERE {
    2 ?work wdt:P1922 ?line;
    3        wdt:P407 ?lang
    4 OPTIONAL {?work wdt:P50 ?author}
    5 BIND(lang(?line) AS ?langlinecode)
    6 ?langline wdt:P218 ?langlinecode
    7 FILTER (?langline != ?lang)
    8 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru"}
    9 } ORDER BY ?langLabel
    

Wikisource maintenance[edit]

English Wikisource texts with a Wikidata entry but no indication of what they are[edit]

Priority given to those that have more statements in Wikidata

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID
     1 SELECT ?ws ?wsLabel ?wsDescription ?statementcount
     2 WHERE {
     3 ?article schema:about ?ws;
     4     schema:isPartOf <https://en.wikisource.org/>.
     5 ?ws wikibase:statements ?statementcount
     6 MINUS {?ws wdt:P31 [] } # No "instance of" property
     7 MINUS {?ws wdt:P279 [] } # No "subclass of" property
     8 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
     9 } ORDER BY DESC(?statementcount)
    10 LIMIT 200
    

English Wikisource texts with an "instance of": count by type[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, publication date (P577) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID
     1 SELECT ?type ?typeLabel (COUNT(?ws) as ?count) (COUNT(?date) as ?have_date)
     2 WHERE {
     3 ?article schema:about ?ws;
     4 	schema:isPartOf <https://en.wikisource.org/>.
     5 ?ws wdt:P31 ?type
     6 OPTIONAL {?ws wdt:P577 ?date}
     7 MINUS {?type wdt:P279+ wd:Q17442446}
     8 MINUS {?type wdt:P279 wd:Q14204246}
     9 MINUS {?type wdt:P279+ wd:Q17379835}
    10 OPTIONAL {?type rdfs:label ?typeLabel filter(lang(?typeLabel) = "en") }
    11 } GROUP BY ?type ?typeLabel
    12 ORDER BY DESC(?count)
    

Dead people with a Project Gutenberg ID but no English Wikisource profile, whose main language is English[edit]

The following query uses these:

  • Properties: Project Gutenberg author ID (P1938) View with Reasonator View with SQID, date of death (P570) View with Reasonator View with SQID, languages spoken, written or signed (P1412) View with Reasonator View with SQID
     1 SELECT DISTINCT ?person ?personLabel ?personDescription ?language ?death (URI(CONCAT("https://www.gutenberg.org/ebooks/author/", ?gutenberg)) AS ?gberglink) WHERE {
     2   ?person wdt:P1938 ?gutenberg;
     3     wdt:P570 ?death. # Dead people only
     4   FILTER (?death <= "1946-01-01T00:00:00Z"^^xsd:dateTime)
     5   MINUS {
     6     ?enws schema:about ?person;
     7       schema:isPartOf <https://en.wikisource.org/>
     8   }
     9   OPTIONAL {?person wdt:P1412 ?lang}.
    10   FILTER (!BOUND(?lang) || ?lang = wd:Q1860) # Language: English or absent
    11   BIND(IF(BOUND(?lang),"English","Not specified") AS ?language
    12 )
    13   SERVICE wikibase:label {
    14        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"
    15     }
    16 }
    17 ORDER BY ?death
    

Letters[edit]

See also Q1784733 Correspondence

Authors of notable letters, by number of letters[edit]

The following query uses these:

  • Properties: author (P50) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
    1 SELECT ?author ?authorLabel ?authorDescription (COUNT(?letter) as ?count)
    2 WHERE {
    3   ?letter wdt:P50 ?author;
    4    wdt:P31 wd:Q133492.
    5   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    6 } GROUP BY ?author ?authorLabel ?authorDescription
    7 ORDER BY DESC(?count)
    

Recipients of notable letters, by number of letters[edit]

The following query uses these:

  • Properties: addressee (P1817) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
    1 SELECT ?recipient ?recipientLabel ?recipientDescription (COUNT(?letter) as ?count)
    2 WHERE {
    3   ?letter wdt:P1817 ?recipient;
    4    wdt:P31 wd:Q133492.
    5   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    6 } GROUP BY ?recipient ?recipientLabel ?recipientDescription
    7 ORDER BY DESC(?count)
    

For the Wikisource text of letters, see s:Category:Letters

Lifeboat stations[edit]

Map of lifeboat stations, with ownership[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

1 #defaultView:Map
2 SELECT ?station ?stationLabel ?location ?ownerLabel (SAMPLE(?image) AS ?image)
3 WHERE {
4 ?station wdt:P31 wd:Q11997323;
5   wdt:P625 ?location.
6 OPTIONAL { ?station wdt:P18 ?image}
7 OPTIONAL { ?station wdt:P127 ?owner}
8 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,no,sv,da,de"}
9 } GROUP BY ?station ?stationLabel ?location ?ownerLabel

Lifeboat stations lacking a location[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, country (P17) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID
    1 SELECT ?station ?stationLabel ?countryLabel
    2 WHERE {
    3 ?station wdt:P31 wd:Q11997323;
    4  wdt:P17 ?country.
    5 MINUS {?station wdt:P625 ?location}
    6 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,no,sv,da,de"}
    7 } ORDER BY ?countryLabel
    

World War I[edit]

Notable people from a specific region who fought in World War I[edit]

Without images[edit]

The following query uses these:

  • Properties: place of birth (P19) View with Reasonator View with SQID, located in the administrative territorial entity (P131) View with Reasonator View with SQID, shares border with (P47) View with Reasonator View with SQID, conflict (P607) View with Reasonator View with SQID, coordinate location (P625) View with Reasonator View with SQID, image (P18) View with Reasonator View with SQID, date of birth (P569) View with Reasonator View with SQID, date of death (P570) View with Reasonator View with SQID
     1 SELECT ?name (CONCAT("Born ",str(?born), ", ",?birthplace,"; Died ", str(?died)) as ?dates) ?article WHERE {
     2    ?person wdt:P19 ?place . # place of birth
     3    {?place wdt:P131* wd:Q23165 } UNION { ?place wdt:P131* ?county. ?county wdt:P47 wd:Q23165 }. # born in Oxfordshire or adjacent county 
     4    ?person wdt:P607 wd:Q361 . # involved in World War I
     5     # ?place wdt:P625 ?coord . # lat and long of birthplace
     6      MINUS { ?person wdt:P18 ?image }. #image
     7       ?person wdt:P569 ?dob . #date of birth
     8 	BIND(YEAR(?dob) as ?born).
     9     OPTIONAL { ?person wdt:P570 ?dod }. #date of death
    10   BIND(YEAR(?dod) as ?died).
    11    ?person rdfs:label ?name filter (lang(?name) = "en")
    12    ?place rdfs:label ?birthplace filter (lang(?birthplace) = "en")
    13 OPTIONAL{ ?article schema:about ?person. ?article schema:isPartOf <https://en.wikipedia.org/>.  }
    14 } ORDER by ?birthplace
    

With images[edit]

The following query uses these:

Features: ImageGrid (Q24515278) View with Reasonator View with SQID

 1 #defaultView:ImageGrid
 2 SELECT DISTINCT ?image ?name (CONCAT("Born ",str(?born), "; Died ", str(?died)) as ?dates) ?birthplace ?article WHERE {
 3 ?person wdt:P19 ?place ; # place of birth
 4      wdt:P607 wd:Q361 ; # involved in World War I
 5      wdt:P18 ?image ; #image
 6      wdt:P569 ?dob #date of birth
 7 {?place wdt:P131* wd:Q48015 } UNION { ?place wdt:P131* ?county. ?county wdt:P47 wd:Q23169 } # born in SE England or adjacent county to Oxfordshire 
 8 OPTIONAL { ?person wdt:P570 ?dod } #date of death
 9 BIND(YEAR(?dob) as ?born)
10 BIND(YEAR(?dod) as ?died)
11 ?person rdfs:label ?name filter (lang(?name) = "en")
12 ?place rdfs:label ?birthplace filter (lang(?birthplace) = "en")
13 OPTIONAL{ ?article schema:about ?person; schema:isPartOf <https://en.wikipedia.org/> }
14 }

Theses[edit]

All doctoral theses[edit]

Showing all theses whether or not they have author details, with optional author or author name string, year and institution.

The following query uses these:

Authors and their theses[edit]

Use this as a maintenance query to find thesis relationships that do not point to a publication (such as doctoral thesis, edition, thesis, or book)

The following query uses these:

  • Properties: doctoral thesis (P1026) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, full work available at (P953) View with Reasonator View with SQID
    1 SELECT ?author ?authorLabel ?thesis ?typeLabel ?url WHERE {
    2    ?author wdt:P1026 ?thesis .
    3    ?thesis wdt:P31 ?type 
    4   OPTIONAL { ?thesis wdt:P953 ?url }
    5    SERVICE wikibase:label {
    6      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"
    7    }
    8 } ORDER BY ?typeLabel
    

Doctoral theses without an author[edit]

The following query uses these:

Doctoral thesis with an author, but the author has no thesis[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, author (P50) View with Reasonator View with SQID, doctoral thesis (P1026) View with Reasonator View with SQID
    1 SELECT ?thesis ?thesisDescription ?author ?authorLabel WHERE {
    2 ?thesis wdt:P31 wd:Q187685;
    3         wdt:P50 ?author.
    4 MINUS { ?author wdt:P1026 [] }
    5 SERVICE wikibase:label {
    6      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"
    7    }
    8 }
    

Theses imported from Oxford Research Archive[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, dissertation submitted to (P4101) View with Reasonator View with SQID, full work available at (P953) View with Reasonator View with SQID, author (P50) View with Reasonator View with SQID
    1 SELECT ?thesis ?thesisDescription ?authorLabel ?authorwp ?ora_url WHERE {
    2 ?thesis wdt:P31 wd:Q187685;  # doctoral theses
    3         wdt:P4101 wd:Q34433;  # submitted to University of Oxford
    4         wdt:P953 ?ora_url     # with open access link
    5 OPTIONAL {?thesis wdt:P50 ?author
    6 OPTIONAL{ ?authorwp schema:about ?author. ?authorwp schema:isPartOf <https://en.wikipedia.org/> } }
    7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    8 } ORDER BY DESC(?authorwp)
    

All properties of theses (query by User:Jheald)[edit]

The following query uses these:

  • Properties: subclass of (P279) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID
     1 SELECT ?prop ?propLabel ?count ?exampleLabel WHERE {
     2     {
     3         SELECT ?prop (COUNT(DISTINCT ?item) AS ?count) (SAMPLE(?id) AS ?example) WHERE {
     4            hint:Query hint:optimizer "None" .
     5            ?classes wdt:P279* wd:Q1266946 .
     6            ?item wdt:P31 ?classes .
     7            ?item ?p ?id .
     8            ?prop wikibase:directClaim ?p
     9         }  GROUP BY ?prop
    10     }
    11     SERVICE wikibase:label {
    12         bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"
    13     }
    14 } ORDER BY DESC (?count)
    

Oxford doctoral theses by their main topic[edit]

SELECT ?subject ?url ?qLabel ?attrib (YEAR(?inception) AS ?year) WHERE {
?q wdt:P4101 wd:Q34433; wdt:P921 ?subject; wdt:P953 ?url.
OPTIONAL {?q wdt:P50 ?author. ?author rdfs:label ?authorname FILTER(lang(?authorname)= "en") }
OPTIONAL {?q wdt:P2093 ?authorstring}
OPTIONAL {?q wdt:P571 ?inception}
BIND(IF(BOUND(?authorname),?authorname, ?authorstring) AS ?attrib).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Try it!

Sicily[edit]

Archaeological sites with lat-long pairs placing them in Sicily[edit]

The following query uses these:

Features: Map (Q24515275) View with Reasonator View with SQID

 1 #defaultView:Map
 2 SELECT ?place ?placeLabel ?latlong (SAMPLE(?image) as ?image)
 3 WHERE
 4 { ?place wdt:P31/wdt:P279* wd:Q839954; # Archaeological site (or type of)
 5  wdt:P625 ?latlong;
 6  p:P625 ?statement . # coordinate-location statement
 7  OPTIONAL {?place wdt:P18 ?image }.
 8   ?statement psv:P625 ?coord.
 9   ?coord wikibase:geoLatitude ?lat .
10   ?coord wikibase:geoLongitude ?long .
11    FILTER (ABS(?lat - 37.5) < 1.3).
12    FILTER (ABS(?long - 14) < 1.5).
13  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,it" }
14 } GROUP BY ?place ?placeLabel ?latlong

Linguistics[edit]

Things called "___ phonology"[edit]

SELECT DISTINCT ?thing ?name WHERE {
VALUES ?prop {wdt:P279 wdt:P31}
?thing ?prop wd:Q40998; 
  rdfs:label ?name FILTER (lang(?name)="en") FILTER STRENDS(?name, " phonology")
} ORDER BY ?name

Try it!

Greek personal names[edit]

People of Ancient Greece[edit]

The following query uses these:

  • Properties: culture (P2596) View with Reasonator View with SQID, instance of (P31) View with Reasonator View with SQID, country of citizenship (P27) View with Reasonator View with SQID, residence (P551) View with Reasonator View with SQID
    1 SELECT DISTINCT ?person ?en_name WHERE {
    2 {?person wdt:P2596 wd:Q11772. ?person wdt:P31 wd:Q5 } # Person & Culture: Ancient Greece
    3   UNION {?person wdt:P27/wdt:P31 wd:Q148837} # Citizen of a Polis
    4   UNION {?person wdt:P551/wdt:P31 wd:Q148837 } # Resident of a Polis
    5 OPTIONAL{ ?person rdfs:label ?en_name FILTER(lang(?en_name) = "en")}
    6 } ORDER BY ?en_name
    

846 results as of 9 Feb 2017

Personal names in Ancient Greek of individual Ancient Greek people[edit]

The following query uses these:

Cuneiform inscriptions[edit]

Items with a CDLI ID and their English Wikipedia articles[edit]

The following query uses these:

  • Properties: CDLI ID (P2474) View with Reasonator View with SQID
    1 SELECT ?item ?itemLabel (URI(CONCAT("http://cdli.ucla.edu/search/archival_view.php?ObjectID=",?id)) AS ?cdli)  ?enwp WHERE {
    2   ?item wdt:P2474 ?id
    3 OPTIONAL{ ?enwp schema:about ?item; schema:isPartOf <https://en.wikipedia.org/> }
    4 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
    5 }
    

Items plus Reasonator links[edit]

The following query uses these:

  • Properties: CDLI ID (P2474) View with Reasonator View with SQID
    1 SELECT ?itemLabel (URI(CONCAT("https://tools.wmflabs.org/reasonator/?q=", SUBSTR(STR(?item),32) )) as ?reasonator) WHERE {
    2   ?item wdt:P2474 []
    3 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
    4 }
    

Labels for CDLI items in all languages[edit]

The following query uses these:

  • Properties: CDLI ID (P2474) View with Reasonator View with SQID
    1 SELECT ?id (lang(?label) AS ?lang) ?label WHERE {
    2   ?item wdt:P2474 ?id;
    3 rdfs:label ?label.
    4 } ORDER BY ?id ?lang
    

Commons categories with images of items[edit]

The following query uses these:

  • Properties: CDLI ID (P2474) View with Reasonator View with SQID, Commons category (P373) View with Reasonator View with SQID
    1 SELECT ?item ?itemLabel ?id (URI(CONCAT("https://commons.wikimedia.org/wiki/Category:",?commons)) AS ?images) WHERE {
    2   ?item wdt:P2474 ?id
    3 OPTIONAL{ ?item wdt:P373 ?commons }
    4 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
    5 }
    

Ancient Greek pottery[edit]

All ancient Greek pottery items known to Wikidata, with Wikipedia links[edit]

The following query uses these:

  • Properties: instance of (P31) View with Reasonator View with SQID, subclass of (P279) View with Reasonator View with SQID, from fictional universe (P1080) View with Reasonator View with SQID
    1 SELECT DISTINCT ?item ?itemLabel ?itemDescription ?enwp WHERE {
    2 ?item wdt:P31/wdt:P279? wd:Q738680  # instance of type of ancient Greek pottery
    3 OPTIONAL {?enwp schema:about ?item; schema:isPartOf <https://en.wikipedia.org/> }
    4 MINUS {?item wdt:P1080 []} # exclude fictional (Pandora's Box)
    5 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,el,fr,de,pl,uk"}
    6 }
    

Image gallery of ancient Greek pottery[edit]

The following query uses these:

Features: ImageGrid (Q24515278) View with Reasonator View with SQID

1 #defaultView:ImageGrid
2 SELECT DISTINCT ?item ?itemLabel ?image WHERE {
3 ?item wdt:P31/wdt:P279? wd:Q738680;  # instance of type of ancient Greek pottery
4       wdt:P18 ?image 
5 MINUS {?item wdt:P1080 []} # exclude fictional (Pandora's Box)
6 SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,el,fr,de,pl,uk"}
7 }

Visual graph of types of pottery[edit]

The following query uses these: