Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Created October 3, 2023 15:51
Show Gist options
  • Save baskaufs/82fe18b483f1cd06a78db67270d6e9fc to your computer and use it in GitHub Desktop.
Save baskaufs/82fe18b483f1cd06a78db67270d6e9fc to your computer and use it in GitHub Desktop.
SPARQL query to find P31 class for gallery item and equivalent AAT and Nom concepts
SELECT DISTINCT ?work ?workLabel ?class ?classLabel ?otherConcepts ?prefLabel ?nomLabel
WHERE {
#bind(wd:Q102962863 as ?work)
bind(wd:Q104031914 as ?work)
?work rdfs:label ?workLabel.
?work wdt:P31 ?class.
?class rdfs:label ?classLabel.
?class skos:exactMatch ?otherConcepts.
optional {
?otherConcepts skosxl:prefLabel ?labelObject.
?labelObject skosxl:literalForm ?prefLabel.
filter(lang(?prefLabel)="en")
}
optional {
?otherConcepts skos:prefLabel ?nomLabel.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment