Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-28-2020 11:15 PM
I am completely new to Neo4j. The current graph version is 4.0.1 Enterprise. The issue being faced by me is that of cypher query.
The data can be viewed using the following link
Below are some screenshots that help understand the data.
call db.schema.visualization()
one Person above can be linked only to one type.
This is the part where I am facing the issue
MATCH (p1:PERSON)<-- (:TYPE{name:"t1"})
MATCH (P2:PERSON)<-- (:TYPE{name:"t2"})
RETURN COUNT(p1), COUNT(P2)
Here I get the result as 1786(38*47) for both the counts. I need the first column to have value 38 and the other to have 47.
P.S.: This is a dummy problem recreated to mimic a real-world situation of creating a self-join of one person with another from the other type. The CSV load is taking too much time thus even though that is a simpler way the computation time is so much that the desktop is not able to process it even though I have set heap space of 8GB space.
Thanks in advance for the help.
Solved! Go to Solution.
03-29-2020 07:09 AM
MATCH (p1:PERSON)<-- (:TYPE{name:"t1"})
WITH COUNT(p1) as p1_count
MATCH (P2:PERSON)<-- (:TYPE{name:"t2"})
RETURN p1_count, count(p2) as p2_count
You can try this.
03-29-2020 07:09 AM
MATCH (p1:PERSON)<-- (:TYPE{name:"t1"})
WITH COUNT(p1) as p1_count
MATCH (P2:PERSON)<-- (:TYPE{name:"t2"})
RETURN p1_count, count(p2) as p2_count
You can try this.
03-29-2020 11:14 PM
Thank you for the help @jaini.kiran !!
Does this have a constraint that it can only be used for aggregation or single result cause I am not able to return the nodes in this scenario thus Relation building is becoming challenging
All the sessions of the conference are now available online