Hello:
I am getting the following error, as shown below.
ClientError: {code: Neo.ClientError.Transaction.TransactionTimedOut} {message: The transaction has been terminated. Retry your operation in a new transaction, and you should see a successful result. The transaction has not completed within the specified timeout (dbms.transaction.timeout). You may want to retry with a longer timeout. }
From the below code, I am creating a new relationship to an existing node (alg:Allergy), and I am creating a new node (g). Any help is greatly appreciated.
CODE:-
p1subjectid = female['SUBJECT_ID']
#p1birthyear = female['BIRTH_YEAR']
p1age = female['AGE']
p1shellfish = female['SHELLFISH_ALG']
p1fish = female['FISH_ALG']
p1milk = female['MILK_ALG']
p1soy = female['SOY_ALG']
p1egg = female['EGG_ALG']
p1wheat = female['WHEAT_ALG']
p1peanut = female['PEANUT_ALG']
p1almond = female['ALMOND_ALG']
p1asth = female['NUM_ASTHMARX']
p1gen = female['Gender']
p1race = female['Race']
p1eth = female['Ethnicity']
# $p1birthyear[index] as p1birthyear, \
def create_multi_node(tx,p1subjectid,p1age,p1shellfish,p1fish,p1milk,p1soy,p1egg,p1wheat,p1peanut,p1almond,p1asth,p1gen,p1race,p1eth):
return tx.run(
"unwind range(0,size($p1subjectid)-1) as index \
with \
$p1subjectid[index] as p1subjectid, \
$p1age[index] as p1age, \
$p1shellfish[index] as p1shellfish, \
$p1fish[index] as p1fish, \
$p1milk[index] as p1milk, \
$p1soy[index] as p1soy, \
$p1egg[index] as p1egg, \
$p1wheat[index] as p1wheat, \
$p1peanut[index] as p1peanut, \
$p1almond[index] as p1almond, \
$p1asth[index] as p1asth, \
$p1gen[index] as p1gen, \
$p1race[index] as p1race, \
$p1eth[index] as p1eth \
merge(g:p1gen:Female{race:p1race, age:p1age, ethnicity:p1eth, asthma_RX:p1asth}) \
merge(alg:Allergy)<-[:HAS_ALLERGY{shellfish:p1shellfish, fish:p1fish,milk:p1milk,soy:p1soy,egg:p1egg,wheat:p1wheat,peanut:p1peanut, \
almond:p1almond}]-(g)",
p1subjectid=p1subjectid,p1age = p1age,p1shellfish = p1shellfish, \
p1fish = p1fish,p1milk = p1milk,p1soy = p1soy,p1egg = p1egg,p1wheat = p1wheat,p1peanut = p1peanut, \
p1almond = p1almond,p1asth = p1asth,p1gen = p1gen,p1race = p1race,p1eth = p1eth
)
session = driver.session(database="allergy")
# Execute the `create_mnc_node` "unit of work" within a write transaction
session.execute_write(create_multi_node, p1subjectid=p1subjectid,p1age = p1age,p1shellfish = p1shellfish, \
p1fish = p1fish,p1milk = p1milk,p1soy = p1soy,p1egg = p1egg,p1wheat = p1wheat,p1peanut = p1peanut, \
p1almond = p1almond,p1asth = p1asth,p1gen = p1gen,p1race = p1race,p1eth = p1eth)