query-1f3efc3c742f8095e0e8cc11ac9696c3
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?item ?item_name ?item_alias ?country_name ?coords WHERE {
?item wdt:P31/wdt:P279* wd:Q515 .
# {?item wdt:P31/wdt:P279* wd:Q515} UNION {?item wdt:P31/wdt:P279* wd:Q3957} .
?item rdfs:label ?item_name. FILTER(LANG(?item_name) = "fr") .
OPTIONAL {
?item skos:altLabel ?item_alias.
FILTER(LANG(?item_alias) = "fr") .
FILTER(STRENDS(?item_alias, "ovie"))
}
FILTER(STRENDS(?item_name, "ovie") || bound(?item_alias)) .
OPTIONAL {
?item wdt:P17 ?country .
?country rdfs:label ?country_name. FILTER(LANG(?country_name) = "en") .
}
OPTIONAL {
?item wdt:P625 ?coords .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?coords"):::projected
v5("?country")
v3("?country_name"):::projected
v4("?item"):::projected
v2("?item_alias"):::projected
v1("?item_name"):::projected
a1((" "))
c6(["wd:Q515"]):::iri
f0[["(ends-with(?item_name,'ovie') || bound(?item_alias))"]]
f0 --> v1
f0 --> v2
f1[["?item_name = 'fr'"]]
f1 --> v1
v4 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c6
v4 --"rdfs:label"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."skos:altLabel".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P17".-> v5
v5 --"rdfs:label"--> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P625".-> v6
end