| Attribute | 追加ルール | 説明 | |||
| id | |||||
| dataSource | |||||
| 0 | dataSource | ||||
| csvAttr | 法人名を取り出すため、csvの項目名として"メーカー名"を指定します | ||||
| entityType | 法人を検索するためにOrganizationを指定します | ||||
| searchAttr | 法人名が格納されているAttributeとして"name"を指定します | ||||
| valueAttr | 法人番号を取り出すために、読みだすAttributeとして"identificationGroup.identification"を指定します | ||||
| identificationType | identificationGroup内のどの情報かを示すために"法人番号"を指定します | ||||
| prefix | idを生成するために、"urn:ngsi-ld:Device:JP"を法人番号の前に付加します | ||||
| 1 | csvAttr | csvの項目名として"製造番号"を指定します | |||
| prefix | 製造番号の前に付加する文字として"-"を指定します。 | ||||
| dateInstalled | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"設置日"を指定します | ||||
| dateManufactured | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"製造日"を指定します | ||||
| description | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"説明"を指定します | ||||
| name | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"設備名称"を指定します | ||||
| pricePurchased | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"購入価格"を指定します | ||||
| refDeviceModel | |||||
| dataSource | |||||
| 0 | dataSource | ||||
| csvAttr | 法人名を取り出すため、csvの項目名として"メーカー名"を指定します | ||||
| entityType | 法人を検索するためにOrganizationを指定します | ||||
| searchAttr | 法人名が格納されているAttributeとして"name"を指定します | ||||
| valueAttr | 法人番号を取り出すために、読みだすAttributeとして"identificationGroup.identification"を指定します | ||||
| identificationType | identificationGroup内のどの情報かを示すために"法人番号"を指定します | ||||
| prefix | idを生成するために、"urn:ngsi-ld:DeviceModel:JP"を法人番号の前に付加します | ||||
| 1 | csvAttr | csvの項目名として"型番"を指定します | |||
| prefix | 型番の前に付加する文字として"-"を指定します。 | ||||
| refBuilding | |||||
| dataSource | |||||
| csvAttr | csvから値を求めるために、csvの項目名として"管理通番"を指定します | ||||
| entityType | 検索対象に"Building"を指定します | ||||
| searchAttr | 管理通番が格納されているAttributeである、"facilityID"を指定します | ||||
| valueAttr | idが格納されているAttributeである"id"を指定します | ||||
| serialNumber | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"製造番号"を指定します | ||||
| url | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"URL"を指定します | ||||
| zoneInstalled | リスト構造の中に値を最大3っつ登録したいので、itemsの中をリスト構造とし、3っつの指定ができる様にします | ||||
| 0 | dataSource | ||||
| csvAttr | csvの項目名として"場所大分類"を指定します | ||||
| 1 | dataSource | ||||
| csvAttr | csvの項目名として"場所中分類"を指定します | ||||
| 2 | dataSource | ||||
| csvAttr | csvの項目名として"場所小分類"を指定します | ||||
| zoneRemarks | |||||
| dataSource | |||||
| csvAttr | csvの項目名として"場所備考"を指定します | ||||
| C:\Users\owner>chdir c:/Tools/ c:\Tools>Python ctoj.py dir=c:/Tools/data/ inputfile=Devicecsv.csv outputfile=Devicejson.json schemafile=Device.exschema.json DeviceModelfile=DeviceModeljson.json Buildingfile=Buildingjson.json logfile=Devicelog.txt ##### start ctoj converter ##### CSV translated to JSON successfully. Number of output Entities: 8 |
| [ { "id": "urn:ngsi-ld:Device:JP7010001008844-RAS-DM28KE801234567XYZ", "type": "Device", "dateInstalled": { "type": "Date", "value": "2017-08-27" }, "dateManufactured": { "type": "Date", "value": "2017-06-21" }, "name": { "type": "Text", "value": "吉浦1F-支所空調1" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP7010001008844-RAS-DM28KE8" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-01234567" }, "serialNumber": { "type": "Text", "value": "RAS-DM28KE801234567XYZ" }, "zoneInstalled": { "type": "Array", "value": [ "建物内部", "1F", "吉浦支所" ] } }, { "id": "urn:ngsi-ld:Device:JP3120001236504-HH-CG2033A0020ABC", "type": "Device", "dateInstalled": { "type": "Date", "value": "2017-08-30" }, "dateManufactured": { "type": "Date", "value": "2017-03-30" }, "name": { "type": "Text", "value": "吉浦1F-支所照明1" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP3120001236504-HH-CG2033A" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-01234567" }, "serialNumber": { "type": "Text", "value": "HH-CG2033A0020ABC" }, "zoneInstalled": { "type": "Array", "value": [ "建物内部", "1F", "吉浦支所" ] } }, { "id": "urn:ngsi-ld:Device:JP7010001008844-RAS-DM28KE801234567VVV", "type": "Device", "dateInstalled": { "type": "Date", "value": "2017-08-27" }, "dateManufactured": { "type": "Date", "value": "2017-06-21" }, "name": { "type": "Text", "value": "吉浦2F-図書空調1" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP7010001008844-RAS-DM28KE8" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-01234567" }, "serialNumber": { "type": "Text", "value": "RAS-DM28KE801234567VVV" }, "zoneInstalled": { "type": "Array", "value": [ "建物内部", "2F", "図書室" ] } }, { "id": "urn:ngsi-ld:Device:JP3120001236504-HH-CG2033A0020ZZZ", "type": "Device", "dateInstalled": { "type": "Date", "value": "2017-08-30" }, "dateManufactured": { "type": "Date", "value": "2017-03-30" }, "name": { "type": "Text", "value": "吉浦2F-図書照明1" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP3120001236504-HH-CG2033A" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-01234567" }, "serialNumber": { "type": "Text", "value": "HH-CG2033A0020ZZZ" }, "zoneInstalled": { "type": "Array", "value": [ "建物内部", "2F", "図書室" ] } }, { "id": "urn:ngsi-ld:Device:JP7010001008844-RAS-DM28KE801234567WWW", "type": "Device", "dateInstalled": { "type": "Date", "value": "2015-03-27" }, "dateManufactured": { "type": "Date", "value": "2015-01-15" }, "name": { "type": "Text", "value": "吉小3F-音楽空調" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP7010001008844-RAS-DM28KE8" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-03000012" }, "serialNumber": { "type": "Text", "value": "RAS-DM28KE801234567WWW" }, "zoneInstalled": { "type": "Array", "value": [ "校舎", "3F", "音楽室" ] } }, { "id": "urn:ngsi-ld:Device:JP3120001236504-HH-CG2033A0020UUU", "type": "Device", "dateInstalled": { "type": "Date", "value": "2015-03-27" }, "dateManufactured": { "type": "Date", "value": "2015-02-22" }, "name": { "type": "Text", "value": "吉小3F-音楽照明" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP3120001236504-HH-CG2033A" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-03000012" }, "serialNumber": { "type": "Text", "value": "HH-CG2033A0020UUU" }, "zoneInstalled": { "type": "Array", "value": [ "校舎", "3F", "音楽室" ] } }, { "id": "urn:ngsi-ld:Device:JP7010001008844-RAS-DM28KE801234567XXX", "type": "Device", "dateInstalled": { "type": "Date", "value": "2017-03-15" }, "dateManufactured": { "type": "Date", "value": "2016-02-16" }, "name": { "type": "Text", "value": "吉中3F-音楽空調" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP7010001008844-RAS-DM28KE8" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-04000008" }, "serialNumber": { "type": "Text", "value": "RAS-DM28KE801234567XXX" }, "zoneInstalled": { "type": "Array", "value": [ "校舎", "3F", "音楽室" ] } }, { "id": "urn:ngsi-ld:Device:JP3120001236504-HH-CG2033A0020MMM", "type": "Device", "dateInstalled": { "type": "Date", "value": "2017-03-15" }, "dateManufactured": { "type": "Date", "value": "2014-01-18" }, "name": { "type": "Text", "value": "吉中3F-音楽照明" }, "refDeviceModel": { "type": "Relationship", "value": "urn:ngsi-ld:DeviceModel:JP3120001236504-HH-CG2033A" }, "refBuilding": { "type": "Relationship", "value": "urn:ngsi-ld:Building:JP9000020342025-04000008" }, "serialNumber": { "type": "Text", "value": "HH-CG2033A0020MMM" }, "zoneInstalled": { "type": "Array", "value": [ "校舎", "3F", "音楽室" ] } } ] |
| 08: inputdir: c:/Tools/data/, inputfile: Devicecsv.csv 09: referenced entities. directory: c:/Tools/data/, Organizationfile: Organizationjson.json 09: referenced entities. directory: c:/Tools/data/, Buildingfile: Buildingjson.json 09: referenced entities. directory: c:/Tools/data/, DeviceModelfile: DeviceModeljson.json 09: outputdir: c:/Tools/data/, outputfile: Devicejson.json 10: CSV Line# 2 10: CSV Line# 3 10: CSV Line# 4 10: CSV Line# 5 10: CSV Line# 6 10: CSV Line# 7 10: CSV Line# 8 10: CSV Line# 9 12: CSV translated to JSON successfully. Entities number: 8 |