Package ai.chatur.cortex
Interface CortexQuery
- All Known Subinterfaces:
Cortex
public interface CortexQuery
Looks up instances and resources in the knowledge graph, including SPARQL access.
-
Method Summary
Modifier and TypeMethodDescriptionReturns everything known about a resource, including statements derived by inference.getInstances(String type) Returns the known instances of an ontology class, including those derived by inference.Runs a SPARQL query against the knowledge graph, including statements derived by inference.
-
Method Details
-
getInstances
Returns the known instances of an ontology class, including those derived by inference.- Parameters:
type- the URI of the ontology class- Returns:
- the instance identifiers sorted alphabetically, empty if the class is unknown
-
describe
Returns everything known about a resource, including statements derived by inference.- Parameters:
id- the identifier of the resource, as returned bygetInstances(String), or a full URI- Returns:
- the statements about the resource with their provenance, sorted by predicate
-
query
Runs a SPARQL query against the knowledge graph, including statements derived by inference.- Parameters:
sparql- a SPARQLSELECT,ASK, orDESCRIBEquery- Returns:
SELECTandASKresults formatted as text,DESCRIBEresults serialized in Turtle syntax, ornullfor other query types
-