12. JSON表現
pygeonlp では、 JSON を利用して 地名語 や 住所 の情報を表現します。
ここではこれらの情報の JSON 表現について説明します。
12.1. 地名語のJSON表現
地名語のJSON表記例を示します。 GeoJSON に準拠しています。
properties.node_type は GEOWORD
properties.morphemes に MeCab の処理結果を格納
properties.geoword_properties に地名解析辞書の情報を格納
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
139.757845,
35.6960275
]
},
"properties": {
"surface": "神保町",
"node_type": "GEOWORD",
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "神保町",
"pos": "名詞",
"prononciation": "",
"subclass1": "固有名詞",
"subclass2": "地名語",
"subclass3": "82wiE0:神保町駅",
"surface": "神保町",
"yomi": ""
},
"geoword_properties": {
"body": "神保町",
"dictionary_id": 4,
"entry_id": "2891e10e9314a0b378fac6aace6d2a7f",
"geolod_id": "82wiE0",
"hypernym": [
"東京都",
"10号線新宿線"
],
"institution_type": "公営鉄道",
"latitude": "35.6960275",
"longitude": "139.757845",
"ne_class": "鉄道施設/鉄道駅",
"railway_class": "普通鉄道",
"suffix": [
"駅",
""
],
"dictionary_identifier": "geonlp:ksj-station-N02-2019"
}
}
}
12.2. 住所のJSON表現
住所のJSON表記例を示します。 GeoJSON に準拠しています。
properties.node_type は ADDRESS
properties.morphemes に住所文字列を構成するそれぞれの単語の情報を格納
properties.address_properties にジオコーダーの解析結果を格納
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
139.758148,
35.692332
]
},
"properties": {
"surface": "千代田区一ツ橋2-1-",
"node_type": "ADDRESS",
"morphemes": [{
"surface": "千代田区",
"node_type": "GEOWORD",
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "千代田区",
"pos": "名詞",
"prononciation": "",
"subclass1": "固有名詞",
"subclass2": "地名語",
"subclass3": "WWIY7G:千代田区",
"surface": "千代田区",
"yomi": ""
},
"geometry": {
"type": "Point",
"coordinates": [
139.753634,
35.694003
]
},
"prop": {
"address": "東京都千代田区",
"body": "千代田",
"body_variants": "千代田",
"code": {},
"countyname": "",
"countyname_variants": "",
"dictionary_id": 1,
"entry_id": "13101A1968",
"geolod_id": "WWIY7G",
"hypernym": [
"東京都"
],
"latitude": "35.69400300",
"longitude": "139.75363400",
"ne_class": "市区町村",
"prefname": "東京都",
"prefname_variants": "東京都",
"source": "1/千代田区役所/千代田区九段南1-2-1/P34-14_13.xml",
"suffix": [
"区"
],
"valid_from": "",
"valid_to": "",
"dictionary_identifier": "geonlp:geoshape-city"
}
},
{
"surface": "一ツ橋",
"node_type": "NORMAL",
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "一ツ橋",
"pos": "名詞",
"prononciation": "ヒトツバシ",
"subclass1": "固有名詞",
"subclass2": "地域",
"subclass3": "一般",
"surface": "一ツ橋",
"yomi": "ヒトツバシ"
},
"geometry": null,
"prop": null
},
{
"surface": "2",
"node_type": "NORMAL",
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "2",
"pos": "名詞",
"prononciation": "ニ",
"subclass1": "数",
"subclass2": "*",
"subclass3": "*",
"surface": "2",
"yomi": "ニ"
},
"geometry": null,
"prop": null
},
{
"surface": "-",
"node_type": "NORMAL",
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "*",
"pos": "記号",
"prononciation": "",
"subclass1": "一般",
"subclass2": "*",
"subclass3": "*",
"surface": "-",
"yomi": ""
},
"geometry": null,
"prop": null
},
{
"surface": "1",
"node_type": "NORMAL",
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "1",
"pos": "名詞",
"prononciation": "イチ",
"subclass1": "数",
"subclass2": "*",
"subclass3": "*",
"surface": "1",
"yomi": "イチ"
},
"geometry": null,
"prop": null
},
{
"surface": "-",
"node_type": "NORMAL",
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "*",
"pos": "記号",
"prononciation": "",
"subclass1": "一般",
"subclass2": "*",
"subclass3": "*",
"surface": "-",
"yomi": ""
},
"geometry": null,
"prop": null
}
],
"address_properties": {
"id": 11460296,
"name": "1番",
"x": 139.758148,
"y": 35.692332,
"level": 7,
"note": null,
"fullname": [
"東京都",
"千代田区",
"一ツ橋",
"二丁目",
"1番"
]
}
}
}
12.3. 地名解析辞書メタデータのJSON表現
地名解析辞書メタデータのJSON表記例を示します。
都道府県辞書の例
{
"@context": "https://schema.org/",
"@type": "Dataset",
"alternateName": "",
"creator": [{
"@type": "Organization",
"name": "GeoNLP Project",
"sameAs": "http://geonlp.ex.nii.ac.jp/"
}],
"dateModified": "2014-01-15T14:36:17+09:00",
"description": "1都1道2府43県の辞書です。県庁所在地の住所を含みます。自由フィールドとして県庁の代表電話番号も含みます。代表点の座標は県庁の住所をジオコーディングにより取得しています。",
"distribution": [{
"@type": "DataDownload",
"contentUrl": "http://agora.ex.nii.ac.jp/GeoNLP/dict/geoshape-pref.csv",
"encodingFormat": "text/csv"
}],
"identifier": ["geonlp:geoshape-pref"],
"isBasedOn": {
"@type": "CreativeWork",
"name": "財団法人地方自治情報センター「都道府県庁」",
"url": "https://www.lasdec.or.jp/cms/1,69,14,188,html"
},
"keywords": ["GeoNLP", "地名辞書"],
"license": "https://creativecommons.org/licenses/by/4.0/",
"name": "日本の都道府県(2010年4月)",
"size": "48",
"spatialCoverage": {
"@type": "Place",
"geo": {
"@type": "GeoShape",
"box": "26.2133 126.67963 43.06411 141.34702"
}
},
"temporalCoverage": "../..",
"url": "https://geonlp.ex.nii.ac.jp/dictionary/geoshape-pref/"
}
市区町村辞書の例
{
"@context": "https://schema.org/",
"@type": "Dataset",
"alternateName": "",
"creator": [{
"@type": "Organization",
"name": "ROIS-DS人文学オープンデータ共同利用センター",
"sameAs": "http://codh.rois.ac.jp/"
}],
"dateModified": "2021-01-04T22:03:51+09:00",
"description": "歴史的行政区域データセットβ版で構築した地名辞書です。1920年から2020年までの国土数値情報「行政区域データ」に出現する市区町村をリスト化し、独自の固有IDを付与して公開しています。データセット構築の詳しい手法については、「歴史的行政区域データセットβ版」のウェブサイトをご覧ください。",
"distribution": [{
"@type": "DataDownload",
"contentUrl": "http://agora.ex.nii.ac.jp/GeoNLP/dict/geoshape-city.csv",
"encodingFormat": "text/csv"
}],
"identifier": ["geonlp:geoshape-city"],
"isBasedOn": {
"@type": "CreativeWork",
"name": "歴史的行政区域データセットβ版",
"url": "https://geoshape.ex.nii.ac.jp/city/"
},
"keywords": ["GeoNLP", "地名辞書"],
"license": "https://creativecommons.org/licenses/by/4.0/",
"name": "歴史的行政区域データセットβ版地名辞書",
"size": "16421",
"spatialCoverage": {
"@type": "Place",
"geo": {
"@type": "GeoShape",
"box": "24.06092 123.004496 45.5566280626738 148.772556996888"
}
},
"temporalCoverage": "../..",
"url": "https://geonlp.ex.nii.ac.jp/dictionary/geoshape-city/"
}