apoc.meta.graph.of

Procedure

apoc.meta.graph.of(graph Any, config Map<String, Any>) - examines the given sub-graph and returns a meta-graph.

Signature

apoc.meta.graph.of(graph = {} :: ANY?, config = {} :: MAP?) :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)

Input parameters

Name Type Default

graph

ANY?

{}

config

MAP?

{}

Output parameters

Name Type

nodes

LIST? OF NODE?

relationships

LIST? OF RELATIONSHIP?

Usage Examples

Type of supported input graphs

Type Description

String

a Cypher query

Virtual Graph

a Virtual Graph returned by apoc.graph.*

Map

a map with two field nodes (a list of nodes, mandatory), relationships (a list of relationships)

If you have a quite complex Graph, and you want to analyze and get some info about a specific sub-graph in it, you can leverage the apoc.meta.graph.of procedure.

So for the given Graph Model:

apoc.meta.graph.example

You can leverage the apoc.meta.graph.of procedure in this way:

apoc.meta.graph.of

That will extract the Meta Graph of the provided query, with some stats like the count for each node involved into the query.

If you want more details you can also look at apoc.meta.graph documentation