apoc.meta.data.of

Procedure APOC Core

apoc.meta.data.of({graph}, {config}) - examines a subset of the graph to provide a tabular meta information

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? OF ANY?, left :: INTEGER?, right :: INTEGER?, other :: LIST? OF STRING?, otherLabels :: LIST? OF STRING?, elementType :: STRING?)

Input parameters

Name Type Default

graph

ANY?

null

config

MAP?

{}

Config parameters

The procedure support the following config parameters:

Table 1. Config parameters
name type default description

sample

Long

1000

number of nodes to sample per label. See "Sampling" section below.

addRelationshipsBetweenNodes

boolean

true

number of relationships to sample per relationship type

Sampling

Because the count stores return an incomplete picture of the data, we have to cross check the results with the actual data to filter out false positives.

We use a subset of the data to analyze by specifying the sample parameter (1000 by default).

Through this parameter, for each label we split data for each node-label into batches of (total / sample) ± rand where total is the total number of nodes with that label and rand is a number between 0 and total / sample / 10.

So, we pick a percentage of nodes with that label of roughly sample / total * 100% to check against. We pick the first node of each batch, and we analyze the properties and the relationships.

Output parameters

Name Type

label

STRING?

property

STRING?

count

INTEGER?

unique

BOOLEAN?

index

BOOLEAN?

existence

BOOLEAN?

type

STRING?

array

BOOLEAN?

sample

LIST? OF ANY?

left

INTEGER?

right

INTEGER?

other

LIST? OF STRING?

otherLabels

LIST? OF 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