Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Last active September 12, 2023 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baskaufs/bfbdfe67e7af1c8d43e58e6aa0f61ee2 to your computer and use it in GitHub Desktop.
Save baskaufs/bfbdfe67e7af1c8d43e58e6aa0f61ee2 to your computer and use it in GitHub Desktop.
Construct triples linking classes for Vanderbilt Gallery artworks to their superclasses
construct {
?class wdt:P279 ?superclass.
?base_class rdfs:label ?base_label.
?superclass rdfs:label ?super_label.
}
where {
# Q102971873 is "Soba-choko (noodle sauce cup) with a design in blue underglaze of a stylized rock and grasses"
bind (wd:Q102971873 as ?artwork) # Comment out this line to do all artworks
?artwork wdt:P195 wd:Q18563658. # must be in the Vanderbilt Art Gallery
?artwork wdt:P31 ?base_class. # artwork is an instance of the base class
?base_class wdt:P279* ?class. # the subject class is 0 to many subclass_of links from the base class
?class wdt:P279 ?superclass. # the class must have a superclass
?base_class rdfs:label ?base_label.
filter(lang(?base_label)="en")
?superclass rdfs:label ?super_label.
filter(lang(?super_label)="en")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment