Hello,
I have a json file that is already structured as a tree and I'm trying to import it into neo4j. The problem is there is no identifier within the keys since it is already in a tree.
A sample of the json file is shown below:
{
"sales":[
{
"saleDate":"20180115",
"saleType":"09",
"saleAmount":225000,
"saleSuffix":"C",
"saleTypeDesc":"Sales based on non-typical financing",
"saleSuffixDesc":"Commercial",
"saleInstrumentNumber":"PR3269978"
}
],
"region":"15",
"farmLand":[
],
"rollNumber":"210505010713611",
"subRollNumber":"0000",
"activeProperty":"Y",
"corporateOwner":[
{
"nameSequence":1,
"occupancyCode":"O",
"consolidatedName":"WESTWOOD MALL HOLDINGS LIMITED",
"legalEntityCategoryCode":"X"
}
],
"nonResidential":{
"areaType":"C",
"heightMax":null,
"heightMin":null,
"structures":[
],
"yearBuiltMax":2014,
"yearBuiltMin":2014,
"totalUnitCount":null,
"yearBuiltLargest":2014,
"propertyTotalFloorArea":216
},
"farmLandComponent":"N",
"corporateOwnerFlag":"Y",
"countyMunicipality":"2105",
"propertyInformation":{
"landValue":117771,
"propertyCode":"475",
"actualLotSize":null,
"assessedValue":117000,
"accessTypeCode":"Y",
"actualFrontage":null,
"addressMailing":{
"streetName":"GOREWAY",
"streetNumber":"7215",
"postalZipCode":"L4T 0B4",
"streetTypeCode":"DR",
"unitIdentifier":"1D14",
"deliveryModeNum":null,
"unparsedAddress":"7215 GOREWAY DR SUITE 1D14 MISSISSAUGA ON L4T 0B4",
"deliveryModeCode":null,
"provinceStateCode":"ON",
"unitDesignatorCode":"SUITE",
"streetDirectionCode":null,
"cityPostalMunicipality":"MISSISSAUGA",
"streetNumberSuffixCode":null,
"additionalDeliveryInfo1":null,
"additionalDeliveryInfo2":null,
"deliveryInstallationAreaName":null,
"deliveryInstallationTypeCode":null,
"deliveryInstallationQualifier":null
},
"addressPhysical":{
"streetName":"GOREWAY",
"streetNumber":"7215",
"postalZipCode":null,
"streetTypeCode":"DR",
"unitIdentifier":"1D14",
"unparsedAddress":"7215 GOREWAY DR SUITE 1D14",
"upperStreetNumber":null,
"unitDesignatorCode":"SUITE",
"streetDirectionCode":null,
"streetNumberSuffixCode":null
},
"actualLotSizeUom":null,
"legalDescription":"PSCP 984 LEVEL 1 UNIT 111",
"propertyCodeDescription":"Commercial condominium",
"accessTypeCodeDescription":"Year Round Road Access"
},
"residentialStructures":[
]
}
I am able to import it into neo4j using apoc.load.json or apoc.load.jsonArray but I am not sure how to create the nodes since an identifier is not available in the tree structure.
WITH "SAMPLE.json" AS url
CALL apoc.load.jsonArray(url) YIELD value
UNWIND value.farmLand as f
UNWIND value.residentialStructures as r
UNWIND value.corporateOwner as c
UNWIND value.sales as s
UNWIND value.nonResidential as n
MERGE(farmland:FarmLand {})
so far I'm just trying to create one node. I know there should be a id property in the merge clause but don't know how to get it. Maybe there's an easy way to import json trees?