Skip to main content

Terminal tool for building and exploring SKOS taxonomies and OWL ontologies

Project description

ster

CI codecov PyPI Python 3.11+ License: MIT Ruff

rdflib typer rich pylode

   _____ ______ ______ ____
  / ___//_  __// ____// __ \
  \__ \  / /  / __/  / /_/ /
 ___/ / / /  / /___ / _, _/
/____/ /_/  /_____//_/ |_|

  [ Breton: "Meaning" or "Sense" ]
  [  Semantic Knowledge Editor  ]
  v0.4.0

ster is a terminal tool for building and exploring semantic knowledge bases. Edit SKOS taxonomies and OWL ontologies in a full-screen TUI, explore them as interactive D3 force graphs, and export HTML documentation — all from your terminal, no database required.

ster is the Breton word for meaning, with homonyms for river and star. Let it guide your semantic voyage, keeping the flow and always following your star.


What's inside

Layer What ster does
Edit Full-screen TUI for SKOS concepts and OWL classes / individuals / properties
Visualise Interactive D3 v7 force graph — colour-coded clusters, drag, zoom, filter, detail panel
AI assist LLM-powered concept suggestions (online or local via Ollama)
Git Stage, commit, push without leaving the terminal
Export pyLODE HTML documentation; SPARQL query runner

Features

Interactive TUI — SKOS and OWL in one view

  • Full-screen tree browser for SKOS concept schemes and OWL class hierarchies
  • Inline concept creation, renaming, deletion, and label editing
  • Detail panel: view and edit all SKOS fields (labels, definitions, scope notes, related links…)
  • OWL layer: browse classes, named individuals, object/datatype properties, axioms
  • Visual indicator for concepts with cross-scheme mapping links
  • Fold / unfold subtrees; hidden-concept count shown
  • Scheme dashboard: completion rates, quality issues, concept counts at a glance
  • OWL class quality stats: label/comment coverage, instance count, and property fill rates displayed inline on each class node — mirrors SKOS completion labels
  • Ontology root node: selectable in the tree; selecting it opens the ontology overview panel
  • Smart startup: opening a pure-OWL file goes directly to the ontology overview, skipping the global view

D3 force graph visualisation

Open any ontology or taxonomy as an interactive force graph in the browser:

  • Colour-coded node clusters per root class or top concept
  • Node types rendered distinctly: OWL classes (rectangles), individuals (ellipses), SKOS concepts (small ellipses), schemes (rounded rects)
  • Representative images embedded inside nodes when schema:image is set
  • Drag, zoom, and pin nodes; hover tooltips; highlight neighbourhoods on click
  • Lane-based hierarchical layout option for SKOS concept trees
  • Closeable detail panel: × button or Escape hides the right panel; canvas expands to fill the full window; Escape again re-opens it
  • Link-type toggles: rdf:type and inScheme link families can be hidden/shown from the toolbar; auto-hidden on startup when there are more than 20 of either type
  • Cleaner default layout: stronger node repulsion, wider collision radius, longer link distances, and a larger initial spread for root classes

AI-assisted concept creation

When adding a concept (+ key), choose between entering a name manually or letting AI suggest up to 20 ordered concept names:

  • AI Auto Suggest — the AI acts as a professional taxonomist who knows your domain. It proposes names ranked by relevance, you pick one (or ask for more), and the form is pre-filled.
  • Before generating, ster shows you the exact prompt so you can review and adjust it.
  • Supports any LLM via the llm library — including local models via Ollama.
  • Pull Ollama models directly from the ⚙ Setup / Options wizard without leaving ster.
  • Copy-paste mode — no local LLM needed: ster displays the prompt, copies it to the clipboard, and you paste the model's response from any web AI (ChatGPT, Claude, Gemini…).

Multi-file workspace

  • Open several .ttl files at once and see a merged taxonomy view
  • Edits are always written to the correct source file automatically

Cross-scheme mapping

  • Add exactMatch, closeMatch, broadMatch, narrowMatch, relatedMatch links between concepts in different files
  • Remove links from the detail view — works even when the target file has been deleted
  • Both source and target files are saved and staged in git on every change

Git integration

  • Stage, commit, and push changes without leaving the terminal
  • Browse full commit history with diffs inside the TUI

HTML export

  • Generate a browsable, wiki-style HTML page from any taxonomy via pyLODE
  • One HTML file per language detected in the taxonomy
  • Sticky language-switcher bar links between language versions
  • Available from the main menu or ster export

Installation

Minimal (TUI + editing)

pip install ster

With AI features

pip install "ster[ai]"

Then configure your model from the main menu: ⚙ Setup / Options. No model needed if you use copy-paste mode.

With HTML export

pip install "ster[html]"

From source

git clone https://github.com/gbelbe/ster.git
cd ster
pip install -e .           # core only
pip install -e ".[ai]"     # with AI features
pip install -e ".[html]"   # with HTML export
pip install -e ".[dev]"    # with test suite

Dependencies

Group Package Purpose
core rdflib>=7.0 RDF parsing and serialisation
core typer[all]>=0.12 CLI framework
core rich>=13.0 Terminal rendering, prompts, tables
[ai] llm>=0.19 LLM abstraction layer (online & offline models)
[html] pylode>=3.0 HTML generation from SKOS / OWL (VocPub / OntPub profiles)
[dev] pytest>=8.0 Test suite
[dev] pytest-cov>=5.0 Coverage reporting

Both llm and pylode are not installed by default. When you trigger a feature that needs them, ster will offer to install the package automatically.


Quick start

Launch the interactive editor

ster

The home screen lists all ontology and taxonomy files in the current directory. Use arrow keys to navigate the action menu, then press Enter to confirm.

       ✓  my-ontology.ttl
       ✓  products.ttl

 ▶  1  ↵  Open Tree View
    2  ◈  Open Graph Viz
    3  🌐 Generate Web-Documentation
    4  ⎇  Browse git history
    5  🔍 Query Graph SPARQL (Beta)
    6  ⚙  Setup / Options
    7  📥 Import External Ontology
    8  ✕  Quit

Keyboard shortcuts (TUI)

Key Action
Navigate tree / fields
Enter Expand/collapse node or open detail
+ Add concept — opens a menu: enter name manually or use AI Auto Suggest
d Delete selected concept
e Edit selected field in detail panel
m Add a mapping link to another concept
g Commit & push changes
? Help screen
q / Esc Back / quit

AI Auto Suggest

Press + on any concept or scheme, then select ✦ AI Auto Suggest:

  1. ster renders the prompt and shows it for review — edit prompts.py to customise the wording
  2. Press Enter to generate; the AI suggests up to 20 concept names ranked by relevance
  3. Navigate the list and press Enter to pick a name (pre-fills the creation form)
  4. Select Suggest more to get a fresh batch with deduplication

In copy-paste mode the prompt is displayed and copied to the clipboard; paste the model's response back and press Enter on an empty line.

Export to HTML

ster export my-taxonomy.ttl          # generates ./html/my-taxonomy_en.html …
ster export my-taxonomy.ttl -l en,fr # specific languages only
ster export my-taxonomy.ttl -o /tmp  # custom output directory

Or use the 🌐 Generate Web-Documentation option from the main menu.

Validate

ster validate my-taxonomy.ttl

Annotating entities with rich media

ster reads schema:image, schema:video, and schema:url triples and uses them in the graph visualiser's detail panel:

@prefix schema: <https://schema.org/> .

<https://example.org/MyClass> a owl:Class ;
    rdfs:label "My Class"@en ;
    schema:image <https://upload.wikimedia.org/wikipedia/commons/thumb/.../500px-image.png> ;
    schema:video <https://www.youtube.com/watch?v=...> ;
    schema:url   <https://en.wikipedia.org/wiki/My_Class> .

Images appear as thumbnails inside D3 node circles; videos open in a popup window; URLs render as link buttons in the detail panel.


Architecture

ster/
├── model.py          — Pure dataclasses: Concept, ConceptScheme, Taxonomy, RDFClass, OWLIndividual…
├── store.py          — RDF I/O via rdflib (.ttl / .rdf / .jsonld); loads SKOS + OWL layers
├── operations.py     — All SKOS mutations (add, remove, move, relate…)
├── workspace.py      — Multi-file workspace: merged view + per-file saves
├── workspace_ops.py  — Cross-file mapping operations
├── nav.py            — Full-screen TUI (curses): tree, detail, inline edit; SKOS + OWL modes
├── nav_state.py      — Typed state machine: one dataclass per viewer mode
├── nav_logic.py      — Pure functions: tree flattening, field builders, OWL node rendering
├── cli.py            — Typer entry-points (ster, ster export…)
├── ai.py             — LLM abstraction: model routing, copy-paste mode, Ollama integration
├── prompts.py        — All AI prompt templates (string.Template)
├── html_export.py    — pyLODE HTML export (VocPub / OntPub profiles)
├── viz.py            — Standalone D3 graph: writes HTML, opens in browser
├── owl_analysis.py   — OWL axiom analysis and statistics
├── sparql_query.py   — SPARQL query runner against the loaded taxonomy
├── git_manager.py    — Git staging, commit, push
├── git_log.py        — Git history browser (TUI)
├── git_log_logic.py  — Pure functions: diff parsing, field extraction for git log viewer
├── handles.py        — Short handle generation from camelCase URIs
└── validator.py      — SKOS integrity checks

Each layer depends only on the layers below it, keeping every module independently testable. AI prompts live in prompts.py as plain string.Template objects — edit them freely without touching any logic.


Supported formats

Extension Format
.ttl Turtle (recommended)
.rdf / .xml RDF/XML
.jsonld / .json JSON-LD
.owl OWL/XML

Development

pip install -e ".[dev]"
pytest
pytest --cov=ster --cov-report=term-missing

CI / CD

Every push and pull request runs four parallel jobs via GitHub Actions:

Job Tool What it checks
Lint ruff Code style, import order, common bugs
Type check mypy Static type correctness
Security bandit + pip-audit SAST + known CVEs in dependencies
Tests pytest × Python 3.11 / 3.12 / 3.13 Full test suite + coverage report

Coverage is uploaded to Codecov on every run.

Run checks locally

pip install -e ".[dev]"

ruff check .            # lint
ruff format --check .   # format
mypy ster/              # types
bandit -r ster/ -c pyproject.toml   # security
pip-audit               # dependency CVEs
pytest --cov=ster       # tests + coverage

Or install the pre-commit hooks to run ruff automatically on every commit:

pip install pre-commit
pre-commit install

Changelog

0.4.0

  • OWL class quality stats: label/comment coverage, instance count, and property fill rates shown inline on each class node in the OWL hierarchy — mirrors SKOS completion labels on concept trees
  • Ontology root selectable: the ontology name node in the tree view is now navigable; selecting it opens the ontology overview panel
  • Smart startup panel: opening a pure-OWL file now shows the ontology overview directly on startup
  • Welcome screen: replaced keyboard-shortcut content with the ster logo, installed version, and a yellow PyPI update notice when a newer release is available
  • D3 graph — closeable detail panel: × button or Escape hides the right panel; the canvas expands to fill the full window; Escape again re-opens it
  • D3 graph — link-type toggles: rdf:type and inScheme links can be toggled on/off from the bottom bar; auto-hidden at startup when there are more than 20 of either type
  • D3 graph — cleaner default layout: stronger node repulsion (−600), wider collision radius, longer link distances (200), larger initial root-class circle, slower alpha decay for better final spread
  • Menu: renamed "External Ontologies" → "Import External Ontology"

0.3.2

  • Show update notice with release notes summary when a new version is available on PyPI
  • Restructured main menu: new icons (◈ graph, ⎇ git), reordered items, renamed "Configure AI" → "Setup / Options", added "Query Graph SPARQL (Beta)"
  • Tree view auto-detects file content: OWL-only files open in ontology mode, SKOS-only in taxonomy mode
  • D3 graph: root OWL classes visually distinct (brighter fill, glow ring, bolder text); legend adapts to content actually present in the file
  • Fixed: Escape key in graph viz now always returns to global view
  • Fixed: OWL individuals correctly nested under their parent classes in the tree
  • Fixed: multiline rdfs:comment values no longer bleed across TUI panels
  • Fixed: global tree view no longer renders OWL classes twice
  • Extend git diff view to detect all field changes: broader/narrower/related, match properties, schema:image/video/url, subClassOf, rdf:type, property assertions, OWL properties
  • Removed "Generate Browsable Website" menu option (use ster export CLI instead)

0.3.1

  • Auto-publish to PyPI via GitHub Actions (OIDC trusted publishing) on every passing CI run
  • Animate AI suggestion spinners during generation
  • Handle missing Ollama gracefully; stream pull output with progress updates

0.3.0

  • Full-screen TUI for SKOS concept schemes and OWL class hierarchies
  • Interactive D3 force graph visualisation in the browser with entity detail panel
  • AI-assisted concept creation via llm library (online and local via Ollama)
  • Git integration: stage, commit, push without leaving the terminal
  • HTML export via pyLODE (VocPub and OntPub profiles)
  • SPARQL query runner against the loaded taxonomy

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ster-0.4.0.tar.gz (395.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ster-0.4.0-py3-none-any.whl (235.6 kB view details)

Uploaded Python 3

File details

Details for the file ster-0.4.0.tar.gz.

File metadata

  • Download URL: ster-0.4.0.tar.gz
  • Upload date:
  • Size: 395.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for ster-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cff836419b750f2e28f91ff0dcc5898005b5d173466207a68498674a4cc78089
MD5 2a4fdb1ff84b0c70a9024eb0a95ca715
BLAKE2b-256 6f4d62a3be95486b410f9d50bfa5255b06fec05f489ee16016a96d70fedcf818

See more details on using hashes here.

File details

Details for the file ster-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ster-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 235.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for ster-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfeb707a39be3c07262586fb53f6a7d10b6f8d161f0104f1ab2be2c358e4bd6c
MD5 8f65c3ee934ee5f64fb6499837d9818d
BLAKE2b-256 05386a1aa5fe285ad90c291c3e494b380cf97cfe3fb3d89c3338066a1ef9d8d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page