db.pl -- Database predicates.

author
- Daniel Beßler
license
- BSD
 remember(+Directory) is det
Restore memory previously stored into given directory.
Arguments:
Directory- filesystem path
 memorize(+Directory) is det
Store knowledge into given directory.
Arguments:
Directory- filesystem path
 drop_graph(+Name) is det
Deletes all triples asserted into given named graph.
Arguments:
Name- the graph name.
 is_unique_name(+Name) is semidet
True if Name is not the subject of any known fact.
 get_unique_name(+Prefix, -Name) is semidet
Generates a unique name with given prefix.
 setup_collection(+Name, +Indices) is det
Configure the indices of a named collection.
 load_owl(+URL) is det
Same as load_owl/2 with empty Options list.
Arguments:
URL- URL of a RDF file.
 load_owl(+URL, +Options) is semidet
Same as load_owl/3 with universal scope, and graph name argument as given in the options list or "user" if none is given.
Arguments:
URL- URL of a RDF file.
Options- List of options.
 load_owl(+URL, +Scope, +ParentGraph) is semidet
Load RDF data from URL, and assert it into the triple DB using the scope provided and into a graph named according to the ontology. The named graph is added as child graph of ParentGraph.
Arguments:
URL- URL of a RDF file.
Scope- The subject of a triple.
ParentGraph- The parent graph name.
 load_json_rdf(FilePath) is semidet
Load JSON-encoded triple data into the knowledge base. Each triple document in the JSON file must have the keys "s","p","o" for the subject, property, and value of the triple. In addition a scope document can be provided optionally. If this is not the case, it is assumed that the facts universally hold.
Arguments:
FilePath- - Path to the json file
 watch(+Goal, +Callback, -WatcherID) is semidet
Start watching possible instantiations of variables in Goal. Goal must be a KnowRob language term. Callback is called whenever the set of possible instantiations changes, and it is provided with information about the change. The change information is encoded in a term that is appended to already existing arguments of Callback, if any.

Note that callback is currently not called when documents are removed! This might change in the future.

Also note that currently Goal must be a term triple/3. The scope of triples is ignored. No other predicates are supported yet. This might also change in the future.

Arguments:
Goal- a KnowRob language term with free variables.
Callback- a predicate called for each change event.
WatcherID- a unique identifier of the watching operation.
 unwatch(+WatcherID) is semidet
Stop a previously started watch operation. This will fail if WatcherID does not belong to a active watch operation.
Arguments:
WatcherID- a unique identifier of the watching operation.
 watch_event(+WatcherID, +Event) is semidet
This predicate is called by the mongo client when changes are received in a watch operation. Event is a change stream response document.
Arguments:
WatcherID- a unique identifier of the watching operation.
Event- a change stream output document.
See also
- https://docs.mongodb.com/manual/reference/change-events/#change-stream-output