Open main menu

User:MartinPoulter/queries

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 EnlightenmentEdit

HillfortsEdit

Global collectionsEdit

Botanic expeditionsEdit

CalendarsEdit

From Sappho to SuffrageEdit

Counting stuff on WikidataEdit

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

Count of scientific articlesEdit

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

Try it!

Count of fictional charactersEdit

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

Try it!

Count of items with coordinate locationsEdit

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

Try it!

Women born in the UKEdit

SELECT DISTINCT ?p ?pLabel ?pDescription WHERE {
?p wdt:P31 wd:Q5;
   wdt:P21 wd:Q6581072;
{?p wdt:P19 wd:Q145} # place of birth: UK
  UNION {?p wdt:P19 ?place.
         { ?place wdt:P131?/wdt:P17 wd:Q145 } # places whose country is the UK
         UNION
         { ?place wdt:P131*/wdt:P17?/wdt:P31 wd:Q3336843 } # places whose country is a constituent of the UK
 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?pLabel

Try it!

Women with place of birth: UKEdit

SELECT DISTINCT ?p ?pLabel ?pDescription WHERE {
?p wdt:P31 wd:Q5;
   wdt:P21 wd:Q6581072;
   wdt:P19 wd:Q145.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?pLabel

Try it!

VoltaireEdit

Wikipedia articles about worksEdit

The following query uses these:

  • Properties: author (P50)    , publication date (P577)    
    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 worksEdit

This query was improved by Navino Evans.

The following query uses these:

  • Properties: author (P50)    , instance of (P31)    , image (P18)    , publication date (P577)    
     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 themEdit

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!

EconomicsEdit

Birthplaces of economistsEdit

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.

DeadEdit

The following query uses these:

Features: Map (Q24515275)    

 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

LivingEdit

The following query uses these:

Features: Map (Q24515275)    

 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 linksEdit

The following query uses these:

Features: Map (Q24515275)    

 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 locationEdit

The following query uses these:

Features: Map (Q24515275)    

 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 nationalitiesEdit

The following query uses these:

  • Properties: field of work (P101)    , country of citizenship (P27)    , subclass of (P279)    , instance of (P31)    
    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 profileEdit

The following query uses these:

  • Properties: occupation (P106)    , field of work (P101)    , Project Gutenberg author ID (P1938)    , Online Books Page author ID (P4629)    
     1 SELECT DISTINCT ?person ?name ?birthyear ?deathyear ?enws ?quotes ?commonscat
     2 (URI(CONCAT("https://www.gutenberg.org/ebooks/author/", ?gutenberg_id)) AS ?gutenberg) 
     3 (URI(CONCAT("https://doi.org/10.1093/ref:odnb/", ?odnb)) AS ?odnburl)
     4 (URI(CONCAT("http://onlinebooks.library.upenn.edu/webbin/book/lookupname?key=", ?books)) AS ?booksurl)
     5 (URI(CONCAT("https://www.britannica.com/", ?britannica)) AS ?britannicaurl) ?npg WHERE {
     6 { ?person wdt:P106 wd:Q188094 }
     7 UNION
     8 { ?person wdt:P101 wd:Q8134 }
     9 OPTIONAL {?person wdt:P1938 ?gutenberg_id}
    10 OPTIONAL { ?person wdt:P4629 ?books }
    11 OPTIONAL {
    12   ?enws schema:about ?person;
    13   schema:isPartOf <https://en.wikisource.org/>
    14 }
    15 FILTER (BOUND(?enws)
    

Economics awards and their recipients, by yearEdit

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    , award received (P166)    , point in time (P585)    
    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 awardsEdit

The following query uses these:

  • Properties: award received (P166)    , instance of (P31)    
    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 economistsEdit

The following query uses these:

  • Properties: instance of (P31)    , occupation (P106)    , subclass of (P279)    , award received (P166)    , point in time (P585)    
    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 economicsEdit

Titles of (current) national finance ministersEdit

The following query uses these:

Free trade areasEdit

SELECT ?c ?cLabel ?item ?itemLabel WHERE {
?item wdt:P31 wd:Q5335686.
?c wdt:P463 ?item
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?itemLabel

Try it!

Not EconomicsEdit

Stars in flag versus fertilityEdit

SELECT ?iso ?countryLabel (SUM(?stars) as ?stars) ?fertility WHERE {
{SELECT DISTINCT ?country ?iso WHERE {
VALUES ?countrytypes {wd:Q6256 wd:Q3624078} # country and sovereign state
?country wdt:P31 ?countrytypes ; wdt:P298 ?iso
MINUS {?country wdt:P576 []} # Not dissolved
}  }
?country wdt:P163 ?flag.
OPTIONAL{
?flag p:P180 [ps:P180 ?feature ; pq:P1114 ?stars] . # quantity of feature
?feature wdt:P279? wd:Q836708  # type of star polygon
}
OPTIONAL { ?country wdt:P4841 ?fertility }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?iso ?countryLabel ?fertility
ORDER BY DESC(?stars) ?countryLabel

Try it!

University of OxfordEdit

Colleges and Permanent Private Halls with coats of arms and official web sitesEdit

The following query uses these:

Features: Map (Q24515275)    

 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)    
    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 OxfordEdit

The following query uses these:

  • Properties: instance of (P31)    , educated at (P69)    
    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:

Which of the above are fictional humans?Edit

The following query uses these:

  • Properties: instance of (P31)    , educated at (P69)    
    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)    , instance of (P31)    , founded by (P112)    
    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 CollegeEdit

The following query uses these:

  • Properties: instance of (P31)    , sex or gender (P21)    , educated at (P69)    
    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 alumnaeEdit

#defaultView:ImageGrid{"hide":["?image"]}
SELECT DISTINCT ?alum ?alumLabel ?alumDescription ?image
WHERE {
	{?alum wdt:P69 wd:Q34433 .}
UNION {?college wdt:P31 wd:Q2581649.
        ?alum wdt:P69 ?college.}
        ?alum wdt:P21 wd:Q6581072 .
       MINUS { ?alum wdt:P27 wd:Q145 }.
    OPTIONAL {?alum wdt:P18 ?image }.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Try it!

Things discovered by Oxford alumni (including colleges & PP halls)Edit

The following query uses these:

  • Properties: educated at (P69)    , instance of (P31)    , discoverer or inventor (P61)    
    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 MedalEdit

The following query uses these:

  • Properties: award received (P166)    
    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 OxfordEdit

The following query uses these:

  • Properties: employer (P108)    , instance of (P31)    , date of death (P570)    , author (P50)    , publication date (P577)    
     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 colour-coded by typeEdit

#defaultView:Map{"hide": ["?location"]}
SELECT ?place ?placeLabel (SAMPLE(?loc) AS ?location) ?layer WHERE {
?place wdt:P131 wd:Q34217;
       wdt:P31 ?type.
MINUS { ?place wdt:P576 [] } # Not closed down
OPTIONAL { ?place wdt:P625 ?coords }
OPTIONAL { ?place p:P159/pq:P625 ?hqcoords }
BIND (IF (BOUND(?coords), ?coords, ?hqcoords) AS ?loc)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?type rdfs:label ?layer.?place rdfs:label ?placeLabel }
} GROUP BY ?place ?placeLabel ?layer

Try it!

Map of things in Oxford and what they are named afterEdit

#defaultView:Map{"hide": ["?location"]}
SELECT ?person ?personLabel (SAMPLE(?img) AS ?image) (SAMPLE(?loc) AS ?location) ?placeLabel WHERE {
?place wdt:P131 wd:Q34217;
       wdt:P138 ?person FILTER (?person != wd:Q34217).
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 ?person ?personLabel ?placeLabel

Try it!

English WikisourceEdit

People with ENWS author profilesEdit

SELECT ?person ?enws WHERE {
?person wdt:P31 wd:Q5.
?enws schema:about ?person;
schema:isPartOf <https://en.wikisource.org/> FILTER CONTAINS(STR(?enws), "Author:")
} ORDER BY ?enws

Try it!

Bodleian Libraries collectionsEdit

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

Things in collections of the BodleianEdit

The following query uses these:

  • Properties: collection (P195)    , inventory number (P217)    , inception (P571)    , language of work or name (P407)    
    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 categoriesEdit

The following query uses these:

  • Properties: collection (P195)    , instance of (P31)    , image (P18)    , Commons category (P373)    , inventory number (P217)    
    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 EdinburghEdit

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

The following query uses these:

  • Properties: educated at (P69)    , doctoral advisor (P184)    , field of work (P101)    
    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 EdinburghEdit

The following query uses these:

Awards won by people employed by the University of EdinburghEdit

The following query uses these:

  • Properties: employer (P108)    , award received (P166)    
    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 EdinburghEdit

The following query uses these:

  • Properties: place of birth (P19)    , founded by (P112)    
    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 BristolEdit

Notable alumni of the University of Bristol whose citizenship is not UKEdit

The following query uses these:

  • Properties: educated at (P69)    , country of citizenship (P27)    
     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)    , doctoral advisor (P184)    , field of work (P101)    
    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)    , doctoral advisor (P184)    , field of work (P101)    
    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 BristolEdit

The following query uses these:

  • Properties: educated at (P69)    , award received (P166)    
    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)    , award received (P166)    
    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 ReadingEdit

Awards won by alumni of the University of ReadingEdit

The following query uses these:

  • Properties: educated at (P69)    , award received (P166)    
    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
    

White Rose Research OnlineEdit

Papers online at a White Rose URL but without "content deliverer: White Rose Research Online" qualifierEdit

SELECT ?item ?itemLabel WHERE {
?item p:P953 ?s. ?s ps:P953 ?url FILTER (CONTAINS( STR(?url), "eprints.whiterose.ac.uk") )
MINUS {?s pq:P3274 wd:Q24753667 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Universities of the UKEdit

Map of universitiesEdit

The following query uses these:

MuseumsEdit

Museums with Twitter accountsEdit

plus optional Instagram and Facebook

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    , Twitter username (P2002)    , country (P17)    , Facebook ID (P2013)    , Instagram username (P2003)    
    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 afterEdit

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    , named after (P138)    , country (P17)    
    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 sitesEdit

The following query uses these:

Features: Map (Q24515275)    

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 sitesEdit

The following query uses these:

Features: Map (Q24515275)    

 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 ScienceEdit

Things that stars, galaxies, star clusters and nebulae are named afterEdit

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    , named after (P138)    
    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 afterEdit

The following query uses these:

Things that spacecraft are named afterEdit

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    , named after (P138)    
    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 starsEdit

The following query uses these:

  • Properties: subclass of (P279)    , instance of (P31)    , discoverer or inventor (P61)    
     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 instrumentsEdit

The following query uses these:

BiosphereEdit

See w:Wikipedia:WikiProject_United_Nations/Biosphere_Reserve_Descriptions

Map of Biosphere reserves with an entry and location in Wikidata but not in English WikipediaEdit

The following query uses these:

Features: Map (Q24515275)    

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 articleEdit

The following query uses these:

Features: Map (Q24515275)    

 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 locationEdit

The following query uses these:

  • Properties: UNESCO Biosphere Reserve url (P2520)    , coordinate location (P625)    
    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  }
    

MusicEdit

Lutenists ordered by year of birthEdit

The following query uses these:

  • Properties: instrument (P1303)    , date of birth (P569)    , place of birth (P19)    
     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)
    

ArtworksEdit

Birthplaces of painters in the Rijksmuseum collection (based on query by Jane Darnell)Edit

The following query uses these:

Features: Map (Q24515275)    

 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 RijksmuseumEdit

The following query uses these:

Features: ImageGrid (Q24515278)    

 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 womenEdit

The following query uses these:

Features: Graph (Q24515287)    

 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 artsEdit

The following query uses these:

Features: Graph (Q24515287)    

 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 venuesEdit

Art venues in the UK, but not pubsEdit

The following query uses these:

Features: Map (Q24515275)    

 1 #defaultView:Map{"hide":["?coord"]}
 2 SELECT DISTINCT ?item ?itemLabel ?url ?coord WHERE {
 3   VALUES ?type {wd:Q15090615 wd:Q7062022} # Arts venues + not-for-profit arts organisations
 4   ?item (wdt:P31/wdt:P279*) ?type. 
 5   ?item wdt:P17 wd:Q145. # in the UK
 6   MINUS {?item wdt:P31 wd:Q212198} # Exclude pubs
 7   OPTIONAL{?item wdt:P625 ?itemcoord}
 8   OPTIONAL {?item wdt:P131/wdt:P625 ?wherecoord}
 9   OPTIONAL {?item wdt:P856 ?url}
10   BIND(IF(BOUND(?itemcoord), ?itemcoord, ?wherecoord) AS ?coord)
11   SERVICE wikibase:label {
12     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
13   }
14 }

All art exhibitions known to WikidataEdit

The following query uses these:

PoemsEdit

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 languagesEdit

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    , publication date (P577)    , inception (P571)    , author (P50)    , language of work or name (P407)    
     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:P407 ?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 elsewhereEdit

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    , author (P50)    , full work available at (P953)    
    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
  • 1430 results as of 17 October 2018

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 knownEdit

The following query uses these:

  • Properties: occupation (P106)    , country of citizenship (P27)    , date of birth (P569)    , date of death (P570)    , VIAF ID (P214)    
     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 occupationsEdit

The following query uses these:

  • Properties: author (P50)    , instance of (P31)    , subclass of (P279)    , occupation (P106)    
    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 worksEdit

The following query uses these:

  • Properties: author (P50)    , occupation (P106)    , notable work (P800)    
    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 CoatesEdit

The following query uses these:

  • Properties: author (P50)    , publication date (P577)    , first line (P1922)    
    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 linesEdit

What kinds of things have first lines?Edit

The following query uses these:

  • Properties: first line (P1922)    , instance of (P31)    
    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 linesEdit

The following query uses these:

  • Properties: first line (P1922)    , ISO 639-1 code (P218)    , original language of film or TV show (P364)    
    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 workEdit

The following query uses these:

  • Properties: first line (P1922)    , language of work or name (P407)    , author (P50)    , ISO 639-1 code (P218)    
    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 maintenanceEdit

English Wikisource texts with a Wikidata entry but no indication of what they areEdit

Priority given to those that have more statements in Wikidata

The following query uses these:

  • Properties: instance of (P31)    , subclass of (P279)    
     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 typeEdit

The following query uses these:

  • Properties: instance of (P31)    , publication date (P577)    , subclass of (P279)    
     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 EnglishEdit

The following query uses these:

  • Properties: Project Gutenberg author ID (P1938)    , date of death (P570)    , languages spoken, written or signed (P1412)    
     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
    

LettersEdit

See also Q1784733 Correspondence

Authors of notable letters, by number of lettersEdit

The following query uses these:

  • Properties: author (P50)    , instance of (P31)    
    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 lettersEdit

The following query uses these: