query-e58a431e6deae9dd1aab5a3e5ceab181

rq turtle/ttl

一貫校の中学と高校の対応状況

Use at

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 ?chu ?chuLabel ?chuCode ?ko ?koLabel ?koCode ?code WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ja". }
  {?school wdt:P31 wd:Q21655594. BIND(wd:Q21655594 AS ?class) }
  UNION
  {?school wdt:P31 wd:Q97379116. BIND(wd:Q97379116 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 ?chu.
    ?chu wdt:P31 wd:Q55521176.
    OPTIONAL { ?chu wdt:P11127 ?chuCode. }
  }
  OPTIONAL {
    ?school wdt:P527 ?ko.
    ?ko wdt:P31 wd:Q56351315.
    OPTIONAL { ?ko wdt:P11127 ?koCode. }
    OPTIONAL { ?ko wdt:P1386 ?code. }
  }
}
LIMIT 1000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?chu"):::projected v7("?chuCode"):::projected v4("?city"):::projected v3("?class"):::projected v10("?code"):::projected v8("?ko"):::projected v9("?koCode"):::projected v5("?pref") v1("?school"):::projected v3("?sitelink"):::projected a1((" ")) c19(["wd:Q56351315"]):::iri c14(["wd:Q1054813"]):::iri c8(["wd:Q11484207"]):::iri c17(["wd:Q55521176"]):::iri c7(["wd:Q97379116"]):::iri c2(["bd:serviceParam"]):::iri c4(["ja"]):::literal c6(["wd:Q21655594"]):::iri c11([https://ja.wikipedia.org/]):::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:Q97379116'"/] 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:Q21655594'"/] 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 subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P1386".-> v10 end end