User:Richard Nevell

From Wikidata
Jump to navigation Jump to search

Worked on:

Will add more to:

Example queries[edit]

Map of archaeological sites in the United Kingdom[edit]

The following query uses these:

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

1 # UK archaeological site on a map (must have coordinates!)
2 #defaultView:Map
3 SELECT ?library ?libraryLabel ?coords WHERE {
4   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". }
5   ?library (wdt:P31/wdt:P279*) wd:Q839954.
6   ?library wdt:P17 wd:Q145.
7   ?library wdt:P625 ?coords.
8 }


Map of castles in the United Kingdom[edit]

The following query uses these:

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

1 # Castles on a map (must have coordinates!)
2 #defaultView:Map
3 SELECT ?library ?libraryLabel ?coords WHERE {
4   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". }
5   ?library (wdt:P31/wdt:P279*) wd:Q23413.
6   ?library wdt:P17 wd:Q145.
7   ?library wdt:P625 ?coords.
8 }

Castles per year per country[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, inception (P571) View with Reasonator View with SQID, country (P17) View with Reasonator View with SQID
     1 #defaultView:BarChart
     2 SELECT (SAMPLE(?year) AS ?year) (COUNT(?_country) AS ?count) (SAMPLE(?_countryLabel) AS ?_countryLabel) WHERE {
     3   ?object wdt:P31/wdt:P279* wd:Q23413. # Castles or subtypes
     4   BIND(STR(YEAR(?_inception)) AS ?year)
     5   ?object wdt:P571 ?_inception;
     6           wdt:P17 ?_country.
     7 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
     8                         ?_country rdfs:label ?_countryLabel. }
     9 }
    10 GROUP BY ?year ?_country
    11 ORDER BY ?_countryLabel
    

Map of slighted places[edit]

The following query uses these:

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

1 #defaultView:Map
2 SELECT * WHERE {
3   ?item wdt:P793 wd:Q2238935;
4         wdt:P625 ?geo .
5 }

Papers in Chateau Gaillard without the subject of castellology[edit]

The following query uses these:

  • Properties: published in (P1433) View with Reasonator View with SQID, main subject (P921) View with Reasonator View with SQID
    1 SELECT ?paper ?paperLabel
    2 WHERE
    3 {
    4     ?paper wdt:P1433 wd:Q27443263 .
    5     MINUS { ?paper wdt:P921 wd:Q2941393 } .
    6 	SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
    7 }
    

Image gallery of paintings from Kenwood House[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:Q764804 ;  # in collection Kenwood House
 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

Birthplaces of painters in the Kenwood House 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:Q764804 ;  # in collection Kenwood House
 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 }


People most cited by a particular author[edit]

The following query uses these:

  • Properties: author (P50) View with Reasonator View with SQID, cites work (P2860) View with Reasonator View with SQID, ORCID iD (P496) View with Reasonator View with SQID
     1 #defaultView:Table
     2 SELECT
     3   ?count
     4   ?citing_author ?citing_authorLabel
     5 
     6   # Either show the ORCID iD or construct part of a URL to search on the ORCID homepage
     7   (COALESCE(?orcid_, CONCAT("orcid-search/quick-search/?searchQuery=", ENCODE_FOR_URI(?citing_authorLabel))) AS ?orcid)
     8 WITH {
     9   SELECT (COUNT(?citing_work) AS ?count) ?citing_author WHERE {
    10     ?work wdt:P50 wd:Q42712203 .
    11     ?citing_work ^wdt:P2860 ?work . 
    12     MINUS { ?citing_work wdt:P50 wd:Q42712203 }
    13     ?citing_work wdt:P50 ?citing_author .
    14   }
    15   GROUP BY ?citing_author 
    16   ORDER BY DESC(?count)
    17   LIMIT 500
    18 } AS %counts
    19 WITH {
    20   # An author might have multiple ORCID iDs
    21   SELECT
    22     ?count
    23     ?citing_author
    24     (SAMPLE(?orcids) AS ?orcid_)
    25   WHERE {
    26     INCLUDE %counts
    27     OPTIONAL { ?citing_author wdt:P496 ?orcids }
    28   }
    29   GROUP BY ?count ?citing_author
    30 } AS %result
    31 WHERE {
    32   INCLUDE %result
    33   
    34   SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh". }
    35 } 
    36 ORDER BY DESC(?count)
    


Missing authors most cited often by a particular author[edit]

http://w.wiki/3i2

Most-cited author name strings for a given subject[edit]

https://w.wiki/5wU

Journal articles with lots of outgoing citations but few or no topics[edit]

https://w.wiki/6rb