Basic QueriesΒΆ

Count all the nodes

MATCH (n)
RETURN count(n)

Count all the relationships

MATCH ()-->() RETURN count(*)

List all the labels of the nodes

CALL db.labels()

List all the relationship types

CALL db.relationshipTypes()

Visualisation of the relationships

CALL db.schema.visualization()
../_images/relation1.png

Sample some nodes and display the different labels

MATCH (n) WHERE rand() <= 0.05
RETURN
DISTINCT labels(n)
MATCH (n)
RETURN
DISTINCT labels(n),
count(*) AS SampleSize

which results in

labels(n)

SampleSize

[Address]

59228

[Entity]

24957

[Other]

186

[Intermediary]

2031

[Officer]

77012

get more information on the number of properties that the Officer nodes have :

MATCH (n:Officer)
RETURN
count(*) AS SampleSize,
avg(size(keys(n))) as Avg_PropertyCount,
min(size(keys(n))) as Min_PropertyCount,
max(size(keys(n))) as Max_PropertyCount

SampleSize

Avg_PropertyCount

Min_PropertyCount

Max_PropertyCount

77012

6.58902508699943

5

8

Last change: Oct 30, 2023