Mzaki
Joined 12 November 2012
|
住所関係 edit
欧米のやり方 edit
located on street (P669)にhouse number (P670)で修飾する(ほかにfloor number (P5423)やroom number (P7532)が使えそう)か、streetの項目がなければ単純にstreet address (P6375)を使う。
- Notman House (Q11845348)
- 51 Sherbrooke Street West, Montreal, Quebec
located in the administrative territorial entity (P131) |
| ||||||||||
add value |
located on street (P669) |
| ||||||||||||||
add value |
located in the administrative territorial entity (P131) |
| ||||||||||
add value |
street address (P6375) |
| ||||||||||||||||||||
add value |
located in the administrative territorial entity (P131) |
| ||||||||||
add value |
street address (P6375) |
| ||||||||||
add value |
located on street (P669) |
| ||||||||||||||
add value |
学校関係 edit
覚え書き edit
- 認定こども園: center for early childhood education and care (Q11631443)
- 幼保連携型: licensed nursery school (Q115194155)
- 幼稚園および保育所等の施設・設備が一体的に設置運営されるものとして認可・認定される
- 幼稚園型: kindergarten in Japan (Q106688647) + center for early childhood education and care (Q11631443)
- 認可された幼稚園が保育所的な機能を備えるものとして認定される
- 保育所型: nursery center (Q85876558) + center for early childhood education and care (Q11631443)
- 認可された保育所が幼稚園的な機能を備えるものとして認定される
- 地方裁量型: center for early childhood education and care (Q11631443) (+ なにか適切な venue (Q17350442) たとえば Q11631441 など)
- いずれの認可もなく都道府県の認定基準により認定される
- 幼保連携型: licensed nursery school (Q115194155)
PetScan edit
SPARQLクエリ edit
日本の学校項目で使用されているプロパティ edit
#title:Properties for Japanese school items
SELECT ?prop (Sample(?propLabel) AS ?label) (COUNT(?prop) AS ?count)
WHERE
{
{
SELECT DISTINCT ?item ?prop WHERE {
hint:Query hint:optimizer "None" .
?item wdt:P11127 ?code; ?p ?propvalue.
?prop wikibase:directClaim ?p .
}
} .
OPTIONAL { ?prop rdfs:label ?propLabel filter (lang(?propLabel) = "ja") }
}
GROUP BY ?prop
ORDER BY DESC(?count)
一貫校の中学と高校の対応状況 edit
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
一貫校・併設校の小学と中学の対応状況 edit
SELECT DISTINCT ?school ?schoolLabel ?sitelink ?class ?classLabel ?city ?cityLabel ?prefLabel ?chu ?chuLabel ?chuCode ?sho ?shoLabel ?shoCode WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "ja". }
{?school wdt:P31 wd:Q89612581. BIND(wd:Q89612581 AS ?class) }
UNION
{?school wdt:P31 wd:Q11458774. BIND(wd:Q11458774 AS ?class) }
UNION
{?school wdt:P31 wd:Q97379116. BIND(wd:Q97379116 AS ?class) }
UNION
{?school wdt:P31 wd:Q11484207. BIND(wd:Q11484207 AS ?class) }
UNION
{?school wdt:P31 wd:Q11484204. BIND(wd:Q11484204 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 ?sho.
?sho wdt:P31 wd:Q5358913.
OPTIONAL { ?sho wdt:P11127 ?shoCode. }
}
}
LIMIT 1000
一貫校の幼稚園と小学校の対応状況 edit
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
wikidataにマッピングされているコード数(学校種別) edit
#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)
マッピングミス(非推奨ランク)のコードとその正解 edit
#title:deprecated mappings of MEXT school code (P11127)
SELECT ?mismatch ?mismatchLabel ?mext ?item ?itemLabel ?rank WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "ja". }
?mismatch p:P11127 ?st1.
?st1 wikibase:rank wikibase:DeprecatedRank;
ps:P11127 ?mext.
OPTIONAL {
?item p:P11127 ?st2.
?st2 wikibase:rank ?rank;
ps:P11127 ?mext.
FILTER(?rank != wikibase:DeprecatedRank)
}
}
ORDER BY (?mext)
学校法人にリンクしているプロパティ edit
#title:Relations connecting to Incorporated Educational Institution as tail entity
SELECT ?prop (Sample(?propLabel) AS ?label) (COUNT(?prop) AS ?count)
WHERE
{
{
SELECT DISTINCT ?item ?prop WHERE {
hint:Query hint:optimizer "None" .
?item ?p wd:Q11448283.
?prop wikibase:directClaim ?p .
}
} .
OPTIONAL { ?prop rdfs:label ?propLabel filter (lang(?propLabel) = "ja") }
}
GROUP BY ?prop
ORDER BY DESC(?count)
曖昧さ回避関係 edit
- Category:曖昧さ回避に含まれていて、でもwikidata項目がWikimedia disambiguation page (Q4167410)のサブクラスに属さず、かつリダイレクトが存在するもの。Category:曖昧さ回避は1万件を超えていてmwapiで全部は取得できないので、mwapi:gcmstartsortkeyprefixでずらしながら取得する必要がある。
SELECT (SAMPLE(?pagetitle) AS ?title) ?item
WITH {
SELECT ?pagetitle ?item WHERE {
wd:Q4167410 wdt:P910 ?category .
?link schema:about ?category; schema:isPartOf <https://ja.wikipedia.org/>; schema:name ?title .
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "ja.wikipedia.org" .
bd:serviceParam mwapi:gcmtitle ?title .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmnamespace "0" .
# bd:serviceParam mwapi:gcmstartsortkeyprefix "T" .
bd:serviceParam mwapi:gcmlimit "max" .
# out
?pagetitle wikibase:apiOutput mwapi:title .
?item wikibase:apiOutputItem mwapi:item .
}
MINUS { ?item wdt:P31/wdt:P279* wd:Q4167410; }
}
} AS %results
WHERE {
INCLUDE %results .
?redirect owl:sameAs ?item .
}
GROUP BY ?item