I have around 3000 relationships between d -> c ..like : PAYS, WirePAYS, WireBTPAYS, Apr_2012PAYS etc.
I want to create relationships like PAYS_I, WirePAYS_I etc if they have commnon pn1 and pn2 as per match and where clause.
if i execute like below . But if i run like this it takes a lot of time for individual..Any otherway without timeout error.
START d = node:node_auto_index('companyName:*')
MATCH pn1<-[:SUB_OF]-d-[rel:WirePAYS]->c-[:SUB_OF]->pn2
WHERE pn1 = pn2
CREATE d-[rel:WirePAYS_I { totalCount : rel.totalCount, totalAmount : rel.totalAmount }]->c
any alternative way so that i pass all rel name in MATCH clause and CREATE new relationships with _I in a single cypher query.
If I tried like below I got timeout error .
start d=node:node_auto_index('companyName:*')
match pn1<-[:SUB_OF]-d-[rel]->c-[:SUB_OF]->pn2
where pn1=pn2 return id(d), id(c), rel.totalAmount, rel.totalCount
MATCH pn1<-[:SUB_OF]-d-[rel:WirePAYS| WireBTPAYS| Apr_2012PAYS| Trade BIRDec_2011PAYS| WireBTApr_2012PAYS]->c-[:SUB_OF]->pn2
START d = node:node_auto_index('companyName:*')
MATCH pn<-[:SUB_OF]-d-[rel:WirePAYS]->c-[:SUB_OF]->pn
CREATE d-[rel:WirePAYS_I { totalCount : rel.totalCount, totalAmount : rel.totalAmount }]->c
Michael
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
START d = node:node_auto_index('companyName:*')
MATCH pn<-[:SUB_OF]-d-[rel:WirePAYS]->c-[:SUB_OF]->pn
CREATE d-[rel:WirePAYS_I { totalCount : rel.totalCount, totalAmount : rel.totalAmount }]->c
START d = node:node_auto_index('companyName:*')
MATCH pn<-[:SUB_OF]-d-[rel:WirePAYS]->c
CREATE d-[rel:WirePAYS_I { totalCount : rel.totalCount, totalAmount : rel.totalAmount }]->c
START d = node:node_auto_index('companyName:*')WITH d
SKIP 0 LIMIT 1000
MATCH pn<-[:SUB_OF]-d-[rel]->c-[:SUB_OF]->pnreturn count(*), count(distinct pn), count(distinct d), count(distinct rel), count(distinct c)
=> 14121 146 425 14121 480
START d = node:node_auto_index('companyName:*')WITH d
SKIP 1000 LIMIT 1000
MATCH pn<-[:SUB_OF]-d-[rel]->c-[:SUB_OF]->pnreturn count(*), count(distinct pn), count(distinct d), count(distinct rel), count(distinct c)
=> 12540 153 330 12540 476
START d = node:node_auto_index('companyName:*')WITH d
SKIP 2000 LIMIT 1000
MATCH pn<-[:SUB_OF]-d-[rel]->c-[:SUB_OF]->pnreturn count(*), count(distinct pn), count(distinct d), count(distinct rel), count(distinct c)
=> 13815 123 315 13815 421
START d = node:node_auto_index('companyName:*')WITH d
SKIP 3000 LIMIT 1000
MATCH pn<-[:SUB_OF]-d-[rel]->c-[:SUB_OF]->pnreturn count(*), count(distinct pn), count(distinct d), count(distinct rel), count(distinct c)
=> 13679 132 306 13679 404
START d = node:node_auto_index('companyName:*')WITH d
SKIP 4000 LIMIT 1000
MATCH pn<-[:SUB_OF]-d-[rel]->c-[:SUB_OF]->pnreturn count(*), count(distinct pn), count(distinct d), count(distinct rel), count(distinct c)
=> 21741 131 368 21741 535
MATCH pn<-[:SUB_OF]-d-[rel:WirePAYS]->c-[:SUB_OF]->pnCREATE d-[rel:WirePAYS_I { totalCount : rel.totalCount, totalAmount : rel.totalAmount }]->c
MATCH pn<-[:SUB_OF]-d-[rel:BTPAYS]->c-[:SUB_OF]->pnCREATE d-[rel:BTPAYS_I { totalCount : rel.totalCount, totalAmount : rel.totalAmount }]->cMATCH pn<-[:SUB_OF]-d-[rel:WireBTPAYS]->c-[:SUB_OF]->pn
CREATE d-[rel:WireBTPAYS_I { totalCount : rel.totalCount, totalAmount : rel.totalAmount }]->c
......