query-47d034be23d8dbf1b05bb1842dbad6f8
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?countryLabel ?itemnativeLabel ?langusedLabel ?langcode
WHERE {
{
SELECT DISTINCT ?item ?country ?itemnativeLabel ?langused ?langcode WHERE {
{
SELECT DISTINCT ?item WHERE {
?item wdt:P31/wdt:P279?/wdt:P279? wd:Q46831 .
}
}.
?item wdt:P17 ?country .
?country (wdt:P2936|wdt:P37) ?langused .
?langused wdt:P424 ?langcode .
?item rdfs:label ?itemnativeLabel .
FILTER(LANG(?itemnativeLabel) = ?langcode)
}
}.
BIND(xsd:integer(SUBSTR(STR(?item), 33)) AS ?num)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?num ?itemLabel ?countryLabel ?langusedLabel ?langcode
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?country")
v3("?countryLabel"):::projected
v7("?item"):::projected
v2("?itemLabel"):::projected
v6("?itemnativeLabel"):::projected
v5("?langcode"):::projected
v9("?langused")
v4("?langusedLabel"):::projected
v10("?num")
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q46831"]):::iri
f0[["?itemnativeLabel = ?langcode"]]
f0 --> v6
f0 --> v5
v7 --"wdt:P31"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P279"--> a2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
a2 --"wdt:P279"--> c3
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
end
union1r <== or ==> union1l
end
v7 --"wdt:P17"--> v8
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v8 --"wdt:P37"--> v9
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v8 --"wdt:P2936"--> v9
end
union2r <== or ==> union2l
end
v9 --"wdt:P424"--> v5
v7 --"rdfs:label"--> v6
bind1[/"http://www.w3.org/2001/XMLSchema#integer(substring(str(?item),'33^^xsd:integer'))"/]
v7 --o bind1
bind1 --as--o v10
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end