Posts

Showing posts with the label neo4j

graphing dorm movements in neo4j

graphing dorm movements in neo4j I'm really struggling getting my head around neo4j and was hoping someone might be able to help point me in the right direction with the below. Basically, I have a list of what can be referred to as events; the event can be said to describe a patient entering and leaving a room. Each event has a unique identifier; it also has an identifier for the student in question along with start and end times (e.g. the student entered the room at 12:00 and left at 12:05) and an identifier for the room. The event and data might look along the lines of the below, columns separated by a pipe delimiter ID|SID|ROOM|ENTERS|LEAVES 1|1|BLUE|1/01/2015 11:00|4/01/2015 10:19 2|2|GREEN|1/01/2015 12:11|1/01/2015 12:11 3|2|YELLOW|1/01/2015 12:11|1/01/2015 12:20 4|2|BLUE|1/01/2015 12:20|5/01/2015 10:48 5|3|GREEN|1/01/2015 18:41|1/01/2015 18:41 6|3|YELLOW|1/01/2015 18:41|1/01/2015 21:00 7|3|BLUE|1/01/2015 21:00|9/01/2015 9:30 8|4|BLUE|1/01/2015 19:30|3/01/2015 11:00 9|5|GREEN|...

neo4j: represent object property instead of relationship in links between objects

Image
neo4j: represent object property instead of relationship in links between objects I want to use neo4j to represent networks, in order to make nice graphics like this one: Here is the code used so far: CREATE (router1:Router {name:'router1', defaultgw:'192.168.123.1'}) CREATE (network1:Network {name:'network1', cidr:'192.168.123.0/24'}) CREATE (server1:Server {hostname:'server1', ip:'192.168.123.7'}) CREATE (server2:Server {hostname:'server2', ip:'192.168.123.9'}) CREATE (router1)-[:CONNECTED_TO {}]->(network1), (network1)-[:CONNECTED_TO {}]->(server1), (network1)-[:CONNECTED_TO {}]->(server2) WITH router1 AS r MATCH (r)-[:CONNECTED_TO]->(n)-[:CONNECTED_TO]->(s) RETURN r,n,s ; Is there a way to represent the subnet used between router and network, and the ip of the server on the link between servers and related network, instead of the appropriate but meaningless CONNECTED_TO ? CONNECTED_TO I have tried to ...