Aggregate existing Labels
MATCH (n) RETURN DISTINCT labels(n)
Or unwinding label pairs
MATCH (n)
WITH DISTINCT labels(n) AS labels
UNWIND labels AS label
RETURN DISTINCT label
ORDER BY label
MATCH (n) RETURN DISTINCT labels(n)
Or unwinding label pairs
MATCH (n)
WITH DISTINCT labels(n) AS labels
UNWIND labels AS label
RETURN DISTINCT label
ORDER BY label