query-1a5f68c6755536c0e0e90e27590127bc
クラスツリーにぶらさがるサブクラスを7レベルまで表示します。 (Q11505576)school in Japan
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Tree
SELECT ?root ?rootLabel ?item ?itemL ?item2 ?itemL2 ?item3 ?itemL3 ?item4 ?itemL4 ?item5 ?itemL5 ?item6 ?itemL6 ?item7 ?itemL7 WHERE {
BIND(wd:Q11505576 AS ?root)
BIND(wdt:P279 AS ?property)
?item ?property ?root.
OPTIONAL {
?item2 ?property ?item.
OPTIONAL {
?item3 ?property ?item2.
OPTIONAL {
?item4 ?property ?item3.
OPTIONAL {
?item5 ?property ?item4.
OPTIONAL {
?item6 ?property ?item5.
OPTIONAL {
?item7 ?property ?item6.
}
}
}
}
}
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?root rdfs:label ?rootLabel.
?item rdfs:label ?itemLabel;
schema:description ?itemDescription.
?item2 rdfs:label ?itemLabel2;
schema:description ?itemDescription2.
?item3 rdfs:label ?itemLabel3;
schema:description ?itemDescription3.
?item4 rdfs:label ?itemLabel4;
schema:description ?itemDescription4.
?item5 rdfs:label ?itemLabel5;
schema:description ?itemDescription5.
?item6 rdfs:label ?itemLabel6;
schema:description ?itemDescription6.
?item7 rdfs:label ?itemLabel7;
schema:description ?itemDescription7.
}
BIND(CONCAT(?itemLabel, ": ", COALESCE(?itemDescription, "")) AS ?itemL)
BIND(CONCAT(?itemLabel2, ": ", COALESCE(?itemDescription2, "")) AS ?itemL2)
BIND(CONCAT(?itemLabel3, ": ", COALESCE(?itemDescription3, "")) AS ?itemL3)
BIND(CONCAT(?itemLabel4, ": ", COALESCE(?itemDescription4, "")) AS ?itemL4)
BIND(CONCAT(?itemLabel5, ": ", COALESCE(?itemDescription5, "")) AS ?itemL5)
BIND(CONCAT(?itemLabel6, ": ", COALESCE(?itemDescription6, "")) AS ?itemL6)
BIND(CONCAT(?itemLabel7, ": ", COALESCE(?itemDescription7, "")) AS ?itemL7)
}
ORDER BY (?itemL) (?itemL2) (?itemL3) (?itemL4) (?itemL5) (?itemL6) (?itemL7)
LIMIT 20000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?item"):::projected
v11("?item2"):::projected
v12("?item3"):::projected
v13("?item4"):::projected
v14("?item5"):::projected
v15("?item6"):::projected
v16("?item7"):::projected
v19("?itemDescription")
v21("?itemDescription2")
v23("?itemDescription3")
v25("?itemDescription4")
v27("?itemDescription5")
v29("?itemDescription6")
v31("?itemDescription7")
v32("?itemL"):::projected
v32("?itemL2"):::projected
v32("?itemL3"):::projected
v32("?itemL4"):::projected
v32("?itemL5"):::projected
v32("?itemL6"):::projected
v32("?itemL7"):::projected
v18("?itemLabel")
v20("?itemLabel2")
v22("?itemLabel3")
v24("?itemLabel4")
v26("?itemLabel5")
v28("?itemLabel6")
v30("?itemLabel7")
v9("?property")
v8("?root"):::projected
v17("?rootLabel"):::projected
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/"'wd:Q11505576'"/]
bind0 --as--o v8
bind1[/"'wdt:P279'"/]
bind1 --as--o v9
v10 -->v9--> v8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v11 -->v9--> v10
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v12 -->v9--> v11
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v13 -->v9--> v12
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v14 -->v9--> v13
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v15 -->v9--> v14
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v16 -->v9--> v15
end
end
end
end
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 -."wikibase:language".-> c4
v8 --"rdfs:label"--> v17
v10 --"rdfs:label"--> v18
v10 --"schema:description"--> v19
v11 --"rdfs:label"--> v20
v11 --"schema:description"--> v21
v12 --"rdfs:label"--> v22
v12 --"schema:description"--> v23
v13 --"rdfs:label"--> v24
v13 --"schema:description"--> v25
v14 --"rdfs:label"--> v26
v14 --"schema:description"--> v27
v15 --"rdfs:label"--> v28
v15 --"schema:description"--> v29
v16 --"rdfs:label"--> v30
v16 --"schema:description"--> v31
end
bind2[/"concat(?itemLabel,': ',?itemDescription'')"/]
v18 --o bind2
v19 --o bind2
bind2 --as--o v32
bind3[/"concat(?itemLabel2,': ',?itemDescription2'')"/]
v20 --o bind3
v21 --o bind3
bind3 --as--o v32
bind4[/"concat(?itemLabel3,': ',?itemDescription3'')"/]
v22 --o bind4
v23 --o bind4
bind4 --as--o v32
bind5[/"concat(?itemLabel4,': ',?itemDescription4'')"/]
v24 --o bind5
v25 --o bind5
bind5 --as--o v32
bind6[/"concat(?itemLabel5,': ',?itemDescription5'')"/]
v26 --o bind6
v27 --o bind6
bind6 --as--o v32
bind7[/"concat(?itemLabel6,': ',?itemDescription6'')"/]
v28 --o bind7
v29 --o bind7
bind7 --as--o v32
bind8[/"concat(?itemLabel7,': ',?itemDescription7'')"/]
v30 --o bind8
v31 --o bind8
bind8 --as--o v32