Hi , thanks in advance.
I would like to set a relationship between 2 nodes with a property value instead of a conventional HAS_A , IS_A thingy. For example Patient has a Diagnosis for example Diabetes.
i want to say PATIENT-[:Diabetes]->Diagnosis{type:Diabetes}
PATIENT-[:Cancer]->Diagnosis{type:Cancer}
PATIENT-[:Thyroid]->Diagnosis{type:Thyroid}
Here instead of a Has a relation if i can keep the property values, i could easily count how many patients have Diabetes and Cancer etc., And more could be done easily as the data volume is huge.
Please let me know how.
Please keep the following things in mind:
did you search for what you want to ask before posting?
This will create the relationship as shown and you can run MATCH statement.
Here is sample code to illustrate this
match (a:Cat {name:'dadu'})
with a
merge (b:Chicken {name: 'chick'})
with a, b, 'HAS3.2' as r1
CALL apoc.create.relationship(a, `r1`,{}, b) YIELD rel
REMOVE rel.noOp
Result:
Added 1 label, created 1 node, set 1 property, completed after 31 ms.
match (a:Cat)-[:`HAS3.2`]->(b)
return a, b
Return the above graph.