Introspection API
The introspection API provides read-only access to the loaded ontology structure. Use it to explore classes, properties, hierarchies, and relationships at runtime.
Endpoint
Section titled “Endpoint”All introspection queries go to GET /ontology/introspect with query parameters.
List All Classes
Section titled “List All Classes”curl http://localhost:8080/ontology/introspectReturns an array of all classes in the ontology with their hierarchical relationships.
Get Class Details
Section titled “Get Class Details”curl "http://localhost:8080/ontology/introspect?class=Dog"{ "iri": "Dog", "superClasses": ["Mammal", "Animal"], "subClasses": ["GoldenRetriever", "Labrador"], "disjointWith": ["Cat"], "properties": [ { "iri": "hasOwner", "type": "ObjectProperty", "domain": ["Animal"], "range": ["Person"], "isFunctional": true }, { "iri": "name", "type": "DataProperty", "range": ["string"], "isFunctional": true }, { "iri": "breed", "type": "DataProperty", "domain": ["Dog"], "range": ["string"], "isFunctional": true } ]}Get Subclasses
Section titled “Get Subclasses”# Direct subclasses onlycurl "http://localhost:8080/ontology/introspect?subclasses=Animal"
# All descendants (transitive closure)curl "http://localhost:8080/ontology/introspect?subclasses=Animal&transitive=true"Get Superclasses
Section titled “Get Superclasses”# Direct superclassescurl "http://localhost:8080/ontology/introspect?superclasses=GoldenRetriever"
# All ancestors (transitive closure)curl "http://localhost:8080/ontology/introspect?superclasses=GoldenRetriever&transitive=true"Use Cases
Section titled “Use Cases”- Dynamic UIs: Build forms that adapt to the ontology structure
- Validation: Check if a class exists before inserting data
- Documentation: Auto-generate API docs from the ontology
- Debugging: Verify that the ontology was loaded correctly
- AI agents: Let LLMs explore the ontology to formulate queries