Skip to content

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.

All introspection queries go to GET /ontology/introspect with query parameters.

Terminal window
curl http://localhost:8080/ontology/introspect

Returns an array of all classes in the ontology with their hierarchical relationships.

Terminal window
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
}
]
}
Terminal window
# Direct subclasses only
curl "http://localhost:8080/ontology/introspect?subclasses=Animal"
# All descendants (transitive closure)
curl "http://localhost:8080/ontology/introspect?subclasses=Animal&transitive=true"
Terminal window
# Direct superclasses
curl "http://localhost:8080/ontology/introspect?superclasses=GoldenRetriever"
# All ancestors (transitive closure)
curl "http://localhost:8080/ontology/introspect?superclasses=GoldenRetriever&transitive=true"
  • 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