I have a Neo4j graph database containing: a) user nodes (U1, U2, etc) and
b) a relationship [:TEXTED] with properties: i)year (2013, 2014), ii)
message_count.
I am trying to retrieve all the users that U1 texted in 2013 and not in
2014 and vice versa. So far I have come up with the following query:
MATCH (n:User { id:'1'}) - [r:TEXTED]-> (m) WHERE r.year = '2013' WITH n,m
MATCH (n)-[k:TEXTED]->(m) WHERE k.year <> '2014' RETURN n.id AS User1,
m.id AS User2
However this query returns all the user U1 texted in 2013 regardless if
they texted them in 2014. I can query to find the common user pairs in 2013
and 2014 and then import to some spreadsheet program but defeats
efficiency.
Any suggestions for creating the query would be much appreciated.
Also as a general question, how should time-based relationships like the
one above should they be stored in the graph database? For the above
problem I think it would be easier to create 2 separate relationship ( [
TEXTED_IN_2013] and [TEXTED_IN_2014]) . But I wonder if that's the way to
go.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.