which is Better : relationship vs node

24 views
Skip to first unread message

Navrattan Yadav

unread,
May 21, 2014, 4:38:36 AM5/21/14
to ne...@googlegroups.com
hi . i am using Neo4j 2.0.3 version.
 i am working on a DB where we need to track user path based on some fixed location.

like which location is most visited.

so what i am doing : 
1. Each user has unique node.
2. Each location has unique node.

when user traverse a location then which is better option :
 1. create a relation b/w location node and user node . relation name is : username_time :  so when ever a user traverse a location a new relation is created.
  or 
 2. create a node new node which has user info and location info and time. so when ever a user traverse a location a new node is created.
   or 
any better idea...  Any suggestion would be highly appreciated.

Michael Hunger

unread,
May 21, 2014, 4:49:08 AM5/21/14
to ne...@googlegroups.com
Depends on your use-case, what do you want to do with the data? If you just want to store the fact that the user was there a relationship is good enough. If the actual visit is a really important concept in your domain that also other things are linked to and which has its own identity then a node would be better.


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Navrattan Yadav

unread,
May 21, 2014, 4:53:36 AM5/21/14
to Neo4J
From data i want to calculate : 
1. which location is most visited by user.
2. which path is most visited by users
3. also need  track  a user : path or location visited by him.
4. Also need to track how muck time a user spent on a location




--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/ENlM3VVmdys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks and Regards

Navrattan Yadav

Michael Hunger

unread,
May 21, 2014, 4:59:58 AM5/21/14
to ne...@googlegroups.com
Perhaps you can start by modelling that in a GraphGist with Cypher Queries for the use-cases. And then we can discuss it on these concrete examples?

See: http://www.neo4j.org/learn/graphgist
And gist.neo4j.org -> examples list on the right

Navrattan Yadav

unread,
May 21, 2014, 5:09:30 AM5/21/14
to Neo4J
thanks Michael . After creating Model i will share
Reply all
Reply to author
Forward
0 new messages