Package ai.chatur.cortex.spring.graph
Class GraphController
java.lang.Object
ai.chatur.cortex.spring.graph.GraphController
Web UI for browsing the knowledge graph: the class hierarchy, the instances of a class, and
everything known about a single resource.
-
Constructor Summary
ConstructorsConstructorDescriptionGraphController(ai.chatur.cortex.CortexOntology ontology, ai.chatur.cortex.CortexQuery query) Creates the controller. -
Method Summary
Modifier and TypeMethodDescriptiondescribeUri(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 whentypeis given.
-
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 hierarchyquery- 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 bygetAssertions(String, Model), or a full URImodel- receivessubject(the requested identifier) andstatements(theProvenancedStatements describing it)- Returns:
- the
describeview 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 whentypeis given.- Parameters:
type- the URI of the ontology class whose instances to list, ornullto render the class hierarchymodel- whentypeisnull, receivesclasses(theOntologyClasshierarchy); otherwise receivestypeandinstances(the matchingTerms)- Returns:
- the
classesview name whentypeisnull, otherwise theinstancesview name
-