User:MartinPoulter/queries/collections

See also Wikidata:WikiProject_Heritage_institutions/Tools_&_tasks#Sample_Queries

How many collections are represented in the Sum of all Paintings dataset? edit

SELECT (COUNT(DISTINCT ?coll) AS ?count) WHERE {
?obj wdt:P31/wdt:P279* wd:Q3305213. ?obj wdt:P195 ?coll FILTER (!CONTAINS(STR(?coll), "well-known"))
}
Try it!

Self-portraits of women: Image grid edit

#defaultView:ImageGrid
SELECT ?p ?pLabel ?aLabel (SAMPLE(?image) AS ?img) (YEAR(?date) as ?year) WHERE {
?p wdt:P31 wd:Q3305213; wdt:P170 ?a; wdt:P136 wd:Q192110 ; wdt:P18 ?image. ?a wdt:P21 wd:Q6581072
OPTIONAL {?p wdt:P571 ?date}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?p ?pLabel ?aLabel ?date 
ORDER BY ?year
Try it!

Art museums (global map) edit

#defaultView:Map{"hide": "?coords"}
SELECT DISTINCT ?museum ?museumLabel (SAMPLE(?coords) AS ?coords) (SAMPLE(?image) AS ?image) ?url WHERE {
?museum wdt:P31 wd:Q207694 . ?museum wdt:P625 ?coords
OPTIONAL {?museum wdt:P18 ?image}
OPTIONAL {?museum wdt:P856 ?url}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?museum rdfs:label ?museumLabel }
} GROUP BY ?museum ?museumLabel ?url
Try it!

How many Wikidata things have the "in collection" property edit

The following query uses these:

  • Properties: collection (P195)  View with Reasonator View with SQID, end time (P582)  View with Reasonator View with SQID
    SELECT (COUNT(?obj) AS ?count)  WHERE {
    ?obj p:P195 ?s.
    ?s ps:P195 ?collection.
    MINUS { ?s pq:P582 [] }
    }
    
  • As of 25 November 2017: 314,221. An extra 1,150 if we allow relations that have an end date.
  • As of 2 October 2017: 464,608.
  • As of 29 August 2019: 1,092,686.

Collection sizes edit

The following query uses these:

  • Properties: part of (P361)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, country (P17)  View with Reasonator View with SQID, collection or exhibition size (P1436)  View with Reasonator View with SQID, applies to part (P518)  View with Reasonator View with SQID
    SELECT ?collection ?collectionLabel ?partofLabel ?countryLabel ?size ?partLabel WHERE {
    ?collection p:P1436 ?s.
      ?s ps:P1436 ?size
      OPTIONAL {?s pq:P518 ?part}
      OPTIONAL {?collection wdt:P361 ?partof . # Get the organisation the collection is part of
                MINUS{ ?partof wdt:P31 wd:Q13406463 } } # but not Wikimedia list articles
      OPTIONAL {?collection wdt:P17 ?country}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
      FILTER (?size > 100)
    } ORDER BY DESC(?size)
    

Oldest institution in each country that now acts as a museum edit

SELECT DISTINCT ?countryLabel ?museum ?museumLabel (YEAR(?earliest) as ?year) WHERE {
{ SELECT ?country (MIN(?inception) as ?earliest) WHERE {
    ?museum wdt:P31/wdt:P279? wd:Q33506 ; wdt:P131?/wdt:P17 ?country; wdt:P571 ?inception
    } GROUP BY ?country }
?museum wdt:P31/wdt:P279? wd:Q33506 ; wdt:P131?/wdt:P17 ?country; wdt:P571 ?earliest.
MINUS {?country wdt:P576 []} # Exclude abolished countries like the Austrian Empire
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?countryLabel
Try it!

Number of items in Wikidata with each collection property edit

The following query uses these:

  • Properties: part of (P361)  View with Reasonator View with SQID, collection (P195)  View with Reasonator View with SQID, end time (P582)  View with Reasonator View with SQID
    SELECT (COUNT(?obj) AS ?count) ?collection ?collectionLabel ?partofLabel WHERE {
    ?obj p:P195 ?s.
    ?s ps:P195 ?collection.
    MINUS { ?s pq:P582 [] }
    OPTIONAL { ?collection wdt:P361 ?partof }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    } GROUP BY ?collection ?collectionLabel ?partofLabel
    ORDER BY DESC(?count)
    LIMIT 100
    

Most common properties of objects in a given collection edit

The following query uses these:

Properties that items from two collections have in common edit

The following query uses these:

  • Properties: collection (P195)  View with Reasonator View with SQID, depicts (P180)  View with Reasonator View with SQID, creator (P170)  View with Reasonator View with SQID, time period (P2348)  View with Reasonator View with SQID, movement (P135)  View with Reasonator View with SQID, genre (P136)  View with Reasonator View with SQID, inspired by (P941)  View with Reasonator View with SQID, made from material (P186)  View with Reasonator View with SQID, location of creation (P1071)  View with Reasonator View with SQID
    #defaultView:ScatterChart
    SELECT (?count1 AS ?in_Tate) (?count2 AS ?in_Smithsonian) (CONCAT(?propertyLabel,": ",?thingLabel)AS ?attribute) WHERE {
    { SELECT (COUNT(?obj1) AS ?count1) ?property ?thing WHERE {
     ?obj1 wdt:P195 wd:Q430682. #Tate
     VALUES ?prop1 {wdt:P180 wdt:P170 wdt:P2348 wdt:P135 wdt:P136 wdt:P941 wdt:P186 wdt:P1071}
     ?obj1 ?prop1 ?thing.
     ?property ?ref ?prop1 ; 
               rdf:type wikibase:Property .
      } GROUP BY ?property ?thing }
    { SELECT (COUNT(?obj2) AS ?count2) ?property ?thing WHERE {
     ?obj2 wdt:P195 wd:Q1192305. #Smithsonian
     VALUES ?prop1 {wdt:P180 wdt:P170 wdt:P2348 wdt:P135 wdt:P136 wdt:P941 wdt:P186 wdt:P1071}
     ?obj2 ?prop1 ?thing.
     ?property ?ref ?prop1 ;
               rdf:type wikibase:Property .
      } GROUP BY ?property ?thing }
     FILTER (?count2 >2 )
     FILTER (?count1 >2 )
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?property rdfs:label ?propertyLabel .?thing rdfs:label ?thingLabel }
    }
    

Refined version of above that just focuses on artists in common edit

The following query uses these:

  • Properties: collection (P195)  View with Reasonator View with SQID, creator (P170)  View with Reasonator View with SQID
    #defaultView:ScatterChart
    SELECT (?count1 AS ?in_Tate) (?count2 AS ?in_NPG) ?artist WHERE {
    { SELECT (COUNT(?obj1) AS ?count1) ?creator WHERE {
     ?obj1 wdt:P195 wd:Q430682. #Tate
     ?obj1 wdt:P170 ?creator.
      } GROUP BY ?creator }
    { SELECT (COUNT(?obj2) AS ?count2) ?creator WHERE {
     ?obj2 wdt:P195 wd:Q238587. #National Portrait Gallery
     ?obj2 wdt:P170 ?creator.
      } GROUP BY ?creator }
     FILTER (?creator != wd:Q4233718) # exclude anonymous works
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?creator rdfs:label ?artist }
    }
    

Artists who died before the 19th century edit

SELECT DISTINCT ?artist ?artistLabel ?genderLabel ?countryLabel (year(?death) as ?deathyear) #?birthyear ?flyear 
WHERE {
  ?artist wdt:P31 wd:Q5 ; wdt:P106/wdt:P279? wd:Q1028181 .
?artist wdt:P570 ?death FILTER(year(?death)<1800).
OPTIONAL{?artist wdt:P21 ?gender}
OPTIONAL{?artist wdt:P27 ?country}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?deathyear)
Try it!

Artists with no English Wikipedia article but an article in other languages edit

#title:People with a Benezit or Grove Art online link with sitelinks but no English Wikipedia article
SELECT DISTINCT ?artist ?artistLabel ?countryLabel ?links ?benezit_id ?grove_id WHERE {
{ ?artist wdt:P2843 ?benezit_id } UNION { ?artist wdt:P8406 ?grove_id }
  ?artist wikibase:sitelinks ?links FILTER (?links > 0).
  ?artist wdt:P31 wd:Q5.
  ?artist wdt:P27 ?country.
  FILTER NOT EXISTS{?enwp schema:about ?artist; schema:inLanguage "en"}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?links)
People with a Benezit or Grove Art online link with sitelinks but no English Wikipedia article

Paintings by Russian artists from around the time of the Russian Revolution edit

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, creator (P170)  View with Reasonator View with SQID, country of citizenship (P27)  View with Reasonator View with SQID, image (P18)  View with Reasonator View with SQID, inception (P571)  View with Reasonator View with SQID
    #title:Paintings by Russian artists from around the time of the Russian Revolution
    SELECT ?work ?workLabel ?artistLabel ?date ?datePrecision ?image WHERE {
      ?work wdt:P31 wd:Q3305213 # paintings
            ; wdt:P170 ?artist .
      ?artist wdt:P27 wd:Q34266. # artist's nationality: Russian Empire
      ?work p:P571/psv:P571 ?node .
      ?node wikibase:timeValue ?date ; # date of painting
       wikibase:timePrecision ?datePrecision # precision of date (e.g. day, month, year)
            BIND(YEAR(?date) as ?year) FILTER(?year > 1905) FILTER(?year < 1930) #specify date range
            FILTER (?datePrecision > 8) # known year
     .?work wdt:P18 ?image # only show art that Commons has an image for
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,ru,et,de,fr". }
    }
    

This query as a Histropedia timeline

Landscape art that is taller than it is wide edit

#defaultView:ImageGrid
#title:Landscape art that is taller than it is wide
SELECT ?i ?iLabel ?iDescription (SAMPLE(?collLabel) AS ?collection) (SAMPLE(?img) AS ?image) WHERE {
?i wdt:P31 wd:Q3305213.
  ?i wdt:P136 wd:Q191163 .
     ?i wdt:P2048 ?height.
     ?i wdt:P2049 ?width.
    FILTER (?height > ?width)
  ?i wdt:P18 ?img.
  ?i wdt:P195 ?coll.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                        ?coll rdfs:label ?collLabel . ?i rdfs:label ?iLabel .
                       ?i schema:description ?iDescription }
} GROUP BY ?i ?iLabel ?iDescription
Landscape art that is taller than it is wide

Random selection of images from a collection edit

In theory, results should change each day.

#defaultView:ImageGrid
SELECT ?item ?itemLabel (SAMPLE(?img) AS ?image) WHERE {
  ?item wdt:P195 wd:Q109893034 .
  ?item wdt:P18 ?img
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  BIND(SHA512(CONCAT(STR(RAND()), STR(NOW()), STR(?item))) AS ?random)
} GROUP BY ?item ?itemLabel
ORDER BY ?random
LIMIT 20
Try it!

Items of type "oil painting" that don't include oil paint as a material edit

SELECT ?item ?itemLabel ?itemDescription ?collectionLabel WHERE {
?item wdt:P31 wd:Q56676227
      MINUS {?item wdt:P186 wd:Q296955}
OPTIONAL {?item wdt:P195 ?collection}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

3D scan files of items from collections edit

SELECT ?item ?itemLabel ?itemDescription ?model WHERE {
?item wdt:P4896 ?model; wdt:P195 [].
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr" }
} ORDER BY ?itemLabel
Try it!

Depictions in common between Ashmolean Museum and Cleveland Museum of Art edit

SELECT ?depicted ?depictedLabel ?ashcount ?ashexample ?ashexampleLabel ?clevcount ?clevexample ?clevexampleLabel WHERE {
{SELECT ?depicted (Sample(?itemash) AS ?ashexample) (COUNT(DISTINCT ?itemash) AS ?ashcount) (sample(?itemclev) as ?clevexample) (COUNT(DISTINCT ?itemclev) AS ?clevcount) WHERE {
?itemclev wdt:P195 wd:Q657415; wdt:P180 ?depicted.
?itemash wdt:P195 wd:Q636400 ; wdt:P180 ?depicted.
  } GROUP BY ?depicted }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?ashcount + ?clevcount)
Try it!

Cleveland Museum of Art items with no "depicts" property edit

#defaultView:ImageGrid
SELECT DISTINCT ?item ?itemLabel ?id ?img WHERE {
  ?item p:P217 [ps:P217 ?id; pq:P195 wd:Q657415] .
  ?item wdt:P5008 wd:Q60729883 .
  OPTIONAL { ?item wdt:P18 ?img } .
  MINUS { ?item wdt:P180 [] }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Manuscripts edit

Image gallery of notable manuscripts (which have an image on Wikimedia Commons) edit

The following query uses these:

Features: ImageGrid (Q24515278)     

#defaultView:ImageGrid
SELECT ?link (MIN(?image) AS ?img) ?qLabel (COUNT(DISTINCT ?sitelink) AS ?linkcount) WHERE {
  ?q (wdt:P31/wdt:P279*) wd:Q87167.
  FILTER (?q != wd:Q145780) # Exclude Dead Sea Scrolls: too broad
  ?sitelink schema:about ?q.
  ?q wdt:P18 ?image.
  BIND(URI(CONCAT("http://example.org/test/manuscripts/index.php?q=manuscript/",SUBSTR(STR(?q),32))) AS ?link)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?q rdfs:label ?qLabel.
  }
}
GROUP BY ?link ?qLabel
ORDER BY DESC(?linkcount)
LIMIT 100

The most notable manuscripts and their collections edit

The following query uses these:

  • Properties: instance of (P31)     , subclass of (P279)     , language of work or name (P407)     , collection (P195)     , end time (P582)     
    SELECT ?q ?qLabel (GROUP_CONCAT(DISTINCT ?collectionLabel; separator="; ") AS ?where) ?enwp (GROUP_CONCAT(DISTINCT ?langLabel; separator=", ") AS ?languages) ?linkcount
    WHERE { {SELECT ?q (COUNT(?sitelink) AS ?linkcount) WHERE {  ?q (wdt:P31/wdt:P279*) wd:Q87167. ?sitelink schema:about ?q }
       GROUP BY ?q  }
    ?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
          MINUS {?s ps:P195 wd:Q1322278 }
    OPTIONAL{ ?q wdt:P407 ?lang }
      SERVICE wikibase:label {
        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
        ?q rdfs:label ?qLabel. ?collection rdfs:label ?collectionLabel . ?lang rdfs:label ?langLabel
      }
     OPTIONAL{?enwp schema:about ?q ; schema:isPartOf <https://en.wikipedia.org/> }
     # other props: inventory number; part of ; full work (P953); Commons cat; described at (P973)
    }
    GROUP BY ?q ?qLabel ?enwp ?linkcount
    ORDER BY DESC(?linkcount)
    

The most notable manuscripts available via IIIF, with IIIF links edit

SELECT ?q ?qLabel (GROUP_CONCAT(DISTINCT ?collectionLabel; separator="; ") AS ?where)
(URI(CONCAT('https://tools.wmflabs.org/mirador/?manifest=', STR(?iiif))) AS ?iiiflink)
WHERE { 
  ?q (wdt:P31/wdt:P279*) wd:Q87167; wdt:P6108 ?iiif; wikibase:sitelinks ?sitecount FILTER(?sitecount > 0)
?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
      MINUS {?s ps:P195 wd:Q1322278 }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?q rdfs:label ?qLabel. ?collection rdfs:label ?collectionLabel
    }
}
GROUP BY ?q ?qLabel ?iiif ?sitecount
ORDER BY DESC(?sitecount)
Try it!

Notable manuscripts and their collections (full query) edit

The following query uses these:

  • Properties: instance of (P31)     , subclass of (P279)     , image (P18)     , language of work or name (P407)     , collection (P195)     , end time (P582)     , inventory number (P217)     
    SELECT ?q ?qLabel (GROUP_CONCAT(DISTINCT ?collplusinv; separator=" !!! ") AS ?where) (GROUP_CONCAT(DISTINCT ?lang; separator=" ") AS ?languages) ?linkcount (SAMPLE(?image) AS ?image)
    WHERE { {SELECT ?q (COUNT(?sitelink) AS ?linkcount) WHERE { ?q (wdt:P31/wdt:P279*) wd:Q87167. OPTIONAL {?sitelink schema:about ?q} }
       GROUP BY ?q  }
    ?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
          MINUS {?s ps:P195 wd:Q1322278 }
    OPTIONAL{ ?s pq:P217 ?inventory}
    OPTIONAL{ ?q wdt:P18 ?image }
    BIND( IF(BOUND(?inventory), CONCAT(STR(?collection)," ",?inventory), STR(?collection)) AS ?collplusinv).
     SERVICE wikibase:label {
       bd:serviceParam wikibase:language "en,fr,it,de,es,ru,bg,ca,cs,nl,zh,ja".
       ?q rdfs:label ?qLabel.
     }
    OPTIONAL{ ?q wdt:P407 ?lang }
    # other props: part of, exemplar
    }
    GROUP BY ?q ?qLabel ?linkcount
    ORDER BY DESC(?linkcount)
    

Collections of manuscripts edit

The following query uses these:

  • Properties: instance of (P31)     , subclass of (P279)     , official website (P856)     , collection (P195)     , end time (P582)     
    SELECT ?collection ?l (GROUP_CONCAT(DISTINCT ?officialweb) AS ?webs) (COUNT(DISTINCT ?q) AS ?mcount)
    WHERE {
    ?q (wdt:P31/wdt:P279*) wd:Q87167.
    ?q p:P195 ?s. ?s ps:P195 ?collection. MINUS {?s pq:P582 []}.
    MINUS { ?s ps:P195 wd:Q1322278 }
    OPTIONAL{ ?collection wdt:P856 ?officialweb } 
      SERVICE wikibase:label {
        bd:serviceParam wikibase:language "en".
    ?collection rdfs:label ?l
      }
    }
    GROUP BY ?collection ?l
    ORDER BY UCASE(?l)
    

Manuscripts (and some other things) in the Matenadaran collection edit

#title:Things in the Matenadaran collection
SELECT ?item ?itemLabel (GROUP_CONCAT(?typeLabel; separator=", ") AS ?thing) (YEAR(?date) AS ?year) ?image WHERE {
  ?item wdt:P195 wd:Q1322278
  OPTIONAL {?item wdt:P31 ?type}
  OPTIONAL {?item wdt:P571 ?date}
  OPTIONAL {?item wdt:P18 ?image}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,hy".
                          ?item rdfs:label ?itemLabel. ?type rdfs:label ?typeLabel}
} GROUP BY ?item ?itemLabel ?date ?image
ORDER BY DESC(?image) ?year
Things in the Matenadaran collection

Languages of manuscripts edit

The following query uses these:

Top ten languages by number of manuscripts edit

SELECT (SUBSTR(STR(?lang),32) AS ?wd) (COUNT(DISTINCT ?q) AS ?mcount)
WHERE {
?q (wdt:P31/wdt:P279*) wd:Q87167.
?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
MINUS { ?s ps:P195 wd:Q1322278 }
?q wdt:P407 ?lang 
}
GROUP BY ?lang
ORDER BY DESC(?mcount)
LIMIT 10
Try it!

Materials used in manuscripts edit

The following query uses these:

Map of manuscript collections edit

The following query uses these:

Features: map (Q24515275)     

#defaultView:Map
SELECT ?link ?collectionLabel ?coords
WHERE {
{SELECT DISTINCT ?collection ?coords WHERE {?q (wdt:P31/wdt:P279*) wd:Q87167;
  wdt:P195 ?collection .
?collection wdt:P625 ?coords.
} }
BIND (URI(CONCAT("/collection/",SUBSTR(STR(?collection),32))) AS ?link).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Manuscripts lacking a collection edit

The following query uses these:

  • Properties: instance of (P31)     , subclass of (P279)     , collection (P195)     
    SELECT DISTINCT ?q ?qLabel ?qDescription ?enwp 
    WHERE { 
    ?q (wdt:P31/wdt:P279*) wd:Q87167.   
    MINUS { ?q wdt:P195 []}
      SERVICE wikibase:label {
        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
      }
     OPTIONAL{?enwp schema:about ?q ; schema:isPartOf <https://en.wikipedia.org/> }
    }
    ORDER BY DESC(?qLabel)
    

Objects with "instance of papyrus" (which shouldn't be the case) edit

SELECT * WHERE {
?item wdt:P31 wd:Q125576
}
Try it!

Bodleian things and their online digitizations edit

SELECT ?thing ?thingLabel ?inv ?url WHERE {
VALUES ?in {wd:Q82133 wd:Q2210813} # Bodleian and Sackler
?thing p:P195 ?s; wdt:P953 ?url FILTER(CONTAINS(STR(?url),"ox.ac.uk")).
?s ps:P195 ?in
OPTIONAL { ?s pq:P217 ?inv }
MINUS {?thing wdt:P1433 []}
MINUS {?thing wdt:P361 []}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?thingLabel
Try it!

Bodleian items with no image and no Commons category edit

SELECT ?item ?itemLabel ?url WHERE {
VALUES ?in {wd:Q82133 wd:Q2210813} # Bodleian and Sackler
?item wdt:P195 ?in; wdt:P953 ?url
MINUS {?item wdt:P18 []}
MINUS {?item wdt:P373 []}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Manuscripts of the Quran edit

SELECT DISTINCT ?item ?itemLabel ?collectionLabel ?inventory ?url ?image WHERE {
  {?item wdt:P1574 wd:Q428 } UNION { ?item wdt:P1574/wdt:P31 wd:Q234262 } # Exemplar of Quran or of an individual Sura
  ?item p:P217 [ps:P217 ?inventory; pq:P195 ?collection]
  OPTIONAL {?item wdt:P973 ?url}
  OPTIONAL {?item wdt:P18 ?image}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?collectionLabel ?inventory
Try it!

Timeline of Shahnameh manuscripts edit

#title:Shahnameh manuscripts
SELECT DISTINCT ?item ?itemLabel ?placeLabel ?pubdate ?pubdatePrecision ?url ?img WHERE {
   ?item wdt:P1574 wd:Q8279.
    ?item p:P571/psv:P571 ?pubdateStatementNode.
?pubdateStatementNode wikibase:timeValue ?pubdate ;
   wikibase:timePrecision ?pubdatePrecision # get precision of the creation date
  OPTIONAL {?item wdt:P1071 ?place}
  OPTIONAL {?item wdt:P973 ?url}
  OPTIONAL {?item wdt:P18 ?img}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Shahnameh manuscripts

This timeline in HistropediaJS

Ashmolean Museum edit

Things in the collection of the Ashmolean museum edit

SELECT ?type ?typeLabel (COUNT(?item) AS ?count) WHERE {
?item wdt:P195 wd:Q636400;
      wdt:P31 ?type.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?type ?typeLabel ORDER BY DESC(?count)
Try it!

Creators: comparison of Ashmolean items versus items in other GLAMs edit

SELECT DISTINCT ?creator ?creatorLabel ?creatorDescription ?enwp ?ash_items (COUNT(?other) as ?other) WHERE {
{ SELECT ?creator ?enwp (COUNT(?item) AS ?ash_items) WHERE {
  ?item wdt:P195 wd:Q636400; # collection: Ashmolean
 wdt:P170 ?creator FILTER (?creator != wd:Q4233718) # Exclude anonymous
  OPTIONAL { ?enwp schema:about ?creator; schema:isPartOf <https://en.wikipedia.org/> }
  } GROUP BY ?creator ?enwp
 }
?other wdt:P170 ?creator MINUS {?other wdt:P195 wd:Q636400} # objects by same creator but not in Ashmolean
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?creator ?creatorLabel ?creatorDescription ?enwp ?ash_items
ORDER BY DESC(?ash_items) DESC(?other)
Try it!

People associated with Ashmolean items edit

SELECT ?person ?personLabel ?personDescription (SAMPLE(?image) AS ?img) (COUNT(?item) AS ?count) (YEAR(SAMPLE(?time)) AS ?year) WHERE {
?item wdt:P195 wd:Q636400; wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
?item ?prop ?person.
?person wdt:P31 wd:Q5.
OPTIONAL {?person wdt:P18 ?image}
OPTIONAL {?person wdt:P569 ?birth}
OPTIONAL {?person wdt:P1317 ?fl}
OPTIONAL {?person wdt:P2348/wdt:P580 ?erastart}
BIND(IF(BOUND(?birth), ?birth, IF(BOUND(?fl), ?fl, ?erastart) ) AS ?time). 
SERVICE wikibase:label {bd:serviceParam wikibase:language "en"}
} GROUP BY ?person ?personLabel ?personDescription ORDER BY ?year
Try it!

Artists in the Ashmolean with entries in Benezit Dictionary of Artists edit

SELECT ?artist ?artistLabel (URI(CONCAT("http://oxfordindex.oup.com/view/10.1093/benz/9780199773787.article.",?benezit)) AS ?benezit_link) (COUNT(?work) AS ?count) WHERE {
?work wdt:P195 wd:Q636400; wdt:P170 ?artist FILTER (!ISBLANK(?artist)) .
?artist wdt:P2843 ?benezit
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?artist ?artistLabel ?benezit
ORDER BY ?artistLabel
Try it!

timeline of Ashmolean artists with links to Benezit

Getty Union List of Artist Names links for Ashmolean artists edit

SELECT ?artist ?artistLabel (URI(CONCAT("http://vocab.getty.edu/page/ulan/",?getty_id)) AS ?getty_link) (COUNT(?work) AS ?count) WHERE {
?work wdt:P195 wd:Q636400; wdt:P170 ?artist FILTER (!ISBLANK(?artist)) .
?artist wdt:P245 ?getty_id
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?artist ?artistLabel ?getty_id
ORDER BY ?artistLabel
Try it!

Languages of Wikipedia articles about Ashmolean artists edit

SELECT ?languageLabel (COUNT(?sitelink) AS ?count) WITH { SELECT DISTINCT ?artist { ?work wdt:P195 wd:Q636400; wdt:P170 ?artist FILTER (!ISBLANK(?artist)) } } AS %artists WHERE {
INCLUDE %artists.
?sitelink schema:about ?artist; schema:inLanguage ?lang FILTER (CONTAINS(STR(?sitelink), ".wikipedia.org"))
?language wdt:P218 ?lang.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?languageLabel
ORDER BY DESC(?count)
Try it!

Things depicted (but not places) edit

SELECT ?person ?personLabel ?personDescription (SAMPLE(?image) AS ?img) (COUNT(?item) AS ?count) WHERE {
?item wdt:P195 wd:Q636400; wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
?item wdt:P180 ?person.
MINUS {?person wdt:P625 []}
OPTIONAL {?person wdt:P18 ?image}
SERVICE wikibase:label {bd:serviceParam wikibase:language "en". }
} GROUP BY ?person ?personLabel ?personDescription ORDER BY UCASE(?personLabel)
Try it!

Locations associated with Ashmolean items edit

#defaultView:Map{"hide": ["?latlong", "?layer"]}
SELECT (URI(CONCAT("http://glam-discovery.bodleian.ox.ac.uk/location/",SUBSTR(STR(?place),32) ) ) as ?link) ?placeX ?placeLabel ?layer (SAMPLE(?coords) AS ?latlong)
WHERE {
?item wdt:P195 wd:Q636400;
    wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
VALUES ?property {wd:P180 wd:P1071} # wdt:P921 wdt:P189 wdt:P138
?property wikibase:directClaim ?prop.
?item ?prop ?place.
?place wdt:P625 ?coords.
SERVICE wikibase:label {bd:serviceParam wikibase:language "en". 
?property rdfs:label ?layer. ?place rdfs:label ?placeLabel; schema:description ?placeX}
} GROUP BY ?place ?placeLabel ?placeX ?layer
Try it!

Ashmolean items associated with a given person or location edit

SELECT ?prop ?item ?itemLabel ?inventory (GROUP_CONCAT(?typeLabel; separator=", ") AS ?types) ?from (YEAR(?latest) AS ?to) ?precision WHERE {
?item p:P195 [ps:P195 wd:Q636400; pq:P217 ?inventory].
?item ?prop wd:Q48129717; wdt:P31 ?type.
OPTIONAL {?item p:P571 [pq:P1319 ?earliest; pq:P1326 ?latest] }
OPTIONAL {?item p:P571/psv:P571 [ wikibase:timePrecision ?precision; wikibase:timeValue ?year ] }
BIND(IF (BOUND(?earliest), YEAR(?earliest), YEAR(?year)) AS ?from)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?item rdfs:label ?itemLabel. ?type rdfs:label ?typeLabel }
} GROUP BY ?prop ?item ?itemLabel ?inventory ?from ?latest ?precision
ORDER BY DESC(?prop) ?from ?to
Try it!

Ashmolean people associated with a given location or era edit

SELECT ?person ?personLabel ?personDescription (SAMPLE(?image) AS ?img) (YEAR(SAMPLE(?time)) AS ?year) WHERE {
?item wdt:P195 wd:Q636400; wdt:P973 ?url FILTER (STRSTARTS(STR(?url), "http://jameelcentre") ).
?item ?prop ?person.
?person wdt:P31 wd:Q5.
?person ?prop2 wd:Q1490.
OPTIONAL {?person wdt:P18 ?image}
OPTIONAL {?person wdt:P569 ?birth}
OPTIONAL {?person wdt:P1317 ?fl}
OPTIONAL {?person wdt:P2348/wdt:P580 ?erastart}
BIND(IF(BOUND(?birth), ?birth, IF(BOUND(?fl), ?fl, ?erastart) ) AS ?time). 
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
} GROUP BY ?person ?personLabel ?personDescription ORDER BY ?year
Try it!

Locations associated with a given person edit

SELECT DISTINCT (SUBSTR(STR(?place),32) as ?link) ?propertyLabel ?placeLabel
WHERE {
wd:Q198984 ?prop ?place. ?place wdt:P625 [].
?property ?ref ?prop; rdf:type wikibase:Property.
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
}
Try it!

Ten nearest places to a place edit

SELECT DISTINCT (SUBSTR(STR(?place),32) as ?link) ?placeLabel
WHERE {
wd:Q1191 wdt:P625 ?loc2. #Starting point
{ SELECT DISTINCT ?place ?coords WHERE 
 {?item wdt:P195 wd:Q636400;
    wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
VALUES ?property {wd:P180 wd:P1071}
?property wikibase:directClaim ?prop.
?item ?prop ?place.
?place wdt:P625 ?coords
 } }
BIND(geof:distance(?coords, ?loc2) AS ?distNum).
SERVICE wikibase:label {bd:serviceParam wikibase:language "en". 
?place rdfs:label ?placeLabel}
} ORDER BY ?distNum OFFSET 1 LIMIT 10
Try it!

Materials of things in the Ashmolean collection edit

This is used to make materials.json

SELECT (SUBSTR(STR(?material), 32) as ?material) ?materialLabel ?materialDescription (COUNT(?item) AS ?count) WHERE {
?item wdt:P195 wd:Q636400; wdt:P186 ?material;
wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
} GROUP BY ?material ?materialLabel ?materialDescription ORDER BY UCASE(?materialLabel)
Try it!

Ashmolean items for a given material edit

SELECT ?item ?itemLabel ?inventory (GROUP_CONCAT(?typeLabel; separator=", ") AS ?types) (YEAR(?earliest) AS ?from) (YEAR(?latest) AS ?to) WHERE {
?item p:P195 [ps:P195 wd:Q636400; pq:P217 ?inventory].
?item wdt:P186 wd:Q37681; wdt:P31 ?type;
wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
OPTIONAL {?item p:P571 [pq:P1319 ?earliest; pq:P1326 ?latest] }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en".
?item rdfs:label ?itemLabel. ?type rdfs:label ?typeLabel}
} GROUP BY ?item ?itemLabel ?inventory ?earliest ?latest
ORDER BY ?from ?to ?itemLabel
Try it!

Types of things in the Ashmolean collection edit

used to make types.json

SELECT (SUBSTR(STR(?type), 32) as ?type) ?typeLabel ?typeDescription (COUNT(?item) AS ?count) WHERE {
?item wdt:P195 wd:Q636400; wdt:P31 ?type; wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?type ?typeLabel ?typeDescription ORDER BY UCASE(?typeLabel)
Try it!

Items of a given type edit

SELECT ?item ?itemLabel ?inventory (YEAR(?earliest) AS ?from) (YEAR(?latest) AS ?to) WHERE {
?item p:P195 [ps:P195 wd:Q636400; pq:P217 ?inventory].
?item wdt:P31 wd:Q1066288; wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
OPTIONAL {?item p:P571 [pq:P1319 ?earliest; pq:P1326 ?latest] }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .
?item rdfs:label ?itemLabel }
} ORDER BY ?from ?to ?itemLabel
Try it!

Ashmolean items without a label edit

As of 31 March 2018, gives zero results.

SELECT ?item WHERE {
?item wdt:P195 wd:Q636400.
MINUS {?item rdfs:label []}
}
Try it!

Ashmolean items without no inception date and no time period edit

SELECT ?item ?inventory WHERE {
?item p:P195 [ps:P195 wd:Q636400; pq:P217 ?inventory].
MINUS {?item wdt:P571 []}
MINUS {?item wdt:P2348 []}
}
Try it!

Ashmolean things named "Figure of " but with no depiction property edit

Also includes "Standing figure of...", "Seated figure of..."

SELECT ?item ?itemLabel ?url WHERE {
?item wdt:P195 wd:Q636400; wdt:P973 ?url
MINUS {?item wdt:P180 []}
?item rdfs:label ?itemLabel filter( lang(?itemLabel)="en" ) filter( CONTAINS(?itemLabel, "igure of ") )
}
Try it!

Jameel items ordered by number of statements edit

SELECT ?item ?itemLabel ?url ?count WHERE {
?item wdt:P195 wd:Q636400; wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
?item wikibase:statements ?count.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?count)
LIMIT 20
Try it!

Count of links from Jameel items to items that have a location edit

SELECT (COUNT(?loc) as ?count) WHERE {
?item wdt:P195 wd:Q636400; wdt:P973 ?url FILTER (STRSTARTS(STR(?url),"http://jameelcentre") ).
?item ?prop ?loc. ?loc wdt:P625 [] FILTER (?loc != wd:Q636400)
}
Try it!

Wikipedia pages about Ashmolean items in languages other than English edit

SELECT ?itemLabel ?inv ?languageLabel ?sitelink WHERE {
?item wdt:P195 wd:Q636400; wdt:P217 ?inv # items in the Ashmolean and get their inventory number
      FILTER (?item != wd:Q1249435) .    # exclude Oxyrhynchus Papyri
?sitelink schema:about ?item;            # Wikimedia links (usually Wikipedia articles)
          schema:inLanguage ?lang FILTER (?lang != 'en') FILTER (?lang != 'en-simple') . # exclude English language
?language wdt:P305 ?lang                 # convert two-letter code to language item
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?inv
Try it!

web.ashmolean.org items without an Ashmolean Museum ID edit

SELECT ?item ?itemLabel ?itemDescription ?url WHERE {
?item wdt:P195 wd:Q636400.
?item wdt:P973 ?url FILTER( CONTAINS(STR(?url), "www.ashmolean.org") )
   MINUS {?item wdt:P6610 []}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Things in the Ashmolean that have gold as their only material edit

Should give no results (no results as of 19 May 2019)

SELECT ?item ?url WHERE {
?item wdt:P195 wd:Q636400; # collection: Ashmolean
wdt:P31 wd:Q3305213; # type: painting
wdt:P186 wd:Q897  # material: gold
MINUS {?item wdt:P186 ?mat FILTER (?mat != wd:Q897) } # no non-gold material
OPTIONAL {?item wdt:P973 ?url}
}
Try it!

Things with two different Ashmolean Museum identifiers (should give no results) edit

SELECT * WHERE {
?i wdt:P6610 ?id1; wdt:P6610 ?id2 FILTER (?id1 > ?id2)
}
Try it!

External links from Ashmolean Museum's English Wikipedia article edit

Query provided by Lucas Werkmeister

SELECT ?extlink WHERE {
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Generator";
                    wikibase:endpoint "en.wikipedia.org";
                    mwapi:generator "allpages";
                    mwapi:gapfrom "Ashmolean_Museum";
                    mwapi:gapto "Ashmolean_Museum";
                    mwapi:prop "extlinks".
    ?extlink wikibase:apiOutput "extlinks/el/text()".
  }
}
Try it!

Links to a particular domain from the Wikipedia biographies of artists in a given collection edit

SELECT ?artistpage ?extlink WHERE {
{SELECT DISTINCT ?name ?artistpage WHERE {
    ?item wdt:P195 wd:Q636400; wdt:P170 ?artist.   # Artists in the Ashmolean
    ?artistpage schema:about ?artist;
                schema:isPartOf <https://en.wikipedia.org/>;   # ENWP articles about them
                schema:name ?name     # Title of article
}
 }
OPTIONAL {SERVICE wikibase:mwapi { # External links from each article
    bd:serviceParam wikibase:api "Generator";
           wikibase:endpoint "en.wikipedia.org";
           mwapi:generator "allpages";
           mwapi:gapfrom ?name;
           mwapi:gapto ?name;
           mwapi:prop "extlinks".
    ?extlink wikibase:apiOutput "extlinks/el/text()".
  }
    FILTER CONTAINS(?extlink, "rkd.nl")
 }
} ORDER BY ?artistpage
Try it!

Wikipedia articles about Ashmolean items, their links to the Ashmolean web site, and candidate links from Wikidata edit

Doesn't work yet as MWAPI doesn't return enough external links. Phabricator report

SELECT ?itempage ?extlink ?url ?ash_id WHERE {
{SELECT DISTINCT ?name ?item ?itempage WHERE {
    ?item wdt:P195 wd:Q636400.   # items in the Ashmolean
    ?itempage schema:about ?item;
         schema:isPartOf <https://en.wikipedia.org/>;   # ENWP articles about them
         schema:name ?name     # Title of article
}
 }
OPTIONAL {SERVICE wikibase:mwapi { # External links from each article
    bd:serviceParam wikibase:api "Generator";
         wikibase:endpoint "en.wikipedia.org";
         mwapi:generator "allpages";
         mwapi:gapfrom ?name;
         mwapi:gapto ?name;
         mwapi:prop "extlinks";
         mwapi:ellimit 50 .
    ?extlink wikibase:apiOutput "extlinks/el/text()".
  }
    FILTER CONTAINS(?extlink, "ashmolean.org")
 }
OPTIONAL {?item wdt:P973 ?url FILTER CONTAINS(STR(?url), "ashmolean.org")
                }
OPTIONAL {?item wdt:P6610 ?ash_id}
} ORDER BY ?itempage
Try it!

External links from Commons File:pages edit

Thanks to Lucas Werkmeister again

SELECT ?image ?extlink WHERE {
  wd:Q4656096 wdt:P18 ?image.
  BIND(STRAFTER(STR(?image), "FilePath/") AS ?encoded_name)
  BIND(wikibase:decodeUri(?encoded_name) AS ?name)
  OPTIONAL { SERVICE wikibase:mwapi { # External links from each image
    bd:serviceParam wikibase:api "Generator";
                    wikibase:endpoint "commons.wikimedia.org";
                    mwapi:generator "allimages";
                    mwapi:gaifrom ?name;
                    mwapi:gaito ?name;
                    mwapi:prop "extlinks";
                    mwapi:ellimit "500".
    ?extlink wikibase:apiOutput "extlinks/el/text()".
  } }
} ORDER BY ?name
Try it!

Connections from Ashmolean Museum items to Japan Search entities edit

SELECT DISTINCT ?work ?workLabel ?propertyLabel ?thingLabel (?jps AS ?japan_search_id) WHERE {
?thing wdt:P6698 ?jps FILTER (!CONTAINS(?jps, "nmoa-")).
VALUES ?prop {wdt:P170 wdt:P180}
?work wdt:P195 wd:Q636400; ?prop ?thing.
  ?property ?ref ?prop ;
          rdf:type wikibase:Property 
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?thingLabel
Try it!

Oxford Collections overview edit

Things connected to Oxford collection items edit

SELECT (SUBSTR(STR(?thing),32) AS ?q) (SUBSTR(STR(?prop),37) as ?p) (SUBSTR(STR(?item),32) AS ?itemq) ?itemLabel ?fullwork (SUBSTR(STR(?coll),32) as ?collq) ?inventory ?url (GROUP_CONCAT(SUBSTR(STR(?artist),32);separator=" ") AS ?artists)
(GROUP_CONCAT(?typeLabel; separator=", ") AS ?types) ?from (YEAR(?latest) AS ?to) ?precision WHERE {
VALUES ?coll {wd:Q636400 wd:Q82133 wd:Q1456119 wd:Q6941088} # Ashmolean, Bodleian, PRM, MHS
?item p:P195 [ps:P195 ?coll; pq:P217 ?inventory].
VALUES ?prop {wdt:P180 wdt:P170 wdt:P1774 wdt:P138} # depicted, creator, school of, named after
?item ?prop ?thing; wdt:P31 ?type.
OPTIONAL {?item wdt:P973 ?url FILTER(CONTAINS(STR(?url), ".ox.ac.uk")|| CONTAINS(STR(?url), "ashmolean.org") )}
OPTIONAL {?item wdt:P953 ?fullwork FILTER(CONTAINS(STR(?fullwork), ".ox.ac.uk") || CONTAINS(STR(?fullwork), "ashmolean.org") )}
FILTER (BOUND(?fullwork) || BOUND(?url) )
OPTIONAL {?item wdt:P170 ?artist}
OPTIONAL {?item p:P571 [pq:P1319 ?earliest; pq:P1326 ?latest] }
OPTIONAL {?item p:P571/psv:P571 [ wikibase:timePrecision ?precision; wikibase:timeValue ?year ] }
BIND(IF (BOUND(?earliest), YEAR(?earliest), YEAR(?year)) AS ?from)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .
?item rdfs:label ?itemLabel. ?type rdfs:label ?typeLabel }
} GROUP BY ?thing ?prop ?item ?itemLabel ?fullwork ?inventory ?url ?coll ?from ?latest ?precision
ORDER BY DESC(?prop) ?from ?to
Try it!

Things described at an Oxford web address but aren't in the collections that have shared with Wikidata edit

SELECT DISTINCT ?item ?itemLabel ?itemDescription  WHERE {
{?item wdt:P973 ?url FILTER (STRSTARTS(STR(?url), ".ox.ac.uk")) } 
UNION {?item wdt:P953 ?fullwork FILTER (CONTAINS(STR(?fullwork), ".ox.ac.uk")) }
?item wdt:P195 ?coll FILTER( ?coll NOT IN (wd:Q636400, wd:Q82133, wd:Q1456119, wd:Q6941088, wd:Q52556635) ).
SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
}
Try it!

Pitt Rivers Museum edit

Unreferenced statements about things in the Pitt Rivers Museum edit

SELECT (SUBSTR(STR(?item),32) AS ?wdq) (SUBSTR(STR(?prop),32) AS ?wdp) ?object ?url WHERE {
?item wdt:P195 wd:Q1456119.
?item wdt:P973 ?url FILTER CONTAINS(STR(?url), "ox.ac.uk"). 
?item ?p ?statement.
  ?prop wikibase:claim ?p; wikibase:statementProperty ?ps  FILTER (?prop != wd:P973) FILTER (?prop != wd:P953)
        FILTER (?prop != wd:P18) FILTER (?prop != wd:P571).
  ?statement ?ps ?object .
  FILTER NOT EXISTS {?statement prov:wasDerivedFrom ?derivedFrom}
} ORDER BY ?item
Try it!

Things whose archives are in the Pitt-Rivers Museum edit

As of April 2019, 50 out of 79 (one appears twice because of two VIAF IDs)

SELECT ?person ?personLabel ?personDescription (URI(CONCAT("https://viaf.org/viaf/", ?viaf)) AS ?viaf_link)
(URI(CONCAT("https://doi.org/10.1093/ref:odnb/", ?odnb)) AS ?odnb_link) ?image ?url
WHERE {
?person p:P485 [ps:P485 wd:Q1456119; pq:P973 ?url] 
OPTIONAL {?person wdt:P214 ?viaf}
OPTIONAL {?person wdt:P18 ?image}
OPTIONAL {?person wdt:P1415 ?odnb}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
Try it!

Image gallery of people whose archives are in the Pitt-Rivers Museum edit

#defaultView:ImageGrid{"hide": ["?image"]}
SELECT ?image ?personDescription ?personLabel ?prmlink
WHERE {
?person p:P485 [ps:P485 wd:Q1456119; pq:P973 ?prmlink].
?person wdt:P18 ?image
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
Try it!

Histropedia timeline of people connected to the PRM, colour-coded by gender

Memory of the World Register edit

Language balance of Wikipedia articles about objects on the register edit

#title:Languages of Wikipedia articles about Memory of the World Register inscriptions
SELECT ?langcode ?langname (COUNT(?link) AS ?count) WHERE {
  ?item wdt:P1435 wd:Q473858. # heritage designation: Memory of the World
    ?link schema:about ?item ; schema:inLanguage ?langcode
   FILTER(CONTAINS(str(?link), ".wikipedia.org/")) # only Wikipedia articles
  OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langlabel FILTER(lang(?langlabel) = "en") } # Convert short code to full language name
BIND(COALESCE(?langlabel, ?langcode) AS ?langname)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?langcode ?langname
ORDER BY DESC(?count)
Languages of Wikipedia articles about Memory of the World Register inscriptions

Wikipedia articles about objects on the register edit

Template:SPARFQL

Historic China edit

See also Wikidata:WikiProject_East_Asia/China_Biographical_Database_import

Things from dynasties of the imperial era, with their collections and shelfmarks edit

The following query uses these:

  • Properties: instance of (P31)     , time period (P2348)     , country (P17)     , country of origin (P495)     , collection (P195)     , made from material (P186)     , inventory number (P217)     
    SELECT ?dynastyLabel ?thing ?thingLabel (GROUP_CONCAT(DISTINCT ?typel; separator=", ") AS ?what) (GROUP_CONCAT(DISTINCT ?matl; separator=", ") AS ?materials) ?thingDescription ?collectionLabel ?inventoryNo WHERE {
    ?dynasty wdt:P31 wd:Q50068795.
    VALUES ?prop {wdt:P2348 wdt:P17 wdt:P495}.
    ?thing ?prop ?dynasty;
           wdt:P31 ?type;
           wdt:P195 ?collection.
     ?type rdfs:label ?typel FILTER(lang(?typel) = "en").
    OPTIONAL {?thing wdt:P186 ?material. ?material rdfs:label ?matl FILTER(lang(?matl) = "en") }.
    OPTIONAL {?thing wdt:P217 ?inventoryNo }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
    } GROUP BY ?dynastyLabel ?thing ?thingLabel?thingDescription ?collectionLabel ?inventoryNo
    ORDER BY ?dynastyLabel
    

Timeline of states of Imperial period edit

The following query uses these:

Time periods edit

Historic periods and corresponding numbers of things in collections edit

The following query uses these:

  • Properties: time period (P2348)     , collection (P195)     , end time (P582)     
    SELECT ?period ?periodLabel ?periodDescription (COUNT(?q) AS ?mcount)
    WHERE {
    ?q wdt:P2348 ?period.
    ?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
      SERVICE wikibase:label {
        bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
      }
     OPTIONAL{?enwp schema:about ?collection; schema:isPartOf <https://en.wikipedia.org/> }
    }
    GROUP BY ?period ?periodLabel ?periodDescription
    ORDER BY DESC(?mcount)
    

History of Japan edit

Periods of Japanese history and what they were named after edit

#title:Major eras of Japanese history
SELECT ?era ?eraLabel (YEAR(?start_time) AS ?start) (YEAR(?end_time) AS ?end) ?namedLabel ?namedDescription WHERE {
?era wdt:P31 wd:Q11514315; wdt:P361 wd:Q130436; # eras of the history of Japan
  wdt:P580 ?start_time. FILTER (?era NOT IN (wd:Q11358452, wd:Q11509224, wd:Q1145058) ) # Exclude ancient times, modern times
#MINUS { ?era wdt:P2348/wdt:P361 wd:Q130436 wd:Q1145058} # exclude sub-eras
MINUS {?era wdt:P2348 []}
OPTIONAL { ?era wdt:P582 ?end_time }
OPTIONAL { ?era wdt:P138 ?named }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?start DESC(?end)
Major eras of Japanese history

Periods of Japanese history and calendar eras within them edit

SELECT ?era ?eraLabel (YEAR(?start_time) AS ?start) (YEAR(?end_time) AS ?end) ?subera ?suberaLabel 
 (YEAR(?sub_start_time) AS ?sub_start) (YEAR(?sub_end_time) AS ?sub_end) WHERE {
?era wdt:P31  wd:Q11514315; wdt:P361 wd:Q130436; # eras of the history of Japan
  wdt:P580 ?start_time.
MINUS { ?era wdt:P2348 []} # exclude sub-eras
OPTIONAL { ?era wdt:P582 ?end_time }
OPTIONAL { ?subera wdt:P2348 ?era; wdt:P361 wd:Q130436; wdt:P580 ?sub_start_time;
  wdt:P582 ?sub_end_time }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?start DESC(?end)
Try it!

Japan Search edit

Numbers of language labels for things with a Japan Search Name ID edit

SELECT ?languageLabel ?count WHERE {
{SELECT ?langcode (COUNT(?label) as ?count) WHERE {
?thing wdt:P6698 ?jpsid; rdfs:label ?label.
BIND(lang(?label) AS ?langcode)
} GROUP BY ?langcode }
?language wdt:P218 ?langcode
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?count)
Try it!

Missing labels and descriptions edit

Paintings with no English description but a known artist label edit

SELECT ?item ("Den" AS ?den) (CONCAT("painting by ", ?creatorLabel) as ?toadd) WHERE {
?item wdt:P31 wd:Q3305213; wdt:P170 ?creator FILTER(?creator != wd:Q4233718) # exclude Anonymous
MINUS {?item wdt:P31 ?other FILTER(?other != wd:Q3305213) } # painting is only type
MINUS {?item schema:description ?engdesc FILTER (lang(?engdesc)="en") } # No English description
?creator rdfs:label ?creatorLabel FILTER (lang(?creatorLabel)="en") # Artist label in English is known
}
Try it!

Paintings with no English label but a Commons Category edit

SELECT ?item ?category WHERE {
?item wdt:P31 wd:Q3305213; wdt:P373 ?category
MINUS{ ?item rdfs:label ?itemLabel FILTER (lang(?itemLabel)="en") }
}
Try it!

Books with a title in a given language but not a label in that language edit

SELECT ?item ?lang ?title WHERE {
?item wdt:P31/wdt:P279* wd:Q571 ; # Q571 for book
      wdt:P1476 ?title .
  BIND(LANG(?title) as ?lang) FILTER (?lang != "und")
FILTER (NOT EXISTS{ ?item rdfs:label ?itemLabel. FILTER(lang(?itemLabel) = ?lang) })
}
Try it!

Wikidata maintenance edit

How many items have an inventory number but no collection? edit

The following query uses these:

How many items have an inventory number with a collection in a qualifier but no collection? edit

The following query uses these:

As of 25 November 2017, 358

Collections and inventory numbers of items an inventory number with a collection in a qualifier but no collection edit

The following query uses these:

Semantic search edit

Synonyms edit

SELECT DISTINCT ?name WHERE {
VALUES ?rel {rdfs:label skos:altLabel}
VALUES ?rel2 {rdfs:label skos:altLabel}
?target ?rel "Confucius"@en;
 ?rel2 ?name FILTER ( lang(?name)="en" )
}
Try it!

Names for types of coin edit

SELECT DISTINCT ?name WHERE {
 ?sub wdt:P279+/rdfs:label "coin"@en.
 {?sub rdfs:label ?name} UNION {?sub skos:altLabel ?name} FILTER (lang(?name)="en")
  FILTER ( !CONTAINS(?name, "coin") )
}
Try it!

Things semantically related to a given topic edit

SELECT DISTINCT ?related ?relatedLabel ?relatedDescription WHERE {
VALUES ?target {wd:Q42}
{ ?target ?prop ?related } UNION { ?related ?prop ?target }
filter (CONTAINS(STR(?related),'/entity/Q') ).
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
} ORDER BY UCASE(?relatedLabel)
Try it!

Data-driven semantic clustering edit

#defaultView:Graph
SELECT ?item1 ?item1Label ?item2 ?item2Label WHERE {
VALUES ?item1Label {"Congressional Black Caucus"@en
"Barack Obama"@en
"Michelle Obama"@en
"University of Chicago"@en
"Time Person of the Year"@en
"Democratic Party"@en
"White House"@en
"Hillary Clinton"@en
"Aragorn"@en
"C. S. Lewis"@en
"J. R. R. Tolkien"@en
"University of Oxford"@en
"World War I"@en
"Battle of the Somme"@en
"British Army"@en
"The Lord of the Rings"@en}
VALUES ?item2Label {"Congressional Black Caucus"@en
"Barack Obama"@en
"Michelle Obama"@en
"University of Chicago"@en
"Time Person of the Year"@en
"Democratic Party"@en
"White House"@en
"Hillary Clinton"@en
"Aragorn"@en
"C. S. Lewis"@en
"J. R. R. Tolkien"@en
"University of Oxford"@en
"World War I"@en
"Battle of the Somme"@en
"British Army"@en
"The Lord of the Rings"@en}
  ?item1 rdfs:label ?item1Label.
  ?item2 rdfs:label ?item2Label.
  ?item1 ?prop ?item2
}
Try it!


Astrolabes edit

All astrolabes (and parts), with collection and creator edit

SELECT ?collectionLabel ?inv ?url ?creatorLabel WHERE {
?item wdt:P31/wdt:P361? wd:Q164992.
?item wdt:P195 ?collection; wdt:P217 ?inv.
OPTIONAL{?item wdt:P170 ?creator}
OPTIONAL {?item wdt:P973 ?url}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?creatorLabel
Try it!

Map of locations of Astrolabe origin edit

#defaultView:Map{"hide": ["?coords"]}
SELECT ?loc ?locLabel ?coords (COUNT(?item) as ?count) WHERE {
?item wdt:P31/wdt:P361? wd:Q164992.
?item wdt:P1071 ?loc. ?loc wdt:P625 ?coords.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?loc ?locLabel ?coords
Try it!

Timeline of Astrolabes edit

#defaultView:Timeline{"hide": "?inception"}
SELECT ?item (?thingLabel as ?itemLabel) ?d ?collectionLabel ?inception WHERE {
?thing wdt:P31 wd:Q164992; wdt:P195 ?collection; wdt:P217 ?d; wdt:P571 ?inception
OPTIONAL {?thing wdt:P973 ?url}
BIND (IF(BOUND(?url),?url, URI(CONCAT("https://tools.wmflabs.org/reasonator/?q=", substr(str(?thing),32))) ) AS ?item)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?thing rdfs:label ?thingLabel. ?collection rdfs:label ?collectionLabel}
}
Try it!

Creators with Reasonator links edit

SELECT DISTINCT (URI(CONCAT("https://tools.wmflabs.org/reasonator/?q=", SUBSTR(STR(?creator),32) )) as ?reasonator) ?creatorLabel
(GROUP_CONCAT(DISTINCT ?locLabel; separator=", ") AS ?locations) ?countryLabel (COUNT(?item) AS ?count) WHERE {
?item wdt:P31/wdt:P361? wd:Q164992.
VALUES ?rel {wdt:P170 wdt:P1774}
?item ?rel ?creator FILTER(!wikibase:isSomeValue(?creator))
OPTIONAL {?creator wdt:P27 ?country }
OPTIONAL {?creator wdt:P937 ?loc }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                        ?loc rdfs:label ?locLabel. ?creator rdfs:label ?creatorLabel. ?country rdfs:label ?countryLabel }
} GROUP BY ?creator ?creatorLabel ?countryLabel
ORDER BY DESC(?count)
Try it!

Materials edit

SELECT ?materialLabel ?materialDescription (COUNT(?item) AS ?count) WHERE {
?item wdt:P31/wdt:P361? wd:Q164992.
?item wdt:P186 ?material
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?materialLabel ?materialDescription
ORDER BY DESC(?count) UCASE(?materialLabel)
Try it!

Image gallery edit

#defaultView:ImageGrid
SELECT ?image ?item ?itemLabel ?collectionLabel WHERE {
?item wdt:P31/wdt:P361? wd:Q164992; wdt:P18 ?image; wdt:P195 ?collection.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Unreferenced statements about Oxford Astrolabes edit

SELECT (SUBSTR(STR(?item),32) AS ?wdq) (SUBSTR(STR(?prop),32) AS ?wdp) ?object ?url WHERE {
?item wdt:P31/wdt:P361? wd:Q164992 ; wdt:P195 wd:Q6941088.
?item wdt:P973 ?url.
?item ?p ?statement.
  ?prop wikibase:claim ?p; wikibase:statementProperty ?ps  FILTER (?prop != wd:P973)
        FILTER (?prop != wd:P18).
  ?statement ?ps ?object .
  FILTER NOT EXISTS {?statement prov:wasDerivedFrom []}
} ORDER BY ?item
Try it!

Things called Astrolabe in English but with missing labels in other languages edit

SELECT (SUBSTR(STR(?q),32) AS ?wdq) (CONCAT("L",?astrolabe_lang) AS ?lang) ?astrolabe_label WHERE {
{SELECT ?astrolabe_lang ?astrolabe_label WHERE {
wd:Q164992 rdfs:label ?astrolabe_label. BIND(lang(?astrolabe_label) AS ?astrolabe_lang)
}
  }
?q rdfs:label "Astrolabe"@en.
    FILTER(NOT EXISTS {
   ?q rdfs:label ?label.
   FILTER(LANG(?label) = ?astrolabe_lang)
 })
}
Try it!

English Wikipedia articles about creators of astrolabes that are in the Museum of the History of Science edit

SELECT DISTINCT ?person ?page ?image WHERE {
?item wdt:P31 wd:Q164992; wdt:P195 wd:Q6941088.
?item wdt:P170 ?person.
OPTIONAL { ?item wdt:P18 ?image }
?page schema:about ?person; schema:isPartOf <https://en.wikipedia.org/>
} ORDER BY ?page
Try it!

Descriptions of things in the History of Science Museum edit

SELECT ?item ?description (lang(?description) as ?lang) WHERE {
?item wdt:P195 wd:Q6941088.
?item schema:description ?description
}
Try it!

Astrolabes ordered by diameter edit

#defaultView:BarChart
SELECT (str(?item) as ?name) ?diam WHERE {
?item wdt:P31 wd:Q164992; p:P2386/psv:P2386 ?valuenode. # astrolabes with a diameter property
?valuenode wikibase:quantityAmount ?length; wikibase:quantityUnit ?unit.
BIND(IF(?unit = wd:Q174728, ?length * 10,?length) as ?diam) # diameter in millimetres (unit is cm or mm)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?item rdfs:label ?itemLabel }
} ORDER BY DESC(?diam)
Try it!

Scatter-plot of diameter against year of creation edit

#defaultView:ScatterChart
SELECT (YEAR(SAMPLE(?date)) as ?year) (SAMPLE(?diam) as ?diam1) (CONCAT(?itemLabel," ",SUBSTR(str(?item),32) ) as ?name) WHERE {
?item wdt:P31 wd:Q164992; wdt:P571 ?date; p:P2386/psv:P2386 ?valuenode. # astrolabes with a diameter property
?valuenode wikibase:quantityAmount ?length; wikibase:quantityUnit ?unit.
BIND(IF(?unit = wd:Q174728, ?length * 10,?length) as ?diam) # diameter in millimetres (unit is cm or mm)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?item rdfs:label ?itemLabel }
} group by ?item ?itemLabel
Try it!

Object with a given King number edit

SELECT * WHERE {
?item wdt:P31/wdt:P361?	wd:Q164992; wdt:P528 "150"
}
Try it!

IIIF edit

What kinds of thing have IIIF links in Wikidata? edit

SELECT ?typeLabel (COUNT(?thing) AS ?count) WHERE {
?thing wdt:P6108 ?iiif; wdt:P31 ?type
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?typeLabel
ORDER BY DESC(?count)
Try it!

What collections have IIIF links in Wikidata? edit

SELECT ?collectionLabel (COUNT(?thing) AS ?count) WHERE {
?thing wdt:P6108 []; wdt:P195 ?collection
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?collectionLabel
ORDER BY DESC(?count)
Try it!

What artists have IIIF links in Wikidata? edit

SELECT ?creator ?creatorLabel ?creatorDescription (COUNT(?art) AS ?count) WHERE {
?art wdt:P6108 []; wdt:P170 ?creator.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?creator ?creatorLabel ?creatorDescription
ORDER BY DESC(?count)
Try it!

Manuscripts with IIIF links (not just notable ones) edit

#defaultView:ImageGrid{"hide": ["?image","?placeholder"]}
SELECT ?placeholder ?image ?qLabel (GROUP_CONCAT(DISTINCT ?collectionLabel; separator="; ") AS ?where)
(URI(CONCAT('https://tools.wmflabs.org/mirador/?manifest=', STR(?iiif))) AS ?iiiflink)
WHERE { 
  ?q (wdt:P31/wdt:P279*) wd:Q87167; wdt:P6108 ?iiif; wikibase:sitelinks ?sitecount.
?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
      MINUS {?s ps:P195 wd:Q1322278 }
  OPTIONAL {?q wdt:P18 ?img}
BIND (IF(BOUND(?img), ?img, <http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg>) AS ?image)
BIND (IF(BOUND(?img), 0, 1) AS ?placeholder)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?q rdfs:label ?qLabel. ?collection rdfs:label ?collectionLabel
    }
}
GROUP BY ?placeholder ?qLabel ?image ?iiif ?sitecount
ORDER BY ?placeholder DESC(?sitecount)
Try it!

IIIF links for works by the artist Raphael edit

#defaultView:ImageGrid{"hide": ["?image"]}
SELECT ?qLabel ?image (GROUP_CONCAT(DISTINCT ?collectionLabel; separator="; ") AS ?where) (URI(CONCAT('https://tools.wmflabs.org/mirador/?manifest=', STR(?iiif))) AS ?q) WHERE {
?q wdt:P6108 ?iiif; wdt:P18 ?image;
   wdt:P170 wd:Q5597; # creator: Raphael
   p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
 ?q rdfs:label ?qLabel. ?collection rdfs:label ?collectionLabel}
} GROUP BY ?q ?qLabel ?iiif ?image
ORDER BY ?where
Try it!

Image gallery of works by J. M. W. Turner with IIIF links edit

#defaultView:ImageGrid{"hide": ["?image","?placeholder"]}
SELECT ?thingLabel ?image ?placeholder (URI(CONCAT('https://tools.wmflabs.org/mirador/?manifest=', STR(?iiif))) AS ?iiiflink) WHERE {
?thing wdt:P6108 ?iiif;
   wdt:P170 wd:Q159758. # creator: Turner
OPTIONAL{ ?thing wdt:P18 ?img }
BIND (IF(BOUND(?img), ?img, <http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg>) AS ?image)
BIND (IF(BOUND(?img), 0, 1) AS ?placeholder)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?placeholder
Try it!

IIIF manifests for self-portrait paintings edit

#defaultView:ImageGrid{"hide": ["?image", "?placeholder"]}
SELECT DISTINCT ?qLabel ?image ?placeholder (GROUP_CONCAT(DISTINCT ?collectionLabel; separator="; ") AS ?where)
(URI(CONCAT('https://tools.wmflabs.org/mirador/?manifest=', STR(?iiif))) AS ?iiiflink)
WHERE { 
  ?q wdt:P31 wd:Q3305213; # painting
     wdt:P136 wd:Q192110; # genre: self-portrait
     wdt:P6108 ?iiif.  # IIIF manifest link on Wikidata
OPTIONAL{ ?q wdt:P18 ?img } # Image on Commons

?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
      MINUS {?s ps:P195 wd:Q1322278 }
 # ?collection wdt:P17 wd:Q145 # collection in the UK
BIND (IF(BOUND(?img), ?img, <http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg>) AS ?image)
BIND (IF(BOUND(?img), 1, 0) AS ?placeholder)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?q rdfs:label ?qLabel. ?collection rdfs:label ?collectionLabel
    }
} GROUP BY ?q ?qLabel ?iiif ?image ?placeholder
ORDER BY DESC(?placeholder) ?where
Try it!

Exhibition histories edit

What objects have appeared in the most exhibitions? edit

#title:Objects that have appeared in most exhibitions
SELECT ?item ?itemLabel ?itemDescription (COUNT(DISTINCT ?exhibited) as ?count) WHERE {
  ?item wdt:P608 ?exhibited
  MINUS {?item wdt:P31 wd:Q5} # exclude artists
  MINUS {?item wdt:P279 []} # exclude types of thing (e.g. fighter aircraft!)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?item ?itemLabel ?itemDescription
ORDER BY DESC(?count) LIMIT 10
Objects that have appeared in most exhibitions

Art UK edit

Art UK artworks and things depicted in them edit

#title:Art UK artworks and things they depict
SELECT ?item ?itemLabel ?id ?depictedLabel WHERE {
  ?item wdt:P1679 ?id.
  ?item wdt:P180 ?depicted.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Art UK artworks and things they depict