Viewing database schema
Procedures with the apoc.meta
suffix provide the functionality to inspect the metadata about graph, such as viewing the current schema or database statistics or inspecting the types. We will take a look at some important procedures:
The first one we will explore is the procedure to display the schema graph.
This displays the metadata graph that represents the schema of how nodes are related to each other:
CALL apoc.meta.graph()
In the following screenshot, we can see that the metadata graph seems very busy. This is because this representation does not understand nodes with multiple labels correctly and they are represented independently:
Figure 10.15 – Full APOC metadata graph
The nodes with the labels home
, hospice
, and so on are the secondary labels on the Encounter
nodes.
We can have a cleaner representation using apoc.meta.subGraph
. When we call this method, we can use, include, or exclude the node labels so...