Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Created August 22, 2023 20:51
Show Gist options
  • Select an option

  • Save baskaufs/eaf033c0b22208c78027d8def107d28c to your computer and use it in GitHub Desktop.

Select an option

Save baskaufs/eaf033c0b22208c78027d8def107d28c to your computer and use it in GitHub Desktop.
finds subject and object IRIs for Getty AAT hierarchical classification
PREFIX gvp: <http://vocab.getty.edu/ontology#>
PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#>
select distinct ?broader_subject ?subject_label ?broader_object ?object_label
from <http://AATOut_2Terms>
from <http://AATOut_HierarchicalRels>
where {
# http://vocab.getty.edu/aat/300043022 is the IRI for "teapots"
<http://vocab.getty.edu/aat/300043022> gvp:broaderGeneric* ?broader_subject.
?broader_subject gvp:broaderGeneric ?broader_object.
?broader_subject skosxl:prefLabel ?labelSubject.
?labelSubject skosxl:literalForm ?subject_label.
filter(lang(?subject_label)="en")
?broader_object skosxl:prefLabel ?labelObject.
?labelObject skosxl:literalForm ?object_label.
filter(lang(?object_label)="en")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment