The code in below
CALL apoc.load.xml ($filelocation, '')
YIELD value
UNWIND value._children AS plmxml
with plmxml
where plmxml._type in [ "Header" , "ProductView"]
with plmxml
WITH apoc.map.clean( plmxml , ["_children"], [""]) as PV
return PV
generates this two maps. as you see the attributes are different between maps depending on "_type"
{
"_type": "Header",
"id": "id1",
"transferContext": "ConfiguredDataFilesExportDefault",
"traverseRootRefs": "#id7"
}
{
"_type": "ProductView",
"id": "id4",
"ruleRefs": "#id2",
"primaryOccurrenceRef": "id7",
"rootRefs": "id7"
}
i want to find all nodes in DB with label as Header matched with map above on ( "_type:"Header" and id = "id1")
I want to do the same for ProductView node
after finding above two nodes then create a relationship type "master" between two nodes found
what is optimal way to write this query ?
thanks a lot