34 lines
1.1 KiB
SPARQL
34 lines
1.1 KiB
SPARQL
# GLAMORCUBEPSXHF Vocabulary Extraction - O (OFFICIAL_INSTITUTION)
|
|
# Query: Extract all hyponyms (subclasses) of government agency and cultural heritage organization
|
|
# Root Classes:
|
|
# - Q22698 (government agency)
|
|
# - Q7210356 (cultural heritage organization)
|
|
# Property: P279 (subclass of)
|
|
# Target: 300-500 terms across 40+ languages
|
|
# Date: 2025-11-11
|
|
|
|
PREFIX wd: <http://www.wikidata.org/entity/>
|
|
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
|
|
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
|
|
|
SELECT DISTINCT ?hyponym ?qid ?language ?label
|
|
WHERE {
|
|
# Define root classes for official institutions
|
|
VALUES ?root_class {
|
|
wd:Q22698 # government agency
|
|
wd:Q7210356 # cultural heritage organization
|
|
}
|
|
|
|
# Find all subclasses (transitive) - captures multi-level hierarchies
|
|
?hyponym wdt:P279+ ?root_class .
|
|
|
|
# Extract Q-number from URI
|
|
BIND(STRAFTER(STR(?hyponym), "http://www.wikidata.org/entity/") AS ?qid)
|
|
|
|
# Get multilingual labels
|
|
?hyponym rdfs:label ?label .
|
|
|
|
# Extract language code
|
|
BIND(LANG(?label) AS ?language)
|
|
}
|
|
LIMIT 50000
|