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 Type
    Method
    Description
    Returns everything known about a resource, including statements derived by inference.
    Returns the known instances of an ontology class, including those derived by inference.
    query(String sparql)
    Runs a SPARQL query against the knowledge graph, including statements derived by inference.
  • Method Details

    • getInstances

      List<Term> getInstances(String type)
      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 by getInstances(String), or a full URI
      Returns:
      the statements about the resource with their provenance, sorted by predicate
    • query

      String query(String sparql)
      Runs a SPARQL query against the knowledge graph, including statements derived by inference.
      Parameters:
      sparql - a SPARQL SELECT, ASK, or DESCRIBE query
      Returns:
      SELECT and ASK results formatted as text, DESCRIBE results serialized in Turtle syntax, or null for other query types