Modeling conditional relationships in neo4j v.2 (cypher) -


i have 2 related problems need with.

problem 1: how model conditional relationship? want data indicate when test clt1's "result" property = "high", clt1 has relationship disease a. if take node-centric approach, imagine code might like...

(clt 1 {result: "high"})  -[:indicates] -> (disease a) 

further, when clt1's "result" property = "low", clt1 has relationship disease b

(clt 1 {result: "low"})  -[:indicates] ->  (disease b) 

alternatively, if take relationship-centric approach, code might this...

(clt 1) -[:indicates {result: "high"}] -> (disease a) (clt 1) -[:indicates {result: "low"} ] -> (disease b) 

problem 2

i have had experience modeling data, there 1 node unique name, either different labels or properties. thing want these nodes distinguishable. however, not same cypher.

i can either give them multiple properties, labels or different names. diversity has each different class... in labels or properties (1+n labels, properties) or in different names.

problem 2 relates problem 1 in can't model conditional relationship or distinguish same node (clt1) labels or properties. may have resolve making query-able "condition" in relationship.

do have right? have other options?

for first question, i'd take relationship-centric approach kind of represents inference of information leading result-node disease.

should work pretty in modeling , querying too.

for second question. that's node-labels represent different roles node can play, each different relevant properties , relationships.

so match (p:person {name:"jose"}) , treat differently match (d:developer {name:"jose"}). i.e @ other props , rels.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -