Explore an unfamiliar graph schema in 5 minutes
Wann einsetzen: You got handed a graph DB with no docs. You need a mental model before you can write useful queries.
Voraussetzungen
- Neo4j Bolt URL + user/password —
NEO4J_URI=bolt://host:7687,NEO4J_USERNAME,NEO4J_PASSWORD - Read-only user recommended for exploration —
CREATE USER claude SET PASSWORD '...' SET ROLES reader
Ablauf
-
Get schema overviewCall get_neo4j_schema. Summarize node labels, relationship types, and the most common (label)-[rel]->(label) patterns.✓ Kopiert→ Schema summary with sample triples
-
Sample representative nodesFor the 3 most common labels, MATCH (n:Label) RETURN n LIMIT 3 each. Describe what each label seems to represent.✓ Kopiert→ Semantic descriptions of labels
-
Draw the likely ER modelBased on schema + samples, describe in prose the 'entity' story of this graph. What's the main object, what connects to it, what's peripheral?✓ Kopiert→ Clear domain model description
Ergebnis: A one-page domain model you can validate with the original authors.
Fallstricke
- Sampling tiny graphs gives misleading patterns — Also MATCH (n)-[r]->() RETURN type(r), count(*) to see which rels dominate