Sangeetha-Grantha

Metadata Value
Status Archived
Version 1.0.0
Last Updated 2026-09-10
Author Sangeetha Grantha Team
Document Type Archive

Graph Explorer Requirement (Original Neo4j Proposal)


[!NOTE] Historical evidence: results, counts, commands, and observations below belong to the original work described here. The editorial update date is not a new test or corpus verification. For present behavior, use current feature map.


title: Graph Explorer Requirement (Original Neo4j Proposal) status: Superseded version: 1.0 last_updated: 2025-01-27 note: This document outlines the detailed requirements for the Graph Explorer feature in Sangeetha Grantha. This feature will enable users to visualize and navigate the relationships between various entities in Carnatic music. This document is a refinement of the high-level requirements in the Graph Explorer Feature Requirements. for the approved implementation. —


⚠️ STATUS: SUPERSEDED

This document was the original requirement specifying Neo4j implementation. After critical evaluation (see Graph Database Evaluation), the architecture team approved the PostgreSQL + Cytoscape.js approach instead.

For current requirements and implementation strategy, see:- Graph Explorer Feature Requirements


Original Requirement (Historical Reference)

Goal: implement a Music-Aware Graph Explorer (Admin Web) backed by Neo4j Community (graph projection). Postgres remains the system-of-record; Neo4j is a derived projection for traversal + visualization.

0) Non-negotiables

1) High level deliverables

A) Backend (Ktor) additions:

  1. Add Neo4j driver wiring and config
  2. Add “graph projection query” endpoints for explorer
  3. Add a basic read-only “neighborhood” and “query by mode” API

B) Frontend (admin-web) additions:

  1. New route /graph-explorer
  2. A Cytoscape.js-based graph canvas (NOT Bloom)
  3. Entity-shaped nodes (different shapes per entity label)
  4. Domain-aware controls:
    • Explorer mode dropdown: Krithi | Composer | Raga | Deity | Kshetram | Tag
    • Search input (typeahead optional, but at least a search)
    • Depth slider (1..3)
    • Filters panel (optional v1: show/hide labels, relationship types)
  5. A right-side details panel showing selected node properties and related links

C) Docs:

2) Neo4j graph model (assume these labels/edges exist)

Node labels:

Relationships:

All nodes have: id: UUID, name/title (as applicable), and workflow_state (optional).

3) Backend implementation details (Ktor)

3.1 Configuration

3.2 Neo4j client module

Create a small module (keep idiomatic Kotlin):

3.3 DTOs (backend)

Define DTOs for graph visualization:

3.4 API endpoints

Add under /api/admin/graph (auth same as admin APIs): 1) GET /api/admin/graph/neighborhood Query params:

2) GET /api/admin/graph/search Query params:

3) GET /api/admin/graph/preset Query params:

3.5 Cypher queries (safe + parameterized)

4) Frontend implementation details (React + TS)

Assume admin-web is React+TS+Tailwind.

4.1 Route + page

Add:

Layout:

4.2 Cytoscape.js setup

Use Cytoscape.js with a clean, minimal style.

Notes:

4.3 Data mapping

Backend returns nodes/edges; map to Cytoscape elements:

4.4 Interaction

4.5 Styling + DX

5) Repo integration / File structure expectations

Keep code aligned with existing patterns:

6) Acceptance criteria

7) Implementation steps (do them in order)

  1. Add backend Neo4j client + config
  2. Add graph endpoints + DTOs + basic Cypher for neighborhood/search
  3. Add frontend page + cytoscape + fcose layout + details panel
  4. Add docs
  5. Add small seed/dev helper notes (how to test with sample IDs)

Now implement all changes with working code.


Section index · Documentation home · Feature status