I have a dataset of 941 persons with the label PERSOON.
For these persons I already calculated the Label propagation, Weakly Connected Components and Louvain.
Of the WCC I made separate computations of a native and cypher projection.
In the end each Person has 4 new properties: lpa, wcc, wcc_cypher and louvain.
The PERSOON node looks like:
{
"identity": 606,
"labels": [
"PERSOON",
],
"properties": {
"louvain": 596,
"neo4jImportId": "18349390",
"wcc": 47,
"lpa": 596,
"naam": "Jansen, J",
"wcc_cypher": 549
}
}
For every Person node I want to show the different community sizes of each of these properties = calculations on one row as a table.
Question: what is the mos efficient way to query these statistics?
I tried the following query and although they work, the PROFILE shows an big number of rows hit.!
PROFILE MATCH (p:PERSOON)
WITH p
CALL {
WITH p
MATCH (l:PERSOON {louvain: p.louvain})
RETURN count(*) AS louvain
}
CALL {
WITH p
MATCH (wcc:PERSOON {wcc: p.wcc})
RETURN count(*) AS wcc
}
CALL {
WITH p
MATCH (wcc_cypher:PERSOON {wcc_cypher: p.wcc_cypher})
RETURN count(*) AS wcc_cypher
}
CALL {
WITH p
MATCH (lpa:PERSOON {lpa: p.lpa})
RETURN count(*) AS lpa
}
RETURN p.naam, lpa, wcc, wcc_cypher, louvain
When using 2 MATCH statements and querying 3 properties:
PROFILE MATCH (p:PERSOON)
MATCH (l:PERSOON {louvain: p.louvain}),
(wcc:PERSOON {wcc: p.wcc}),
(wcc_cypher:PERSOON {wcc_cypher: p.wcc_cypher})
RETURN p.naam, count(wcc), count(wcc_cypher), count(l) AS louvain
When using 2 MATCH statements and querying 4 properties:
PROFILE MATCH (p:PERSOON)
MATCH (l:PERSOON {louvain: p.louvain}),
(wcc:PERSOON {wcc: p.wcc}),
(wcc_cypher:PERSOON {wcc_cypher: p.wcc_cypher}),
(lpa:PERSOON {lpa: p.lpa})
RETURN p.naam, count(lpa), count(wcc), count(wcc_cypher), count(l) AS louvain
This query did'nt finish, so no profile.