Returned Properties of APOC Sub-Graph unclear (apoc.meta.subGraph)

Hello all,

I know that db.schema() can not be trusted without post validation (see Bug - db.schema() returning non-existent relationships · Issue #9726 · neo4j/neo4j · GitHub). Therefore I use apoc.meta.subgraph for creating a Meta-Model of the stored graph. But it returns some properties that I can not make sense of.

The procedure returns the following properties:

  • count (ok, that's a low brainer... the count of the rel type in total)
    but there are as well...
  • in (Integer)
    -out (Integer)

And whatever I try to sum up based on possible relation counts for the
(Start-Node)-[rel-type]->(End-Node) combinations in my source data will never match the rel counts I find in apoc.meta.subgraph.

Can anyone point me to an explanation / doc where these properties are explained how they are calculated?

Any help greatly appreciated


Sometimes a little more trying would help...

Here is the answer I found:

Count: the number of all relations of this Type between each START-Node and END-Node of EVERY Type in the repo
Out: the number of ALL Relations going out of the START-Node of this Type
In: the number of ALL Relations going IN the END-Node Type connected with the START-Node Type

so for a possible group of one Start-Node Type and n-End-Node Types connected with the START-Node Type, the sum of all IN Relations will be equal to the OUT value.