Package ai.chatur.cortex.core.ontology
Class OntologyService
java.lang.Object
ai.chatur.cortex.core.ontology.OntologyService
Provides access to the ontology the knowledge graph is built on.
-
Constructor Summary
ConstructorsConstructorDescriptionOntologyService(org.apache.jena.ontapi.model.OntModel ontModel) Creates the service. -
Method Summary
Modifier and TypeMethodDescriptionList<ai.chatur.cortex.OntologyClass> Returns the class hierarchy of the ontology, guarding against cycles.Returns the ontology.
-
Constructor Details
-
OntologyService
public OntologyService(org.apache.jena.ontapi.model.OntModel ontModel) Creates the service.- Parameters:
ontModel- the ontology model
-
-
Method Details
-
getOntology
Returns the ontology.- Returns:
- the ontology serialized in Turtle syntax
-
getClassHierarchy
Returns the class hierarchy of the ontology, guarding against cycles.- Returns:
- the root classes, each carrying its subclasses, sorted by name
-