knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <KnowledgeBase.h>
Static Public Member Functions | |
static std::shared_ptr< KnowledgeBase > | create (const boost::property_tree::ptree &config) |
static std::shared_ptr< KnowledgeBase > | create (std::string_view config) |
static std::shared_ptr< KnowledgeBase > | create () |
static std::shared_ptr< KnowledgeBase > | create (const boost::property_tree::ptree &config) |
static std::shared_ptr< KnowledgeBase > | create (std::string_view config) |
static std::shared_ptr< KnowledgeBase > | create () |
Protected Member Functions | |
KnowledgeBase (const boost::property_tree::ptree &config) | |
KnowledgeBase (std::string_view config) | |
KnowledgeBase () | |
void | configure (const boost::property_tree::ptree &config) |
void | configureDataSources (const boost::property_tree::ptree &config) |
void | configureBackends (const boost::property_tree::ptree &config) |
void | configureReasoner (const boost::property_tree::ptree &config) |
void | initVocabulary () |
void | addToVocabulary (const TriplePtr &triple) |
void | initBackends () |
void | synchronizeBackends () |
std::shared_ptr< NamedBackend > | findSourceBackend (const Triple &triple) |
void | startReasoner () |
void | stopReasoner () |
std::vector< std::shared_ptr< NamedBackend > > | prepareLoad (std::string_view origin, std::string_view newVersion) const |
void | finishLoad (const std::shared_ptr< OntologySource > &source, std::string_view origin, std::string_view newVersion) |
bool | loadNonOntologySource (const DataSourcePtr &source) const |
bool | loadOntologySource (const std::shared_ptr< OntologySource > &source) |
std::optional< std::string > | getVersionOfOrigin (const std::shared_ptr< NamedBackend > &definedBackend, std::string_view origin) const |
KnowledgeBase (const boost::property_tree::ptree &config) | |
KnowledgeBase (std::string_view config) | |
KnowledgeBase () | |
void | configure (const boost::property_tree::ptree &config) |
void | configureDataSources (const boost::property_tree::ptree &config) |
void | configureBackends (const boost::property_tree::ptree &config) |
void | configureReasoner (const boost::property_tree::ptree &config) |
void | initVocabulary () |
void | addToVocabulary (const TriplePtr &triple) |
void | initBackends () |
void | synchronizeBackends () |
std::shared_ptr< NamedBackend > | findSourceBackend (const Triple &triple) |
void | startReasoner () |
void | stopReasoner () |
std::vector< std::shared_ptr< NamedBackend > > | prepareLoad (std::string_view origin, std::string_view newVersion) const |
void | finishLoad (const std::shared_ptr< OntologySource > &source, std::string_view origin, std::string_view newVersion) |
bool | loadNonOntologySource (const DataSourcePtr &source) const |
bool | loadOntologySource (const std::shared_ptr< OntologySource > &source) |
std::optional< std::string > | getVersionOfOrigin (const std::shared_ptr< NamedBackend > &definedBackend, std::string_view origin) const |
Static Protected Member Functions | |
static void | configurePrefixes (const boost::property_tree::ptree &config) |
static void | configurePrefixes (const boost::property_tree::ptree &config) |
Protected Attributes | |
std::shared_ptr< StorageInterface > | edb_ |
std::shared_ptr< ReasonerManager > | reasonerManager_ |
std::shared_ptr< StorageManager > | backendManager_ |
std::shared_ptr< Vocabulary > | vocabulary_ |
std::shared_ptr< ObserverManager > | observerManager_ |
bool | isInitialized_ |
The main interface to the knowledge base system implementing its 'tell' and 'ask' interface. Note that it is perfectly fine to have multiple KnowledgeBase instances in one application.
Definition at line 32 of file KnowledgeBase.h.
KnowledgeBase::~KnowledgeBase | ( | ) |
Definition at line 64 of file KnowledgeBase.cpp.
|
explicitprotected |
Definition at line 46 of file KnowledgeBase.cpp.
|
explicitprotected |
Definition at line 51 of file KnowledgeBase.cpp.
|
explicitprotected |
Definition at line 36 of file KnowledgeBase.cpp.
knowrob::KnowledgeBase::~KnowledgeBase | ( | ) |
|
explicitprotected |
|
explicitprotected |
|
explicitprotected |
|
protected |
Definition at line 250 of file KnowledgeBase.cpp.
|
protected |
|
inline |
|
inline |
|
protected |
Definition at line 278 of file KnowledgeBase.cpp.
|
protected |
|
protected |
Definition at line 311 of file KnowledgeBase.cpp.
|
protected |
|
protected |
Definition at line 522 of file KnowledgeBase.cpp.
|
protected |
|
staticprotected |
Definition at line 294 of file KnowledgeBase.cpp.
|
staticprotected |
|
protected |
Definition at line 322 of file KnowledgeBase.cpp.
|
protected |
|
static |
Create a new KnowledgeBase instance.
Definition at line 84 of file KnowledgeBase.cpp.
|
static |
Create a new KnowledgeBase instance.
|
static |
Create a new KnowledgeBase instance.
config | a property tree used to configure this. |
Definition at line 76 of file KnowledgeBase.cpp.
|
static |
Create a new KnowledgeBase instance.
config | a property tree used to configure this. |
|
static |
Create a new KnowledgeBase instance.
config | a JSON string used to configure this or the path to a JSON file. |
Definition at line 80 of file KnowledgeBase.cpp.
|
static |
Create a new KnowledgeBase instance.
config | a JSON string used to configure this or the path to a JSON file. |
|
inline |
|
inline |
|
protected |
Definition at line 500 of file KnowledgeBase.cpp.
|
protected |
|
protected |
Definition at line 600 of file KnowledgeBase.cpp.
|
protected |
QueryableBackendPtr KnowledgeBase::getBackendForQuery | ( | ) | const |
QueryableBackendPtr knowrob::KnowledgeBase::getBackendForQuery | ( | ) | const |
|
protected |
Definition at line 567 of file KnowledgeBase.cpp.
|
protected |
void KnowledgeBase::init | ( | ) |
Definition at line 88 of file KnowledgeBase.cpp.
void knowrob::KnowledgeBase::init | ( | ) |
|
protected |
Definition at line 99 of file KnowledgeBase.cpp.
|
protected |
|
protected |
Definition at line 197 of file KnowledgeBase.cpp.
|
protected |
bool KnowledgeBase::insertAll | ( | const std::vector< TriplePtr > & | triples | ) |
Insert a collection of triples into the knowledge base.
triples | the triples to insert |
Definition at line 487 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::insertAll | ( | const std::vector< TriplePtr > & | triples | ) |
Insert a collection of triples into the knowledge base.
triples | the triples to insert |
bool KnowledgeBase::insertAll | ( | const TripleContainerPtr & | triples | ) |
Insert a collection of triples into the knowledge base.
triples | the triples to insert |
Definition at line 434 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::insertAll | ( | const TripleContainerPtr & | triples | ) |
Insert a collection of triples into the knowledge base.
triples | the triples to insert |
bool KnowledgeBase::insertOne | ( | const Triple & | triple | ) |
Insert a single triple into the knowledge base.
triple | the triple to insert |
Definition at line 415 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::insertOne | ( | const Triple & | triple | ) |
Insert a single triple into the knowledge base.
triple | the triple to insert |
void KnowledgeBase::loadCommon | ( | ) |
Definition at line 340 of file KnowledgeBase.cpp.
void knowrob::KnowledgeBase::loadCommon | ( | ) |
bool KnowledgeBase::loadDataSource | ( | const DataSourcePtr & | source | ) |
Load a data source into the knowledge base, possibly loading it into multiple backends.
source | the data source to load |
Definition at line 557 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::loadDataSource | ( | const DataSourcePtr & | source | ) |
Load a data source into the knowledge base, possibly loading it into multiple backends.
source | the data source to load |
|
protected |
Definition at line 658 of file KnowledgeBase.cpp.
|
protected |
|
protected |
Definition at line 619 of file KnowledgeBase.cpp.
|
protected |
ObserverPtr KnowledgeBase::observe | ( | const GraphQueryPtr & | query, |
const BindingsHandler & | callback | ||
) |
Observe a query represented as a graph query.
query | a graph query |
callback | a function that is called for each answer to the query |
Definition at line 407 of file KnowledgeBase.cpp.
ObserverPtr knowrob::KnowledgeBase::observe | ( | const GraphQueryPtr & | query, |
const BindingsHandler & | callback | ||
) |
Observe a query represented as a graph query.
query | a graph query |
callback | a function that is called for each answer to the query |
|
protected |
Definition at line 581 of file KnowledgeBase.cpp.
|
protected |
|
inline |
|
inline |
bool KnowledgeBase::removeAll | ( | const std::vector< TriplePtr > & | triples | ) |
Remove a collection of triples from the knowledge base.
triples | the triples to remove |
Definition at line 492 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::removeAll | ( | const std::vector< TriplePtr > & | triples | ) |
Remove a collection of triples from the knowledge base.
triples | the triples to remove |
bool KnowledgeBase::removeAll | ( | const TripleContainerPtr & | triples | ) |
Remove a collection of triples from the knowledge base.
triples | the triples to remove |
Definition at line 472 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::removeAll | ( | const TripleContainerPtr & | triples | ) |
Remove a collection of triples from the knowledge base.
triples | the triples to remove |
bool KnowledgeBase::removeAllWithOrigin | ( | std::string_view | origin | ) |
Remove all triples with a given origin from the knowledge base.
origin | the origin of the triples to remove |
Definition at line 496 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::removeAllWithOrigin | ( | std::string_view | origin | ) |
Remove all triples with a given origin from the knowledge base.
origin | the origin of the triples to remove |
bool KnowledgeBase::removeOne | ( | const Triple & | triple | ) |
Remove a single triple from the knowledge base.
triple | the triple to remove |
Definition at line 453 of file KnowledgeBase.cpp.
bool knowrob::KnowledgeBase::removeOne | ( | const Triple & | triple | ) |
Remove a single triple from the knowledge base.
triple | the triple to remove |
void KnowledgeBase::setDefaultGraph | ( | std::string_view | origin | ) |
Set the default graph for queries.
origin | the origin of the default graph |
Definition at line 680 of file KnowledgeBase.cpp.
void knowrob::KnowledgeBase::setDefaultGraph | ( | std::string_view | origin | ) |
Set the default graph for queries.
origin | the origin of the default graph |
|
protected |
Definition at line 355 of file KnowledgeBase.cpp.
|
protected |
|
protected |
Definition at line 368 of file KnowledgeBase.cpp.
|
protected |
TokenBufferPtr KnowledgeBase::submitQuery | ( | const ConjunctiveQueryPtr & | conjunctiveQuery | ) |
Evaluate a query represented as a vector of literals. The call is non-blocking and returns a stream of answers.
conjunctiveQuery | the query |
Definition at line 388 of file KnowledgeBase.cpp.
TokenBufferPtr knowrob::KnowledgeBase::submitQuery | ( | const ConjunctiveQueryPtr & | conjunctiveQuery | ) |
Evaluate a query represented as a vector of literals. The call is non-blocking and returns a stream of answers.
conjunctiveQuery | the query |
TokenBufferPtr KnowledgeBase::submitQuery | ( | const FirstOrderLiteralPtr & | query, |
const QueryContextPtr & | ctx | ||
) |
Evaluate a query represented as a Literal. The call is non-blocking and returns a stream of answers.
query | a literal |
ctx | a query context |
Definition at line 384 of file KnowledgeBase.cpp.
TokenBufferPtr knowrob::KnowledgeBase::submitQuery | ( | const FirstOrderLiteralPtr & | query, |
const QueryContextPtr & | ctx | ||
) |
Evaluate a query represented as a Literal. The call is non-blocking and returns a stream of answers.
query | a literal |
ctx | a query context |
TokenBufferPtr KnowledgeBase::submitQuery | ( | const FormulaPtr & | query, |
const QueryContextPtr & | ctx | ||
) |
Evaluate a query represented as a Formula. The call is non-blocking and returns a stream of answers.
query | a formula |
ctx | a query context |
Definition at line 399 of file KnowledgeBase.cpp.
TokenBufferPtr knowrob::KnowledgeBase::submitQuery | ( | const FormulaPtr & | query, |
const QueryContextPtr & | ctx | ||
) |
Evaluate a query represented as a Formula. The call is non-blocking and returns a stream of answers.
query | a formula |
ctx | a query context |
|
protected |
Definition at line 106 of file KnowledgeBase.cpp.
|
protected |
void KnowledgeBase::synchronizeObservers | ( | ) |
Block until all observers have processed all queued data.
Definition at line 411 of file KnowledgeBase.cpp.
void knowrob::KnowledgeBase::synchronizeObservers | ( | ) |
Block until all observers have processed all queued data.
|
inline |
Definition at line 67 of file KnowledgeBase.h.
|
inline |
Definition at line 67 of file KnowledgeBase.h.
|
protected |
Definition at line 186 of file KnowledgeBase.h.
|
protected |
Definition at line 184 of file KnowledgeBase.h.
|
protected |
Definition at line 189 of file KnowledgeBase.h.
|
protected |
Definition at line 188 of file KnowledgeBase.h.
|
protected |
Definition at line 185 of file KnowledgeBase.h.
|
protected |
Definition at line 187 of file KnowledgeBase.h.