Hello everyone, sorry I'm a Neo4j newbie here, trying to solve a practical problem to see if neo4j is fit for the application.
Let's say I have a database with nodes of two types Candyjars and Candies. Every Candyjar (Candyjar1, Candyjar2...) has different number of candies of different types: CandyRed, CandyGreen etc..
Now let's say the end game here is to find how much is the probability of the various types of candies to occur together, and the covariance among them. Then I want to have relationships between each CandyType with an associated probabilities of co-occurence and covariance. Let's call this relationships OCCURS_WITH so that Candtype1 -[OCCURS_WITH]->Candytype2 and Candytype1 -[COVARIES]->Candytype2
I'd make a database with CandieTypes and CandyJars as nodes, make a relationship (cj:CandyJar)-[r:CONTAINS]->(ct:Candytype) where r can have an attribute to set "how many" candy of a type are cotained in the jar.
Ideally,having a a structure of the form:
(ct1:Candytype)<-[r1:CONTAINS]-(cj:CandyJar)-[r2:CONTAINS]->(ct2:Candytype)
I would want in output a table that is structured like A or B:
A) ct1.name,r1.amount,cj.id, r2.amount,ct2.name, COUNTS(r1)
B) ct1.name, cj.id , ct2.name, LIST(r1), LIST(r2), COUNTS(r1)
Where counts(r1) has to be the amount of total relationships that match the pattern and LIST(r1) is a list of all the relationship objects.
I cannot seem to obtain either of such tables, as if I ask for r1 or cj then count is always 1, and something similar happens with COLLECT, not outputting a list.
Can anybody help or point me to relevant examples?