Files
semantica/docs/reference/explorer.md
T
KaifAhmad1andClaude Sonnet 4.6 946a1089c8 docs: premium redesign — Mintlify v4, dark/cream theme, full module coverage
- Migrate from mint.json to docs.json (Mintlify v4)
- Theme: maple, emerald green + near-black dark / cream light palette
  (#059669 primary, #0A0A0A dark bg, #FAF7F0 light bg)
- Typography: Lexend headings, Inter body
- 5-tab navigation: Documentation, Quick Start, API Reference, Cookbook, FAQ
- Homepage: removed badge stickers, redundant h2, added blockquote tagline,
  full 27-module reference table with semantica.mcp_server added
- quickstart.md: CodeGroup per pipeline step, pattern vs LLM options,
  AccordionGroup for patterns and troubleshooting
- faq.md: full AccordionGroup structure across 5 sections
- reference/explorer.md: NEW — FastAPI explorer, Ontology Hub, Distance
  Intelligence, CLI reference, REST API endpoints
- reference/mcp_server.md: NEW — MCP stdio server, 12 tools with I/O
  examples, 3 resources, Claude Desktop/VS Code/Windsurf/Cline config
- docs.json: explorer added to Output group, mcp_server to Utilities group
- Chat, feedback (thumbs/suggest/raise), OG/Twitter metadata, search topbar
- All reference pages reformatted with Mintlify JSX components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 21:52:50 +05:30

147 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Explorer"
description: "Interactive FastAPI dashboard for knowledge graph exploration and the Ontology Hub."
icon: "map"
---
`semantica.explorer` provides a browser-based dashboard for exploring knowledge graphs, managing ontologies, and running visual analyses — no code required.
---
## Installation
```bash
pip install "semantica[explorer]"
```
Requires `uvicorn` and `fastapi`. Included automatically with `pip install semantica[all]`.
---
## Launch
<CodeGroup>
```bash CLI
# Start the explorer on a saved graph
semantica-explorer --graph my_graph.json
# Custom host and port
semantica-explorer --graph my_graph.json --host 0.0.0.0 --port 8080
# Don't auto-open browser
semantica-explorer --graph my_graph.json --no-browser
```
```python Python
from semantica.context import ContextGraph
from semantica.explorer import start_explorer
graph = ContextGraph(advanced_analytics=True)
# ... build or load your graph ...
graph.save("my_graph.json")
# Launch the dashboard
start_explorer(graph_path="my_graph.json", port=8000)
```
```python Module
# Run directly as a Python module
# python -m semantica.explorer --graph my_graph.json --port 8000
import subprocess
subprocess.run(["python", "-m", "semantica.explorer", "--graph", "my_graph.json"])
```
</CodeGroup>
---
## CLI Reference
| Flag | Default | Description |
|------|---------|-------------|
| `--graph`, `-g` | *(required)* | Path to a ContextGraph JSON file |
| `--port`, `-p` | `8000` | Port to bind the server |
| `--host` | `127.0.0.1` | Host to bind the server |
| `--no-browser` | `false` | Skip auto-opening the browser |
---
## Features
### Graph Explorer
The core dashboard for navigating knowledge graphs:
- **Indexed search** — find any node by label or type; 0.004ms on 118k-node graphs
- **Bidirectional path finding** — trace paths between any two nodes
- **Neighbor expansion** — click any node to expand its connections
- **Filter by entity type** — focus on specific node types (Person, Organization, Event, etc.)
- **Edge label display** — relationship types shown on all edges
- **Graph declutter** — workspace layout controls for dense graphs
### Ontology Hub (v0.5.0)
Full ontology lifecycle management in the browser:
- **Visual ontology editor** — drag-and-drop class and property authoring
- **SHACL Studio** — create, validate, and test SHACL shapes with live feedback
- **Alignment authoring** — author ontology alignments across schemas
- **Health dashboard** — graph quality metrics, validation status, coverage reports
- **Version control** — snapshot, diff, and restore ontology versions
### Distance Intelligence (v0.5.0)
Semantic neighborhood analysis:
- **N×N distance matrices** — pairwise semantic distances across node sets
- **Ego-mode visualization** — focus on a single node's semantic neighborhood
- **Distance band classification** — nodes grouped as `near` / `mid` / `far`
- **Embedding cache** — optimized embedding reuse for large graphs
### Knowledge Explorer API
Full FastAPI backend accessible at `http://localhost:8000/docs`:
- 12+ export formats (RDF, Parquet, AQL, JSON-LD, and more)
- WebSocket progress streaming for long operations
- Thread-safe sessions with rollback protection
- Audit trail for all operations
---
## API Endpoints
The FastAPI server exposes a REST API alongside the browser dashboard:
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/graph/summary` | `GET` | Node count, edge count, entity types |
| `/api/graph/search` | `GET` | Full-text and type-filtered node search |
| `/api/graph/path` | `GET` | Bidirectional path between two nodes |
| `/api/graph/neighbors` | `GET` | Neighbors of a node with optional depth |
| `/api/ontology/validate` | `POST` | Run SHACL validation on the graph |
| `/api/export/{format}` | `GET` | Export graph in specified format |
| `/ws/progress` | `WS` | WebSocket stream for operation progress |
Full OpenAPI docs available at `http://localhost:8000/docs` when the server is running.
---
## See Also
<CardGroup cols={2}>
<Card title="Context" icon="brain" href="context">
Build and save the ContextGraph that Explorer loads.
</Card>
<Card title="Ontology" icon="sitemap" href="ontology">
Programmatic ontology management and SHACL generation.
</Card>
<Card title="Visualization" icon="chart-network" href="visualization">
Programmatic graph rendering without the full Explorer server.
</Card>
<Card title="Export" icon="file-export" href="export">
Export to RDF, Parquet, AQL without launching a server.
</Card>
</CardGroup>