query-d8286983f019ed2fae7b74cbb244d38c
一貫校の幼稚園と小学校の対応状況
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 ?school ?schoolLabel ?sitelink ?class ?classLabel ?city ?cityLabel ?prefLabel ?yo ?yoLabel ?yoCode ?sho ?shoLabel ?shoCode WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "ja". }
{?school wdt:P31 wd:Q11484202. BIND(wd:Q11484202 AS ?class) }
UNION
{?school wdt:P31 wd:Q11484204. BIND(wd:Q11484204 AS ?class) }
UNION
{?school wdt:P31 wd:Q11484207. BIND(wd:Q11484207 AS ?class) }
OPTIONAL {
?sitelink schema:about ?school; schema:isPartOf <https://ja.wikipedia.org/>.
}
OPTIONAL {
?school (wdt:P131+) ?city.
?city (wdt:P31/(wdt:P279*)) wd:Q1054813.
}
OPTIONAL {
?school (wdt:P131+) ?pref.
?pref wdt:P31 wd:Q50337.
}
OPTIONAL {
?school wdt:P527 ?yo.
?yo wdt:P31 wd:Q106688647.
OPTIONAL { ?yo wdt:P11127 ?yoCode. }
}
OPTIONAL {
?school wdt:P527 ?sho.
?sho wdt:P31 wd:Q5358913.
OPTIONAL { ?sho wdt:P11127 ?shoCode. }
}
}
ORDER BY ?school
LIMIT 1000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?city"):::projected
v3("?class"):::projected
v5("?pref")
v1("?school"):::projected
v8("?sho"):::projected
v9("?shoCode"):::projected
v3("?sitelink"):::projected
v6("?yo"):::projected
v7("?yoCode"):::projected
a1((" "))
c7(["wd:Q11484204"]):::iri
c14(["wd:Q1054813"]):::iri
c19(["wd:Q5358913"]):::iri
c8(["wd:Q11484207"]):::iri
c2(["bd:serviceParam"]):::iri
c4(["ja"]):::literal
c17(["wd:Q106688647"]):::iri
c11([https://ja.wikipedia.org/]):::iri
c6(["wd:Q11484202"]):::iri
c15(["wd:Q50337"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c8
bind0[/"'wd:Q11484207'"/]
bind0 --as--o v3
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c7
bind1[/"'wd:Q11484204'"/]
bind1 --as--o v3
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c6
bind2[/"'wd:Q11484202'"/]
bind2 --as--o v3
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."schema:about".-> v1
v3 --"schema:isPartOf"--> c11
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v4
v4 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c14
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v5
v5 --"wdt:P31"--> c15
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P527".-> v6
v6 --"wdt:P31"--> c17
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v6 -."wdt:P11127".-> v7
end
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P527".-> v8
v8 --"wdt:P31"--> c19
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v8 -."wdt:P11127".-> v9
end
end