query.pl -- Query aggregation.

The KnowRob query language supports logic programming syntax. However, language expressions are potentially compiled by KnowRob into other formats such as mongo DB queries in order to combine different backends for query answering. KnowRob orchestrates this process through a pipeline of query steps where different steps are linked with each other by feeding groundings of one step into the input queue of the next step.

author
- Daniel Beßler
license
- BSD
 kb_call(+Statement) is nondet
Same as kb_call/3 with default scope to include only facts that hold now.
Arguments:
Statement- a statement term.
 kb_call(+Statement, +QScope, -FScope) is nondet
Same as kb_call/4 with empty options list.
Arguments:
Statement- a statement term.
 kb_call(+Statement, +QScope, -FScope, +Options) is nondet
True if Statement holds within QScope. Statement can also be a list of statements. FactScope is the actual scope of the statement being true that overlaps with QScope. Options include:
max_queue_size(MaxSize)
Determines the maximum number of messages queued in each stage. Default is 50.
graph(GraphName)
Determines the named graph this query is restricted to. Note that graphs are organized hierarchically. Default is user.

Any remaining options are passed to the querying backends that are invoked.

Arguments:
Statement- a statement term.
QScope- the requested scope.
FScope- the actual scope.
Options- list of options.
 ask(+Statement) is nondet
Same as kb_call/1
Arguments:
Statement- a statement term.
deprecated
-
 ask(+Statement, +Scope) is nondet
Same as kb_call/4 with empty options list and FScope as wildcard.
Arguments:
Statement- a statement term.
Scope- the scope of the statement.
deprecated
-
 kb_project(+Statement) is nondet
Same as kb_project/2 with universal scope.
Arguments:
Statement- a statement term.
 kb_project(+Statement, +Scope) is nondet
Same as kb_project/3 with empty options list.
Arguments:
Statement- a statement term.
Scope- the scope of the statement.
 kb_project(+Statement, +Scope, +Options) is semidet
Assert that some statement is true. Scope is the scope of the statement being true. Statement can also be a list of statements. Options include:
graph(GraphName)
Determines the named graph this query is restricted to. Note that graphs are organized hierarchically. Default is user.

Any remaining options are passed to the querying backends that are invoked.

Arguments:
Statement- a statement term.
Scope- the scope of the statement.
Options- list of options.
 kb_unproject(+Statement) is nondet
Same as kb_unproject/2 with universal scope.
Arguments:
Statement- a statement term.
 kb_unproject(+Statement, +Scope) is nondet
Same as kb_unproject/3 with empty options list.
Arguments:
Statement- a statement term.
Scope- the scope of the statement.
 kb_unproject(+Statement, +Scope, +Options) is semidet
Unproject that some statement is true. Statement must be a term triple/3. It can also be a list of such terms. Scope is the scope of the statement to unproject. Options include:
graph(GraphName)
Determines the named graph this query is restricted to. Note that graphs are organized hierarchically. Default is user.

Any remaining options are passed to the querying backends that are invoked.

Arguments:
Statement- a statement term.
Scope- the scope of the statement.
Options- list of options.
 call_with(+Backend, :Goal, +Options) is nondet[multifile]
Calls a goal in given backend. The options list may contain additional backend specific options.
Arguments:
Backend- the backend name
Goal- a goal term
Options- list of options
 is_callable_with(?Backend, :Goal) is nondet[multifile]
True if Backend is a querying backend that can handle Goal.
 kb_add_rule(+Head, +Body) is semidet
Register a rule that translates into an aggregation pipeline. Any non-terminal predicate in Body must have a previously asserted rule it can expand into. After being asserted, the Head predicate can be referred to in calls of kb_call/1.
Arguments:
Head- The head of a rule.
Body- The body of a rule.
 kb_drop_rule(+Head) is semidet
Drop a previously added mongolog rule. That is, erase its database record such that it can not be referred to anymore in rules added after removal.
Arguments:
Term- A mongolog rule.
 kb_expand(+Term, -Expanded) is det
Translate a goal into a sequence of terminal commands. Terminal commands are the core predicates supported in queries such as arithmetic and comparison predicates. Rules, on the other hand, are "flattened" during term expansion, and translated to a sequence of these terminal commands.
Arguments:
Term- A compound term, or a list of terms.
Expanded- Sequence of terminal commands