query-57761cf9c97ea40c24d65662aa99dae3
:Wikidata:Lists/nouns/categories
Use at
- https://query.wikidata.org/sparql
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 ?item ?itemLabel (GROUP_CONCAT(DISTINCT ?cct2l; SEPARATOR = ", ") AS ?langs) (GROUP_CONCAT(DISTINCT ?cctl; SEPARATOR = ", ") AS ?other) WHERE {
?item wdt:P971/wdt:P279* wd:Q1084 .
OPTIONAL {
?item wdt:P971 ?cct.
?cct rdfs:label ?cctl.
FILTER(?cct != wd:Q1084 )
FILTER(NOT EXISTS { ?cct wdt:P220 _:b0. })
FILTER((LANG(?cctl)) = "ru")
}
OPTIONAL {
?item wdt:P971 ?cct2.
?cct2 wdt:P220 _:b1.
?cct2 rdfs:label ?cct2l.
FILTER((LANG(?cct2l)) = "ru")
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "ru,[AUTO_LANGUAGE],en,fr". }
}
GROUP BY ?item ?itemLabel
ORDER BY ?langs ?other ?itemLabel ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?cct")
v8("?cct2")
v5("?cct2l"):::projected
v7("?cctl"):::projected
v4("?item"):::projected
v3("?itemLabel"):::projected
v9("?langs")
v9("?other")
a1((" "))
a3((" "))
a2((" "))
c8(["bd:serviceParam"]):::iri
c2(["wd:Q1084"]):::iri
c10(["ru,#91;AUTO_LANGUAGE#93;,en,fr"]):::literal
v4 --"wdt:P971"--> a2
a2 --"wdt:P279"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P971".-> v6
v6 --"rdfs:label"--> v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P971".-> v8
v8 --"wdt:P220"--> a3
v8 --"rdfs:label"--> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind2[/"?cct2l"/]
v5 --o bind2
bind2 --as--o v9
bind3[/"?cctl"/]
v7 --o bind3
bind3 --as--o v9