apoc.meta.data.of
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. |
Syntax |
|
||
Description |
Examines the given sub-graph and returns a table of metadata. |
||
Input arguments |
Name |
Type |
Description |
|
|
The graph to extract metadata from. |
|
|
|
Number of nodes to sample, setting sample to |
|
Return arguments |
Name |
Type |
Description |
|
|
The label or type name. |
|
|
|
The property name. |
|
|
|
The count of seen values. |
|
|
|
If all seen values are unique. |
|
|
|
If an index exists for this property. |
|
|
|
If an existence constraint exists for this property. |
|
|
|
The type represented by this row. |
|
|
|
Indicates whether the property is an array. If the type column is "RELATIONSHIP," this will be true if there is at least one node with two outgoing relationships of the type specified by the label or property column. |
|
|
|
This is always null. |
|
|
|
The ratio (rounded down) of the count of outgoing relationships for a specific label and relationship type relative to the total count of those patterns. |
|
|
|
The ratio (rounded down) of the count of incoming relationships for a specific label and relationship type relative to the total count of those patterns. |
|
|
|
The labels of connect nodes. |
|
|
|
For uniqueness constraints, this field shows other labels present on nodes that also contain the uniqueness constraint. |
|
|
|
Whether this refers to a node or a relationship. |
Config Parameters
This procedure supports the following config parameters:
Name | Type | Default | Description |
---|---|---|---|
|
|
1000 |
Number of nodes to sample. Setting |
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.
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
.
Type of supported input graphs
Type | Description |
---|---|
STRING |
a Cypher query |
Virtual Graph |
a Virtual Graph returned by |
MAP |
a map with two field |
If you want more details you can look at apoc.meta.data
documentation