Loading Ontologies
Loading via HTTP
Section titled “Loading via HTTP”curl -X POST http://localhost:8080/ontology \ -H "Content-Type: text/turtle" \ --data-binary @your-ontology.ttlThis single request parses, validates, compiles, applies the schema, persists the ontology, initializes the reasoning engine, and triggers retroactive materialization.
Loading via CLI
Section titled “Loading via CLI”# Load an ontology into a running clusterdgraph ontology load your-ontology.ttl --alpha http://localhost:8080
# Validate without applyingdgraph ontology validate your-ontology.ttl --alpha http://localhost:8080Validate Before Loading
Section titled “Validate Before Loading”Test your ontology without side effects:
curl -X POST "http://localhost:8080/ontology?validate=true" \ -H "Content-Type: text/turtle" \ --data-binary @your-ontology.ttlReturns the compiled schema and any validation errors without applying changes.
What Validation Checks
Section titled “What Validation Checks”- Turtle syntax — valid Turtle format
- OWL2 RL compliance — all constructs within the RL profile
- Circular subclass detection — A subClassOf B subClassOf A is rejected
- Conflicting characteristics — a property can’t be both symmetric and asymmetric
- Undefined references — domain/range referencing non-existent classes
Ontology Persistence
Section titled “Ontology Persistence”The raw Turtle data is stored in the database as an OWLGraphMeta node. On Alpha restart, the ontology is automatically reloaded — no manual intervention needed.
Updating an Ontology
Section titled “Updating an Ontology”Loading a new ontology replaces the current one. The process:
- New ontology is parsed and validated
- New schema is compiled and applied
- Old reasoning engine is replaced with new one
- Retroactive materialization runs for existing data
Caution: Ontology updates can trigger significant retroactive materialization if the class hierarchy changes. Test updates in a staging environment first.
Best Practices
Section titled “Best Practices”- Validate first — always use
?validate=truebefore applying to production - Version your ontologies — keep ontology files in version control
- Start simple — begin with core classes, add complexity incrementally
- Test with data — load sample data and run queries to verify behavior