query-a7dd8d70e92e985c3e638cdf027db60e
title:mapping counts of MEXT school code (P11127) by school type SELECT ?group (COUNT(?mext) AS ?count) WHERE { ?school p:P11127 ?st. ?st wikibase:rank ?rank; ps:P11127 ?mext. FILTER(?rank != wikibase:DeprecatedRank) BIND(SUBSTR(?mext, 1 , 2 ) AS ?group) } GROUP BY ?group ORDER BY (?group)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
#title:mapping counts of MEXT school code (P11127) by school type
SELECT ?group (COUNT(?mext) AS ?count) WHERE {
?school p:P11127 ?st.
?st wikibase:rank ?rank;
ps:P11127 ?mext.
FILTER(?rank != wikibase:DeprecatedRank)
BIND(SUBSTR(?mext, 1 , 2 ) AS ?group)
}
GROUP BY ?group
ORDER BY (?group)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?count")
v6("?group"):::projected
v5("?mext"):::projected
v2("?rank")
v3("?school")
v4("?st")
f0[["?rank != 'wikibase:DeprecatedRank'"]]
f0 --> v2
v3 --"p:P11127"--> v4
v4 --"wikibase:rank"--> v2
v4 --"p:statement/P11127"--> v5
bind1[/"substring(?mext,'1^^xsd:integer','2^^xsd:integer')"/]
v5 --o bind1
bind1 --as--o v6
bind3[/"count(?mext)"/]
v5 --o bind3
bind3 --as--o v6