ontoindex-cli 0.4.0

CLI for OntoIndex ontology indexing and querying
ontoindex-cli-0.4.0 is not a library.

OntoCode

CI Extension VS Code E2E License MSRV Rust edition

crates core parser catalog query cli lsp owl downloads Docs

Ontology-as-code for Git and VS Code — v0.4.0 ships today.

Browse OWL/RDF in VS Code, edit Turtle ontologies, query and validate in CI, and index workspaces locally with a Rust engine. v0.4 adds patch-based write-back and Horned-OWL catalog integration; Manchester editing and reasoning are on the roadmap.

Naming: OntoCode is the VS Code extension (product UI). OntoIndex is the Rust engine (ontoindex CLI, ontoindex-* crates, ontoindex-lsp). This repo contains both.

Documentation: Read the DocsStart here · 5-minute guide

Choose your path

Use the CLI (OntoIndex)

cargo install ontoindex-cli
ontoindex query /path/to/your/ontologies "SELECT * FROM classes"
ontoindex validate .

Note: ./fixtures exists only in a git clone. After cargo install, point at your own ontology folder (see getting started guide).

From a clone, cargo run -- runs the ontoindex binary (workspace default-member is ontoindex-cli):

cargo run -- query fixtures "SELECT * FROM classes"

Use VS Code (OntoCode Explorer)

  1. Install OntoCode from the Marketplace, or download a VSIX from GitHub Releases.
  2. Open a folder with .ttl, .owl, .rdf, or other supported ontology files.
  3. Use the OntoCode activity bar to browse entities, edit in the inspector, and open diagnostics.

Full install and troubleshooting: install guide. Editing guide: authoring guide.

OntoCode Explorer preview

Two-layer architecture

OntoCode is designed as two products that ship together:

Layer What it is Status in v0.4.0
OntoCode VS Code extension (explorer, entity inspector, diagnostics, authoring) Shipping
OntoIndex Rust library + CLI + LSP (scan, parse, catalog, query, validate, diagnostics, write-back) Shipping
┌─────────────────────────────────────┐
│  OntoCode (v0.4.0)                  │
│  VS Code extension + explorer UI    │
└─────────────────┬───────────────────┘
                  │ ontoindex-lsp (stdio)
┌─────────────────▼───────────────────┐
│  OntoIndex (v0.4.0)                 │
│  Rust index, catalog, query, CLI, LSP │
└─────────────────┬───────────────────┘
                  │ Oxigraph / Horned-OWL
┌─────────────────▼───────────────────┐
│  Your ontology repo                 │
│  .ttl .owl .rdf .jsonld …           │
└─────────────────────────────────────┘

OntoIndex is useful on its own today (CLI, CI, local analysis). The extension calls into the same engine via a language server rather than reimplementing ontology logic in TypeScript.

What ships in v0.4.0

VS Code (OntoCode): Browse ontologies, entity inspector with editing, diagnostics, jump-to-source.

Engine (OntoIndex): Index, SQL/SPARQL query, validate, patch write-back for Turtle.

Capability VS Code CLI
Browse classes, properties, individuals Yes via SQL
Edit labels, comments, parents (.ttl) Yes ontoindex patch
Create / delete entities (.ttl) Yes ontoindex patch
Diagnostics / lint Problems panel ontoindex validate
SPARQL ontoindex sparql
SQL-like queries ontoindex query

Earlier releases: see CHANGELOG.md.

Why OntoCode?

Protégé is strong for traditional ontology editing, but most engineering teams live in Git, pull requests, and VS Code. OntoCode targets that workflow:

Shipped in v0.4 Planned (v1.0 target)
Browse ontologies in VS Code Hybrid authoring: forms + Manchester editor
Entity inspector with edit labels, parents, create/delete Complex class expressions in Manchester
Patch write-back for Turtle (.ttl) Multi-format write-back
Horned-OWL catalog for Turtle axioms Full OWL 2 DL axiom editing
Inline diagnostics (Problems panel + explorer) Query workbench, reasoners + explanations
ontoindex validate and ontoindex patch for CI OBO format + ROBOT interop
SQL-like and SPARQL queries via CLI Semantic Git diff, LSP completion/rename
Local-first indexing SHACL validation (rudof)

Long-term goal: Protégé-competitive OWL 2 DL + OBO maintenance in VS Code — see Protégé parity checklist.

Quick start

See the getting started guide or First success in 10 minutes for full paths (clone, cargo install, release binaries, VS Code).

# From a git clone
cargo build --release
cargo run -- inspect fixtures
cargo run -- query fixtures "SELECT * FROM classes"
cargo run -- validate fixtures
# Installed CLI (use your ontology path, not ./fixtures)
cargo install ontoindex-cli
ontoindex query /path/to/ontologies "SELECT * FROM classes"
ontoindex validate /path/to/ontologies

Coming in v0.5+

Future plans (not all implemented) — specs in design docs:

  • SPARQL and SQL query panels in VS Code
  • Manchester syntax editor
  • Reasoner integration and graph visualization
  • Semantic Git diff viewer

The extension is a thin TypeScript shell over ontoindex-lsp and the OntoIndex crates — not a second ontology stack.

Roadmap

Version Deliverable
v0.1 OntoIndex: scanner, parser, catalog, CLI
v0.2 VS Code extension, explorer, entity inspector, LSP
v0.3 Ontology diagnostics (Problems panel, validate)
v0.4.0 (current) Write-back — Turtle patches, Horned-OWL catalog, editable inspector
v0.5 Query workbench + Manchester MVP
v0.6 Reasoning via OntoLogos 0.9.0 (EL, RL, inferred hierarchy)
v0.7–v0.7b Graphs + OBO/ROBOT interop
v0.8–v0.9 Full Manchester, refactoring, semantic diff; ontologos-watch hook
v1.0 Protégé-competitive OWL + OBO in VS Code — DL via OntoLogos 1.0.0 (parity checklist)

See roadmap, product plan, and Protégé parity checklist for the full product plan.

Built on

OntoIndex delegates to mature Rust libraries — see dependency matrix.

Layer Crates Crate
RDF / SPARQL Oxigraph ontoindex-parser, ontoindex-query
SQL queries sqlparser ontoindex-query
OWL axioms / write-back horned-owl, horned-functional ontoindex-owl
Reasoning (planned) OntoLogos ontoindex-reasoner (planned)
OBO (planned) fastobo planned v0.7b
LSP lsp-server, lsp-types ontoindex-lsp

Policy: ADR-0016. Third-party licenses (including LGPL for horned-owl): LICENSES.

Repository layout

crates/
├── ontoindex-core      # types, workspace scanner
├── ontoindex-parser    # RDF parsing and entity extraction
├── ontoindex-owl       # Horned-OWL facade, patch write-back (v0.4)
├── ontoindex-catalog   # index builder and semantic catalog
├── ontoindex-diagnostics # lint rules and diagnostic collection
├── ontoindex-query     # SQL-like and SPARQL engines
├── ontoindex-cli       # `ontoindex` binary
└── ontoindex-lsp       # language server for OntoCode
extension/              # VS Code extension (OntoCode Explorer)
fixtures/               # sample ontology for tests
scripts/                # extension packaging helpers
docs/                   # user guides (install, SQL, LSP API)
docs/design/            # product specs, ADRs, wireframes, backlog
examples/               # Rust examples and query cookbook
tests/                  # integration and golden snapshot tests

Virtual tables

Table Description
ontologies Indexed ontology documents
classes OWL/RDFS classes
object_properties OWL object properties
data_properties OWL datatype properties
annotation_properties OWL annotation properties
individuals OWL named individuals
entities All extracted entities
annotations Label/comment and other annotation triples
axioms Extracted axioms (e.g. SubClassOf)
namespaces Namespace prefixes
imports Ontology imports
diagnostics Lint and parse diagnostics
properties Union of all property kinds

Column schemas: SQL reference. SPARQL: SPARQL reference. LSP methods: LSP API. Workspace limits: workspace limits.

API stability (pre-1.0)

Published ontoindex-* crates are at 0.4.x. Library APIs, LSP wire JSON, and SQL virtual table columns may change between minor releases until v1.0 stable core is complete. The CLI validate exit code (errors fail, warnings pass) is documented in workspace limits.

Development

See CONTRIBUTING.md or the contributing guide. Quick checks:

cargo build -p ontoindex-lsp --bins
cargo test --workspace
cd extension && npm ci && npm test
cargo fmt --all
cargo clippy --workspace --all-targets --all-features -- -D warnings

Update golden snapshots:

ONTOINDEX_UPDATE_GOLDEN=1 cargo test golden_classes

Installing from releases

Pre-built artifacts on GitHub Releases:

  • ontoindex CLI (Linux x64)
  • ontoindex-lsp per platform (Linux, macOS, Windows)
  • ontocode-*.vsix (VS Code extension)

Verify downloads: release integrity. Maintainer release process: releasing guide.

Workspace crates publish to crates.io on each v0.4.x release tag (first publish in v0.4.0): ontoindex-core, ontoindex-parser, ontoindex-owl, ontoindex-diagnostics, ontoindex-catalog, ontoindex-query, ontoindex-lsp, ontoindex-cli.

See CHANGELOG.md for release notes. Security: security policy.

License

MIT OR Apache-2.0. Third-party licenses: LICENSES.