query-99c93a61cb2c7bacf3add401266d1ca8
TODO
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?langLabel ?cat1 ?cat1Label ?cods1 ?cat2 ?cat2Label ?cods2 ?cat3 ?cat3Label ?cods3 ?cat4 ?cat4Label ?cods4 WHERE {
?lang wdt:P31/wdt:P279* wd:Q34770.
# VALUES ?lang {wd:Q9292}
OPTIONAL {?cat1 wdt:P971 wd:Q980357.
?cat1 wdt:P971 ?lang.
OPTIONAL {SELECT ?cat1 (GROUP_CONCAT(distinct ?cod1; separator=', ') as ?cods1) WHERE {
?wiktSitelink schema:isPartOf [ wikibase:wikiGroup "wiktionary" ];
schema:inLanguage ?cod1;
schema:about ?cat1. } GROUP BY ?cat1 ORDER BY ?cod1 }
}
?cat2 wdt:P971 wd:Q8091; wdt:P971 wd:Q54662266; wdt:P971 ?lang.
OPTIONAL {SELECT ?cat2 (GROUP_CONCAT(distinct ?cod2; separator=', ') as ?cods2) WHERE {
?wiktSitelink schema:isPartOf [ wikibase:wikiGroup "wiktionary" ];
schema:inLanguage ?cod2;
schema:about ?cat2. } GROUP BY ?cat2 ORDER BY ?cod2 }
OPTIONAL {?cat3 wdt:P971 wd:Q30434250; wdt:P971 wd:Q54734643; wdt:P971 ?lang.
OPTIONAL {SELECT ?cat3 (GROUP_CONCAT(distinct ?cod3; separator=', ') as ?cods3) WHERE {
?wiktSitelink schema:isPartOf [ wikibase:wikiGroup "wiktionary" ];
schema:inLanguage ?cod3;
schema:about ?cat3. } GROUP BY ?cat3 ORDER BY ?cod3 }
}
OPTIONAL {?cat4 wdt:P971 wd:Q82042; wdt:P971 wd:Q54662266; wdt:P971 ?lang.
OPTIONAL {SELECT ?cat4 (GROUP_CONCAT(distinct ?cod4; separator=', ') as ?cods4) WHERE {
?wiktSitelink schema:isPartOf [ wikibase:wikiGroup "wiktionary" ];
schema:inLanguage ?cod4;
schema:about ?cat4. } GROUP BY ?cat4 ORDER BY ?cod4 }
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en". }
}
ORDER BY ?langLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?cat1"):::projected
v7("?cat2"):::projected
v10("?cat3"):::projected
v13("?cat4"):::projected
v4("?cod1")
v8("?cod2")
v11("?cod3")
v14("?cod4")
v6("?cods1"):::projected
v9("?cods2"):::projected
v12("?cods3"):::projected
v15("?cods4"):::projected
v2("?lang")
v1("?langLabel"):::projected
v5("?wiktSitelink")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
c14(["wd:Q54734643"]):::iri
c13(["wd:Q30434250"]):::iri
c19(["#91;AUTO_LANGUAGE#93;,fr,en"]):::literal
c5(["wd:Q980357"]):::iri
c11(["wd:Q8091"]):::iri
c3(["wd:Q34770"]):::iri
c15(["wd:Q82042"]):::iri
c17(["bd:serviceParam"]):::iri
c7(["wiktionary"]):::literal
c12(["wd:Q54662266"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P971".-> c5
v3 --"wdt:P971"--> v2
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
a2 -."wikibase:wikiGroup".-> c7
v5 --"schema:isPartOf"--> a2
v5 --"schema:inLanguage"--> v4
v5 --"schema:about"--> v3
bind1[/"?cod1"/]
v4 --o bind1
bind1 --as--o v6
end
end
v7 --"wdt:P971"--> c11
v7 --"wdt:P971"--> c12
v7 --"wdt:P971"--> v2
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
a3 -."wikibase:wikiGroup".-> c7
v5 --"schema:isPartOf"--> a3
v5 --"schema:inLanguage"--> v8
v5 --"schema:about"--> v7
bind3[/"?cod2"/]
v8 --o bind3
bind3 --as--o v9
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v10 -."wdt:P971".-> c13
v10 --"wdt:P971"--> c14
v10 --"wdt:P971"--> v2
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
a4 -."wikibase:wikiGroup".-> c7
v5 --"schema:isPartOf"--> a4
v5 --"schema:inLanguage"--> v11
v5 --"schema:about"--> v10
bind5[/"?cod3"/]
v11 --o bind5
bind5 --as--o v12
end
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v13 -."wdt:P971".-> c15
v13 --"wdt:P971"--> c12
v13 --"wdt:P971"--> v2
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
a5 -."wikibase:wikiGroup".-> c7
v5 --"schema:isPartOf"--> a5
v5 --"schema:inLanguage"--> v14
v5 --"schema:about"--> v13
bind7[/"?cod4"/]
v14 --o bind7
bind7 --as--o v15
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c17 --"wikibase:language"--> c19
end