apoc.meta.data.of

Procedure

apoc.meta.data.of(graph ANY, config MAP<STRING, ANY>) - examines the given sub-graph and returns a table of metadata.

This procedure is not considered safe to run from multiple threads. It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13). For more information, see the Cypher Manual → Parallel runtime.

Signature

apoc.meta.data.of(graph :: ANY, config = {} :: MAP) :: (label :: STRING, property :: STRING, count :: INTEGER, unique :: BOOLEAN, index :: BOOLEAN, existence :: BOOLEAN, type :: STRING, array :: BOOLEAN, sample :: LIST<ANY>, left :: INTEGER, right :: INTEGER, other :: LIST<STRING>, otherLabels :: LIST<STRING>, elementType :: STRING)

Input parameters

Name Type Default

graph

ANY

null

config

MAP

{}

Config Parameters

This procedure supports the following config parameters:

Table 1. Config parameters
Name Type Default Description

sample

INTEGER

1000

Number of nodes to sample. Setting sample to -1 will remove sampling.

Sampling

Specify the sample parameter (1000 by default) to analyze a subset of the data.

The sample, along with the count of nodes for each label, is used to calculate a skip value. Since this value is generated using a random number generator, results obtained through the sampling method may vary between subsequent runs.

Example 1. Calculating skip count for data sampling

If a database contains 500 nodes with the label Foo label, the skip count for that label is calculated as follows:

The skip count per node label is determined by generating a random number between (totalNodesForLabel / sample) ± 0.1.

Sample 10: skipCount = 500 / 10 = 50
The resulting skip count will be between 45 and 55.

Sample 50: skipCount = 500 / 50 = 10
The resulting skip count will be between 9 and 11.

Sample 100: skipCount = 500 / 100 = 5
The resulting skip count will be 5.

The skip count represents the number of nodes skipped before one is examined. For instance, with a skip count of 5, every 5th node is examined. Consequently, a higher sample number results in more nodes being sampled.

To stop sampling set sample: -1.

Output parameters

Name Type

label

STRING

property

STRING

count

INTEGER

unique

BOOLEAN

index

BOOLEAN

existence

BOOLEAN

type

STRING

array

BOOLEAN

sample

LIST<ANY>

left

INTEGER

right

INTEGER

other

LIST<STRING>

otherLabels

LIST<STRING>

elementType

STRING

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 want more details you can look at apoc.meta.data documentation