Class GraphController

java.lang.Object
ai.chatur.cortex.spring.graph.GraphController

@Controller public class GraphController extends Object
Web UI for browsing the knowledge graph: the class hierarchy, the instances of a class, and everything known about a single resource.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraphController(ai.chatur.cortex.CortexOntology ontology, ai.chatur.cortex.CortexQuery query)
    Creates the controller.
  • Method Summary

    Modifier and Type
    Method
    Description
    describeUri(String uri, org.springframework.ui.Model model)
    Renders everything known about a single resource, including statements derived by inference.
    getAssertions(String type, org.springframework.ui.Model model)
    Renders the ontology's class hierarchy, or the instances of a single class when type is given.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GraphController

      public GraphController(ai.chatur.cortex.CortexOntology ontology, ai.chatur.cortex.CortexQuery query)
      Creates the controller.
      Parameters:
      ontology - the ontology role used to render the class hierarchy
      query - the query role used to list instances and describe a resource
  • Method Details

    • describeUri

      @GetMapping(value="/describe", params="uri") public String describeUri(@RequestParam("uri") String uri, org.springframework.ui.Model model)
      Renders everything known about a single resource, including statements derived by inference.
      Parameters:
      uri - the identifier of the resource, as returned by getAssertions(String, Model), or a full URI
      model - receives subject (the requested identifier) and statements (the ProvenancedStatements describing it)
      Returns:
      the describe view name
    • getAssertions

      @GetMapping("/assertions") public String getAssertions(@RequestParam(value="type",required=false) String type, org.springframework.ui.Model model)
      Renders the ontology's class hierarchy, or the instances of a single class when type is given.
      Parameters:
      type - the URI of the ontology class whose instances to list, or null to render the class hierarchy
      model - when type is null, receives classes (the OntologyClass hierarchy); otherwise receives type and instances (the matching Terms)
      Returns:
      the classes view name when type is null, otherwise the instances view name