You can filter on relationship properties like you would node properties, in the WHERE
clause. Just make sure you bind the relationship to an identifier in the MATCH
clause. I don't understand your model (is the temperature a property of the causation?) but you could try something like
MATCH (body_temperature) <-[r:CAUSES]- (fever)
WHERE r.degreeCelsius > 102
Is that what you are looking for?
Edit
To make a CREATE
clause dependent on some condition you can state your condition as a pattern which only matches the cases where you want something created, and then just proceed to create. Just make sure that in your START
, MATCH
and WHERE
clauses you bind the different nodes or relationships that you want to use in your CREATE
clause. Sometimes you might have to use WITH
to carry results to a new part of your query, but for your case first try something like
START bodyTemp = node:MyIndex(name="Body Temperature"), fever = node:MyIndex(name="Fever")
WHERE HAS(bodyTemp.degreeCelsius) AND bodyTemp.degreeCelsius > 102.0
CREATE bodyTemp -[:CAUSES]-> FEVER