sage.query_engine package

Subpackages

Submodules

sage.query_engine.exceptions module

exception sage.query_engine.exceptions.DeleteInsertConflict

Bases: Exception

Raised when a conflict happended during the serialization of a transaction

exception sage.query_engine.exceptions.QuantumExhausted

Bases: Exception

Raised when the time quantum for a query execution has been exceeded

exception sage.query_engine.exceptions.TooManyResults

Bases: Exception

Raised when the maximum number of results for a query execution has been exceeded

exception sage.query_engine.exceptions.UnsupportedSPARQL

Bases: Exception

Raised when a SPARQL feature is not supported by the Sage query engine

sage.query_engine.sage_engine module

class sage.query_engine.sage_engine.SageEngine

Bases: object

SaGe query engine, used to evaluated a preemptable physical query execution plan

async execute(plan: sage.query_engine.iterators.preemptable_iterator.PreemptableIterator, context: dict) → Tuple[List[Dict[str, str]], Optional[iterators_pb2.RootTree], bool, Optional[str]]

Execute a preemptable physical query execution plan under a time quantum.

Args:
  • plan: Root of the pipeline of iterator.

  • context: Information about the query execution.

Returns: A tuple (results, saved_plan, is_done, abort_reason) where:
  • results is a list of solution mappings found during query execution

  • saved_plan is the state of the plan saved using protocol-buffers

  • is_done is True when the plan has completed query evalution, False otherwise

  • abort_reason is True if the query was aborted due a to concurrency control issue

Throws: Any exception raised during query execution.

async sage.query_engine.sage_engine.executor(pipeline: sage.query_engine.iterators.preemptable_iterator.PreemptableIterator, results: list, context: dict) → None

Execute a pipeline of iterator under a time quantum.

Args:
  • pipeline: Root of the pipeline of iterator.

  • results: List used to store query results.

  • context: Information about the query execution.

Throws: Any exception raised during query execution.

Module contents