59 lines
2.2 KiB
SPARQL
59 lines
2.2 KiB
SPARQL
# Query: FEATURES vocabulary extraction for GLAMORCUBEPSXHF taxonomy
|
|
# Root Classes: Q4989906 (monument), Q860861 (sculpture), Q179700 (statue),
|
|
# Q5003624 (memorial), Q7075 (landmark), Q39614 (cemetery)
|
|
# Expected: 800-1200 terms across 40+ languages
|
|
# Validation: German "Denkmal", Spanish "monumento", Arabic "نصب تذكاري"
|
|
|
|
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#>
|
|
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
|
|
SELECT DISTINCT ?hyponym ?qid ?feature_type ?language ?label ?altLabel
|
|
WHERE {
|
|
VALUES ?root_class {
|
|
wd:Q4989906 # monument
|
|
wd:Q860861 # sculpture
|
|
wd:Q179700 # statue
|
|
wd:Q5003624 # memorial
|
|
wd:Q7075 # landmark
|
|
wd:Q39614 # cemetery
|
|
}
|
|
|
|
# Extract hyponyms (up to 5 levels deep)
|
|
?hyponym wdt:P279+ ?root_class .
|
|
|
|
# Determine which root class this belongs to
|
|
BIND(
|
|
IF(?root_class = wd:Q4989906, "monument",
|
|
IF(?root_class = wd:Q860861, "sculpture",
|
|
IF(?root_class = wd:Q179700, "statue",
|
|
IF(?root_class = wd:Q5003624, "memorial",
|
|
IF(?root_class = wd:Q7075, "landmark",
|
|
IF(?root_class = wd:Q39614, "cemetery", "unknown"))))))
|
|
AS ?feature_type
|
|
)
|
|
|
|
# Extract Q-number
|
|
BIND(STRAFTER(STR(?hyponym), "http://www.wikidata.org/entity/") AS ?qid)
|
|
|
|
# Extract multilingual labels
|
|
?hyponym rdfs:label ?label .
|
|
BIND(LANG(?label) AS ?language)
|
|
|
|
# Optional alternative labels
|
|
OPTIONAL {
|
|
?hyponym skos:altLabel ?altLabel .
|
|
FILTER(LANG(?altLabel) = ?language)
|
|
}
|
|
|
|
# Priority languages for physical heritage features
|
|
# Focus: Global coverage (European, Asian, Latin American, African, Middle Eastern)
|
|
FILTER(?language IN ("en", "es", "fr", "de", "nl", "pt", "it", "ru", "zh", "ja",
|
|
"ko", "ar", "hi", "id", "ms", "th", "vi", "tr", "fa", "pl",
|
|
"uk", "sv", "cs", "he", "bn", "mr", "ta", "te", "ur", "pa",
|
|
"el", "ro", "hu", "da", "no", "fi", "ca", "sr", "bg", "hr",
|
|
"sw", "am", "ha", "yo", "zu", "af", "so", "ti", "lg", "ny"))
|
|
}
|
|
ORDER BY ?feature_type ?hyponym ?language
|
|
LIMIT 50000
|