Class OntologyService

java.lang.Object
ai.chatur.cortex.core.ontology.OntologyService

public class OntologyService extends Object
Provides access to the ontology the knowledge graph is built on.
  • Constructor Details

    • OntologyService

      public OntologyService(org.apache.jena.ontapi.model.OntModel ontModel)
      Creates the service.
      Parameters:
      ontModel - the ontology model
  • Method Details

    • getOntology

      public String getOntology()
      Returns the ontology.
      Returns:
      the ontology serialized in Turtle syntax
    • getClassHierarchy

      public List<ai.chatur.cortex.OntologyClass> getClassHierarchy()
      Returns the class hierarchy of the ontology, guarding against cycles.
      Returns:
      the root classes, each carrying its subclasses, sorted by name