feat(graph-explorer): add Graph Explorer with LLM query translation, i18n, and exploration UI#52
Closed
will-yuponce-db wants to merge 13 commits intomainfrom
Closed
feat(graph-explorer): add Graph Explorer with LLM query translation, i18n, and exploration UI#52will-yuponce-db wants to merge 13 commits intomainfrom
will-yuponce-db wants to merge 13 commits intomainfrom
Conversation
Integrates property graph editor/visualizer from graph-demo into ontos. All graph data reads/writes go through Databricks Statement Execution API (no Postgres tables). Users specify a Unity Catalog table name in the UI and the backend auto-creates it if needed. Backend: - GraphExplorerManager using statement_execution.execute_statement() - Edge-centric table schema (node_start_id, relationship, node_end_id) - Standalone nodes stored as EXISTS self-referencing edges - Pydantic models for API request/response validation - FastAPI routes: GET, POST /save, DELETE /node, DELETE /edge, PUT /node Frontend: - Table name selector with Connect/Reload/Save actions - Force-directed graph visualization (react-force-graph-2d) - Node/edge CRUD dialogs, search, controls panel, node palette - useGraphEditor hook for client-side graph state management - 33 unit tests (types, hook, component) Also includes pre-existing config renames (postcss.config, tailwind.config .js -> .cjs) and import reordering in database.py from prior branch. Co-authored-by: Cursor <cursoragent@cursor.com>
6b99fc0 to
7e1b272
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
…oloring Internationalize all Graph Explorer components using react-i18next with translation files for en, de, fr, es, it, ja, nl. Fix stale closure bug preventing edge creation by using useRef for interactive callbacks in react-force-graph-2d. Fix node coloring to preserve type-based colors on selection/hover by rendering state indicators as separate rings. Co-authored-by: Cursor <cursoragent@cursor.com>
…ce overhaul Add a collapsible Graph Query Panel that translates Cypher, Gremlin, or natural language queries to Databricks SQL via a configurable foundational LLM endpoint (LLM_FOUNDATIONAL_ENDPOINT). Results overlay the main graph. Backend: - New /api/graph-explorer/query and /llm-config endpoints - GraphExplorerManager: LLM translation, graph schema introspection, query result parsing, OpenAI-compatible client with SDK OBO fallback - Pydantic models for query request/response and LLM config - LLM_FOUNDATIONAL_ENDPOINT config with fallback chain Frontend: - New GraphQueryPanel component with language toggle, example queries, SQL preview, limit-removal, and contextual status alerts - GraphVisualization: d3-force clustering by node type, degree-based sizing, adaptive edge opacity, collision forces, progressive quality reduction for large graphs (>5k elements), throttled hover, position caching across data updates - GraphControls: edge opacity slider, "Select All" for filters, improved color legend with proposed/modified indicators - Added d3-force dependency for custom force configuration - i18n strings for query panel Co-authored-by: Cursor <cursoragent@cursor.com>
- Regenerate yarn.lock for d3-force and @types/d3-force additions - Add missing 'natural' key to buildExampleQueries return type Co-authored-by: Cursor <cursoragent@cursor.com>
Phase 1 of the Graph Explorer evolution plan — exploration-first UI: - 1a: Expand-neighbors API endpoint with direction/type filtering, truncation metadata; frontend mergeNeighbors/collapseNode hooks - 1b: Right-click context menus for nodes (expand/collapse/edit/delete), edges (edit/delete), and canvas (create node/fit to screen) - 1c: Server-side safety limits (GRAPH_MAX_NODES/EDGES/QUERY_TIMEOUT config), automatic truncation with frontend banner - 1d: Dual results view — graph/table/split toggle with sortable node and edge tables - 1e: Save/restore diagram snapshots (localStorage per table) Tests: 38 new frontend tests (449 total), 25 backend graph explorer unit tests — all passing, zero regressions vs baseline. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add pytest-asyncio and configure asyncio_mode=auto for async tests - Fix Pydantic validation in test mocks (UUID, datetime, bool, int types) - Fix logging references in security_features_manager (logging -> logger) - Fix data_contract_id -> contract_id in data_products_manager publish - Fix notifications_manager tests with proper mock injection - Fix UserInfo construction in search_manager tests (add user/ip fields) - Fix settings_manager mock with missing WORKSPACE_DEPLOYMENT_PATH Co-authored-by: Cursor <cursoragent@cursor.com>
…missing DialogDescription - Add DialogDescription (sr-only) to NodeForm and EdgeForm dialogs to satisfy Radix accessibility requirement - Move "Clear Query" button out of CollapsibleTrigger's child button in GraphQueryPanel to fix validateDOMNesting warning - Bonus: fixes 6 previously failing node-palette tests (455/455 pass) Co-authored-by: Cursor <cursoragent@cursor.com>
…ntend tests Remove unused imports (useMemo, React, within, container), cast Element to HTMLElement for within() calls, and add missing react-i18next mock to node-palette tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Eliminates the duplicate config field and its fallback validator — graph explorer now reads LLM_ENDPOINT directly like every other feature. Co-authored-by: Cursor <cursoragent@cursor.com>
Add PermissionChecker to all graph-explorer routes (READ_ONLY for reads, READ_WRITE for mutations). Move get_graph_explorer_manager to manager_dependencies.py and add GraphExplorerManagerDep to dependencies.py, matching the pattern used by all other managers. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop GraphTableView component, its tests, view-mode toggle UI, and related i18n keys. The graph canvas is now the only view. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a full-featured Graph Explorer for visualizing and editing property graphs stored in Databricks Unity Catalog tables. Includes backend CRUD via the Statement Execution API, a force-directed visualization canvas, LLM-powered natural language / Cypher / Gremlin to SQL query translation, and an exploration-first UI with context menus and diagram management.
Backend
GraphExplorerManager— all graph operations viastatement_execution.execute_statement()(no Postgres/SQLAlchemy)models/graph_explorer.py)GET /api/graph-explorer,POST /save,DELETE /node,DELETE /edge,PUT /node,POST /ensure-tableCREATE TABLE IF NOT EXISTS)LLM_ENDPOINTconfig (removed duplicateLLM_FOUNDATIONAL_ENDPOINT)READ_ONLYfor reads,READ_WRITEfor mutations), matching the app-wide RBAC patternGraphExplorerManagerDepindependencies.py/manager_dependencies.pyFrontend
catalog.schema.table, click Connect)react-force-graph-2dwith performance optimizationsuseGraphEditorhook for client-side graph state managementCode quality & CI fixes
Integration
features.py(backend) andfeatures.ts(frontend)app.py, view wired inapp.tsxstartup_tasks.py)getNavigationGroups()PermissionCheckerwithgraph-explorerfeature IDTest plan
tsc --noEmit)test_graph_explorer_manager.py)