Wikidata:GLAM/Metropolitan Museum of Art/Tools/SDC

Structured Data on Commons (SDC) allows for Wikidata-like statements to describe Commons files, providing for very precise search using the "haswbstatement" directive in the search box.

For example, these directives can search for Met images from The American Wing that depict cats:

  • All cat depictions, including those by Wikimedia community: haswbstatement:P3634 haswbstatement:P195=Q67429123 haswbstatement:P180=Q146
  • Only cats from official Met tagging initiative: haswbstatement:P3634 haswbstatement:P195=Q67429123 haswbstatement:P180=Q146[P459=Q106429444]

Commons files from The Met by department edit

Wiki Commons Query Search edit

Live federated SPARQL search all Met artworks on Wiki Commons Query Service, ordered by department. As of February 2022, you need to be logged into a Wikimedia account in order to see WCQS results

Individual searches edit

These searches below search will return all Met artworks from particular departments. A similar search can be done via SPARQL for the WCQS, though as of February 2022, you need to be logged into a Wikimedia account in order to see WCQS results.

Department QID File count (Feb 2, 2022) Commons search
The American Wing Q67429123 23,926 Special | Media | WCQS
Ancient Near Eastern Art Q67429126 6,432 Special | Media | WCQS
Arms and Armor Q67429127 14,605 Special | Media | WCQS
The Michael C. Rockefeller Wing Q67429128 8,679 Special | Media | WCQS
Asian Art Q67429130 58,535 Special | Media | WCQS
Costume Institute Q67087093 19,368 Special | Media | WCQS
Drawings and Prints Q67429132 70,247 Special | Media | WCQS
Egyptian Art Q67429133 21,913 Special | Media | WCQS
European Paintings Q67429134 3,669 Special | Media | WCQS
European Sculpture and Decorative Arts Q67429136 54,145 Special | Media | WCQS
Greek and Roman Art Q67429137 18,491 Special | Media | WCQS
Islamic Art Q67429139 31,316 Special | Media | WCQS
Medieval Art Q67429140 18,278 Special | Media | WCQS
Modern and Contemporary Art Q67429142 1,466 Special | Media | WCQS
Musical Instruments Q67429143 2,653 Special | Media | WCQS
Photographs Q67429146 9,568 Special | Media | WCQS
Robert Lehman Collection Q67429147 5,470 Special | Media | WCQS
The Cloisters Q1138030 4,959 Special | Media | WCQS
The Libraries Q67429148 398 Special | Media | WCQS

Maintenance searches edit

Query all Commons files for Met ID but have no depiction info from The Met.

These would be good candidates to iterate through and check against the Met API. If the primary image from the Met API matches the filename fragment, then the keyword info can be added with confidence.

# Met images and official depiction info from Met API
SELECT ?file ?filename ?thing ?thingLabel # ?url
WHERE {
  ?file wdt:P3634 ?metid .
  MINUS {  # FILTER NOT EXISTS does not work as well
  ?file p:P180 [
          ps:P180 ?thing  ; 
          pq:P459 wd:Q106429444 
        ] . 
  }
  ?file schema:url ?image .
  ?file schema:contentUrl ?url .
  BIND (wikibase:decodeUri(CONCAT("File:", substr(str(?url),53))) AS ?filename)
#  service <https://query.wikidata.org/sparql> {
#    service wikibase:label {
#      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
#      ?thing rdfs:label ?thingLabel.
#    }
#  }
} LIMIT 100
Try it!