Is it possible to query the graph in neo4j with just a part of the value of a relation's property? -


i trying move info of data flows db. data flows this:

e_app1 sends data i_app1. i_app1 sends data i_app3. i_app3 sends data i_app5. e_app2 sends data i_app2. i_app2 sends data i_app3. i_app3 sends data i_app5. e_app3 sends data i_app2. i_app2 sends data i_app4. i_app4 sends data i_app5. i_app5 sends data i_app6. e_app4 sends data i_app3. i_app3 sends data i_app5. i_app5 sends data i_app6. e_app5 sends data i_app2. i_app2 sends data i_app4. i_app4 sends data i_app5.

i thinking of having property named "of" of "sends data" relationship contain names of data being sent can trace flow of particular application. on lines of below diagram. possible query of values, "show relations of value contains e_app4 only"?

this first time trying graph db , thinking of using relationships complex. not looking high performance here. there other approach should follow able achieve result of tracing flow of particular application?

link diagram:http://s27.postimg.org/5qieemks3/graph_data_modeling.jpg

you diagram little complicated, asking find relationships of type of , has node type e_app4 end node. there no restricion on start node.

so query should work:

match (startnode) -[of:of]->(endnode:e_app4) return startnode, of, endnode; 

this ofcourse assumes following:

  1. the relationship directed start node end node. hence relationship e_app4 start node not counted. if wish count also, remove -> , replace -.
  2. the start node can anything.
  3. only relationship of type of considered. mind it, name case sensitive. relationship must labeled of.
  4. end nodes must labeled e_app4.

edit

reading question again show relations of value contains e_app4 only guess misunderstood you. asking can check value of relationship. yes can. here query:

match (startnode) -[of:of]->(endnode) has(of.property) , of.property = "e_app4" return of; 

this assumes:

  1. the properties defined in relationships have key property
  2. this check relationships has key property. if relationship not have key, relationships not counted.

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -