Best practices¶
Patterns for using OntoCode and OntoIndex in daily ontology engineering.
Repository layout¶
- Keep ontology source files in a dedicated directory (e.g.
ontologies/orsrc/ontology/) - Prefer Turtle (
.ttl) for files you edit in VS Code — write-back is Turtle-only - Use a single-root VS Code workspace for the ontology project (multi-root indexes only the first folder)
When to use SQL vs SPARQL vs classify¶
| Tool | Best for |
|---|---|
SQL (ontoindex query) |
Catalog tables — classes, properties, diagnostics, axioms metadata |
SPARQL (ontoindex sparql) |
RDF graph patterns over indexed triples |
validate |
CI gate for parse errors and lint |
classify |
CI gate for unsatisfiable classes (EL/RL/RDFS) |
SQL and SPARQL results truncate silently at 100,000 rows — narrow queries in CI. See workspace limits.
CI recipe picker¶
| Goal | Command |
|---|---|
| Lint + parse | ontoindex validate . |
| Unsatisfiable classes | ontoindex classify . --profile el --format json |
| Inspect errors | ontoindex query . "SELECT code, message FROM diagnostics WHERE severity = 'error'" |
Examples: CI integration
VS Code workflow¶
- Open ontology folder (single-root)
- Trust workspace
- Edit in Entity Inspector or Manchester editor (
.ttlonly) - Run Index Workspace after bulk file changes
- Use Query Workbench for ad-hoc catalog queries
Protégé teams¶
Use OntoCode for Git-native Turtle editing, CI validation, and EL classification. Keep Protégé for full DL editing until v1.0 — see Protégé coexistence.
Rust embedding¶
Embed OntoIndex in tools or pipelines via the published crates — see Rust library guide.