A reference platform that maps real-world data domains to graph models, reasoning tasks, and recommended layouts. Graphmaster is a meta-graph—a knowledge graph about graphs—that helps developers and architects make informed decisions about graph visualization and analysis.
git clone https://github.com/yourusername/graphmaster.git
cd graphmaster
./setup.shThis will:
- Start Neo4j in Docker
- Install npm dependencies
- Load all seed data
Then open http://localhost:7474 (credentials: neo4j / graphmaster)
Requirements: Docker + Node.js 18+
Graphmaster answers questions like:
- "For an ITSM domain, which graph layouts work best?"
- "What reasoning tasks does a Knowledge Graph support?"
- "Which constraints apply to hierarchical data, and what happens when they're violated?"
- "I need to do root-cause analysis—which layout should I use?"
┌─────────────────────────────────────────────────────────────────────┐
│ GRAPHMASTER │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Domain ──HAS_PATTERN──► GraphPattern │
│ │ │ │
│ │ ├──HAS_CONSTRAINT──► Constraint │
│ │ │ │ │
│ └──REQUIRES_TASK─┐ │ ◄──VIOLATES_CONSTRAINT──┤
│ │ │ │ │
│ ▼ │ FailureMode │
│ Layout ──SUPPORTS_TASK──► ReasoningTask ▲ │
│ │ │ │
│ ├──OBSCURES_TASK──► ReasoningTask │ │
│ ├──WORKS_WITH──► GraphPattern │ │
│ ├──INCOMPATIBLE_WITH──► GraphPattern │ │
│ ├──REQUIRES_CONSTRAINT──► Constraint │ │
│ └──CAN_CAUSE───────────────────────────────────────┘ │
│ │
│ ExampleGraph ──ILLUSTRATES──► GraphPattern │
│ │
└─────────────────────────────────────────────────────────────────────┘
| Node | Description |
|---|---|
| Domain | Real-world problem areas (ITSM, Knowledge Graphs, Biology, etc.) |
| Layout | Graph visualization algorithms (Dagre, CoSE, Concentric, etc.) |
| ReasoningTask | Cognitive tasks users perform (root-cause analysis, clustering, etc.) |
| GraphPattern | Structural patterns (DAG, tree, mesh, bipartite, etc.) |
| Constraint | Rules that must hold (acyclicity, single root, etc.) |
| FailureMode | What goes wrong when constraints are violated |
| ExampleGraph | Small illustrative graphs demonstrating patterns |
If you already have Neo4j running (local install, Aura, etc.):
git clone https://github.com/yourusername/graphmaster.git
cd graphmaster
npm install
# Configure connection
cp .env.example .env
# Edit .env with your Neo4j credentials
npm run ingestExpected output:
╔════════════════════════════════════════════════════════════╗
║ GRAPHMASTER NEO4J INGESTION ║
╚════════════════════════════════════════════════════════════╝
✓ Neo4j connection verified
📂 Loading and validating data...
✓ Loaded and validated 10 items from domains.json
✓ Loaded and validated 17 items from layouts.json
✓ Loaded and validated 15 items from reasoning-tasks.json
✓ Loaded and validated 12 items from graph-patterns.json
✓ Loaded and validated 12 items from constraints.json
✓ Loaded and validated 10 items from failure-modes.json
✓ Loaded relationships from relationships.json
📋 Creating uniqueness constraints...
📇 Creating indexes...
📥 Ingesting nodes...
🔗 Ingesting relationships...
╔════════════════════════════════════════════════════════════╗
║ INGESTION COMPLETE ║
╚════════════════════════════════════════════════════════════╝
npm run queriesThis demonstrates the types of questions Graphmaster can answer.
MATCH (l:Layout)-[r:SUPPORTS_TASK]->(t:ReasoningTask {name: 'Root Cause Analysis'})
RETURN l.name as layout, r.strength as strength
ORDER BY CASE r.strength WHEN 'strong' THEN 1 WHEN 'moderate' THEN 2 ELSE 3 ENDMATCH (d:Domain {slug: 'itsm'})-[:REQUIRES_TASK]->(t:ReasoningTask)
MATCH (l:Layout)-[:SUPPORTS_TASK]->(t)
RETURN DISTINCT l.name as layout, collect(DISTINCT t.name) as supportedTasksMATCH (l:Layout {name: 'Dagre'})-[:INCOMPATIBLE_WITH]->(p:GraphPattern {topology: 'cyclic'})
MATCH (l)-[:CAN_CAUSE]->(f:FailureMode)
RETURN f.name, f.symptom, f.mitigationsMATCH (d:Domain {slug: 'itsm'})-[:HAS_PATTERN]->(p:GraphPattern)
MATCH (l:Layout)-[:WORKS_WITH]->(p)
RETURN d.name as domain, p.name as pattern, collect(DISTINCT l.name) as layoutsgraphmaster/
├── src/
│ ├── types/
│ │ ├── nodes.ts # TypeScript types + Zod schemas for all node types
│ │ ├── relationships.ts # Relationship types and metadata
│ │ └── index.ts
│ ├── data/
│ │ ├── domains.json # Domain seed data
│ │ ├── layouts.json # Layout seed data (from Cytoscape.js research)
│ │ ├── reasoning-tasks.json
│ │ ├── graph-patterns.json
│ │ ├── constraints.json
│ │ ├── failure-modes.json
│ │ └── relationships.json # All relationships between nodes
│ └── scripts/
│ ├── db.ts # Neo4j connection utilities
│ ├── ingest.ts # Main ingestion script
│ └── queries.ts # Sample query demonstrations
├── docs/
├── .env.example
├── .gitignore
├── package.json
├── tsconfig.json
└── README.md
The layout taxonomy is derived from Cytoscape.js documentation and demos, mapped to:
- Formal graph theory concepts
- Cognitive affordances (what reasoning each layout enables)
- Domain applicability
- Constraint requirements
- Idempotent Ingestion: Uses
MERGEexclusively—safe to re-run anytime - Zod Validation: All JSON data is validated at load time against TypeScript types
- No APOC: Pure Cypher, works with any Neo4j 5+ deployment
- Relationship Properties: Supports metadata like
strengthon SUPPORTS_TASK edges - Extensible: Add new domains, layouts, or patterns by editing JSON files
- Add entry to
src/data/domains.json - Add relationships in
src/data/relationships.json - Run
npm run ingest
- Add entry to
src/data/layouts.jsonfollowing theLayoutSchema - Add SUPPORTS_TASK, WORKS_WITH, and other relationships
- Run
npm run ingest
| Command | Description |
|---|---|
./setup.sh |
Full setup (start Neo4j + seed data) |
npm run neo4j:start |
Start Neo4j |
npm run neo4j:stop |
Stop Neo4j |
npm run neo4j:clean |
Stop Neo4j and delete all data |
npm run neo4j:shell |
Open Cypher CLI |
npm run neo4j:logs |
View Neo4j logs |
npm run ingest |
Load/reload data into Neo4j |
npm run queries |
Run sample queries |
npm run build |
Compile TypeScript |
MIT
This is a portfolio project demonstrating:
- Domain-driven graph modeling
- Idempotent ETL patterns
- TypeScript + Neo4j integration
- Schema-as-code principles
Contributions welcome!