knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::QueryableStorage Class Referenceabstract

#include <QueryableStorage.h>

Inheritance diagram for knowrob::QueryableStorage:
Collaboration diagram for knowrob::QueryableStorage:

Public Member Functions

 QueryableStorage (StorageFeatures features=StorageFeature::NothingSpecial)
 
 ~QueryableStorage () override=default
 
virtual bool isPersistent () const =0
 
virtual void foreach (const TripleVisitor &visitor) const
 
virtual void batch (const TripleHandler &callback) const =0
 
virtual void batchOrigin (std::string_view origin, const TripleHandler &callback)=0
 
virtual bool contains (const Triple &triple)
 
virtual void match (const TriplePattern &query, const TripleVisitor &visitor)
 
virtual void query (const GraphQueryPtr &query, const BindingsHandler &callback)=0
 
virtual void count (const ResourceCounter &callback) const =0
 
bool exportTo (const std::string &filename, semweb::TripleFormat format=semweb::RDF_XML) const
 
std::vector< VersionedOriginPtrgetOrigins ()
 
std::optional< std::string > getVersionOfOrigin (std::string_view origin)
 
void setVersionOfOrigin (std::string_view origin, std::string_view version)
 
void dropSessionOrigins ()
 
GraphQueryExpansionPtr expand (const GraphQueryPtr &q)
 
 QueryableStorage (StorageFeatures features=StorageFeature::NothingSpecial)
 
 ~QueryableStorage () override=default
 
virtual bool isPersistent () const =0
 
virtual void foreach (const TripleVisitor &visitor) const
 
virtual void batch (const TripleHandler &callback) const =0
 
virtual void batchOrigin (std::string_view origin, const TripleHandler &callback)=0
 
virtual bool contains (const Triple &triple)
 
virtual void match (const TriplePattern &query, const TripleVisitor &visitor)
 
virtual void query (const GraphQueryPtr &query, const BindingsHandler &callback)=0
 
virtual void count (const ResourceCounter &callback) const =0
 
bool exportTo (const std::string &filename, semweb::TripleFormat format=semweb::RDF_XML) const
 
std::vector< VersionedOriginPtrgetOrigins ()
 
std::optional< std::string > getVersionOfOrigin (std::string_view origin)
 
void setVersionOfOrigin (std::string_view origin, std::string_view version)
 
void dropSessionOrigins ()
 
GraphQueryExpansionPtr expand (const GraphQueryPtr &q)
 
- Public Member Functions inherited from knowrob::Storage
 Storage (StorageFeatures features=StorageFeature::NothingSpecial)
 
virtual ~Storage ()=default
 
PluginLanguage storageLanguage () const
 
const auto & vocabulary () const
 
void setVocabulary (std::shared_ptr< Vocabulary > vocabulary)
 
bool supports (StorageFeature feature) const
 
virtual bool insertOne (const Triple &triple)=0
 
virtual bool insertAll (const TripleContainerPtr &triples)=0
 
virtual bool removeOne (const Triple &triple)=0
 
virtual bool removeAll (const TripleContainerPtr &triples)=0
 
virtual bool removeAllWithOrigin (std::string_view origin)=0
 
virtual bool initializeBackend (const PropertyTree &config)=0
 
std::optional< std::string > getVersionOfOrigin (std::string_view origin) const
 
void setVersionOfOrigin (std::string_view origin, std::optional< std::string_view > version)
 
 Storage (StorageFeatures features=StorageFeature::NothingSpecial)
 
virtual ~Storage ()=default
 
PluginLanguage storageLanguage () const
 
const auto & vocabulary () const
 
void setVocabulary (std::shared_ptr< Vocabulary > vocabulary)
 
bool supports (StorageFeature feature) const
 
virtual bool insertOne (const Triple &triple)=0
 
virtual bool insertAll (const TripleContainerPtr &triples)=0
 
virtual bool removeOne (const Triple &triple)=0
 
virtual bool removeAll (const TripleContainerPtr &triples)=0
 
virtual bool removeAllWithOrigin (std::string_view origin)=0
 
virtual bool initializeBackend (const PropertyTree &config)=0
 
std::optional< std::string > getVersionOfOrigin (std::string_view origin) const
 
void setVersionOfOrigin (std::string_view origin, std::optional< std::string_view > version)
 
- Public Member Functions inherited from knowrob::DataSourceHandler
 DataSourceHandler ()=default
 
virtual ~DataSourceHandler ()=default
 
void addDataHandler (const std::string &format, const DataSourceLoader &fn)
 
bool loadDataSource (const DataSourcePtr &dataSource)
 
bool hasDataHandler (const DataSourcePtr &dataSource) const
 
 DataSourceHandler ()=default
 
virtual ~DataSourceHandler ()=default
 
void addDataHandler (const std::string &format, const DataSourceLoader &fn)
 
bool loadDataSource (const DataSourcePtr &dataSource)
 
bool hasDataHandler (const DataSourcePtr &dataSource) const
 

Static Public Member Functions

static std::shared_ptr< AnswerYesyes (const GraphPathQueryPtr &original, const GraphQueryExpansionPtr &expansion, const BindingsPtr &bindings)
 
static std::shared_ptr< AnswerNono (const GraphPathQueryPtr &q)
 
static std::shared_ptr< AnswerYesyes (const GraphPathQueryPtr &original, const GraphQueryExpansionPtr &expansion, const BindingsPtr &bindings)
 
static std::shared_ptr< AnswerNono (const GraphPathQueryPtr &q)
 

Static Public Attributes

static AtomPtr versionProperty = IRIAtom::Tabled("http://knowrob.org/kb/knowrob.owl#hasVersionOfOrigin")
 

Additional Inherited Members

- Protected Member Functions inherited from knowrob::Storage
void enableFeature (StorageFeature feature)
 
void setStorageLanguage (PluginLanguage storageLanguage)
 
void enableFeature (StorageFeature feature)
 
void setStorageLanguage (PluginLanguage storageLanguage)
 
- Protected Member Functions inherited from knowrob::DataSourceHandler
virtual bool loadDataSourceWithUnknownFormat (const DataSourcePtr &)
 
virtual bool loadDataSourceWithUnknownFormat (const DataSourcePtr &)
 
- Protected Attributes inherited from knowrob::Storage
std::map< std::string, std::string > originVersions_
 
std::shared_ptr< Vocabularyvocabulary_
 
StorageFeatures features_
 
PluginLanguage storageLanguage_
 
- Protected Attributes inherited from knowrob::DataSourceHandler
std::map< std::string, DataSourceLoaderdataSourceHandler_
 

Detailed Description

A backend that can be queried.

Definition at line 27 of file QueryableStorage.h.

Constructor & Destructor Documentation

◆ QueryableStorage() [1/2]

QueryableStorage::QueryableStorage ( StorageFeatures  features = StorageFeature::NothingSpecial)
explicit

Definition at line 21 of file QueryableStorage.cpp.

22  : Storage(features) {
23 }
Storage(StorageFeatures features=StorageFeature::NothingSpecial)
Definition: Storage.h:61

◆ ~QueryableStorage() [1/2]

knowrob::QueryableStorage::~QueryableStorage ( )
overridedefault

◆ QueryableStorage() [2/2]

knowrob::QueryableStorage::QueryableStorage ( StorageFeatures  features = StorageFeature::NothingSpecial)
explicit

◆ ~QueryableStorage() [2/2]

knowrob::QueryableStorage::~QueryableStorage ( )
overridedefault

Member Function Documentation

◆ batch() [1/2]

virtual void knowrob::QueryableStorage::batch ( const TripleHandler callback) const
pure virtual

Iterate over all triples in the model.

Parameters
callbackthe callback to handle the triples.
Returns
true if the iteration was successful.

Implemented in knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ batch() [2/2]

virtual void knowrob::QueryableStorage::batch ( const TripleHandler callback) const
pure virtual

Iterate over all triples in the model.

Parameters
callbackthe callback to handle the triples.
Returns
true if the iteration was successful.

Implemented in knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ batchOrigin() [1/2]

virtual void knowrob::QueryableStorage::batchOrigin ( std::string_view  origin,
const TripleHandler callback 
)
pure virtual

Iterate over all triples in the model that have a given origin.

Parameters
originthe origin of the triples.
callbackthe callback to handle the triples.
Returns
true if the iteration was successful.

Implemented in knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ batchOrigin() [2/2]

virtual void knowrob::QueryableStorage::batchOrigin ( std::string_view  origin,
const TripleHandler callback 
)
pure virtual

Iterate over all triples in the model that have a given origin.

Parameters
originthe origin of the triples.
callbackthe callback to handle the triples.
Returns
true if the iteration was successful.

Implemented in knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ contains() [1/2]

bool QueryableStorage::contains ( const Triple triple)
virtual
Parameters
triplea framed triple.
Returns
true if the model contains the triple.

Reimplemented in knowrob::RedlandModel, and knowrob::RedlandModel.

Definition at line 84 of file QueryableStorage.cpp.

84  {
85  bool hasTriple = false;
86  match(TriplePattern(triple), [&hasTriple](const TriplePtr &) {
87  hasTriple = true;
88  });
89  return hasTriple;
90 }
virtual void match(const TriplePattern &query, const TripleVisitor &visitor)

◆ contains() [2/2]

virtual bool knowrob::QueryableStorage::contains ( const Triple triple)
virtual
Parameters
triplea framed triple.
Returns
true if the model contains the triple.

Reimplemented in knowrob::RedlandModel, and knowrob::RedlandModel.

◆ count() [1/2]

virtual void knowrob::QueryableStorage::count ( const ResourceCounter callback) const
pure virtual
Parameters
callbacka function that is called for each resource and its count.

Implemented in knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ count() [2/2]

virtual void knowrob::QueryableStorage::count ( const ResourceCounter callback) const
pure virtual
Parameters
callbacka function that is called for each resource and its count.

Implemented in knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ dropSessionOrigins() [1/2]

void QueryableStorage::dropSessionOrigins ( )

Delete triples that have been asserted from a "session" origin.

Definition at line 53 of file QueryableStorage.cpp.

53  {
57 }
static constexpr std::string_view ORIGIN_SESSION
static constexpr std::string_view ORIGIN_USER
static constexpr std::string_view ORIGIN_REASONER
virtual bool removeAllWithOrigin(std::string_view origin)=0

◆ dropSessionOrigins() [2/2]

void knowrob::QueryableStorage::dropSessionOrigins ( )

Delete triples that have been asserted from a "session" origin.

◆ expand() [1/2]

GraphQueryExpansionPtr QueryableStorage::expand ( const GraphQueryPtr q)

Compute the expansion of a graph path query.

Parameters
qa graph path query.
Returns
the expansion of the query.

Definition at line 363 of file QueryableStorage.cpp.

363  {
364  // Expand the query. Currently, this is mainly used to compute the answer frame here.
365  // But also to insert some builtins for occasional triples.
366  auto exp_ctx = std::make_shared<GraphQueryExpansion>();
367  exp_ctx->query_ctx = q->ctx();
368  exp_ctx->with_reassignment = supports(StorageFeature::ReAssignment);
369  exp_ctx->expanded = expand_query(q, *exp_ctx);
370  return exp_ctx;
371 }
bool supports(StorageFeature feature) const
Definition: Storage.h:84

◆ expand() [2/2]

GraphQueryExpansionPtr knowrob::QueryableStorage::expand ( const GraphQueryPtr q)

Compute the expansion of a graph path query.

Parameters
qa graph path query.
Returns
the expansion of the query.

◆ exportTo() [1/2]

bool QueryableStorage::exportTo ( const std::string &  filename,
semweb::TripleFormat  format = semweb::RDF_XML 
) const

Export all triples in the model to a file.

Parameters
filenamethe name of the file to export to.
formatthe format of the output file.
Returns
true if the export was successful

Definition at line 373 of file QueryableStorage.cpp.

375  {
376  // collects all triples per subject
377  semweb::ExportedTriples subjectTriples;
378  // iterate over all triples in the storage
379  batch([&](const TripleContainerPtr &container) {
380  for (auto &triple: *container) {
381  // collect triples per subject
382  auto tripleCopy = std::make_shared<TripleCopy>(*triple.ptr);
383  auto needle = subjectTriples.find(tripleCopy->subject());
384  if (needle == subjectTriples.end()) {
385  // if the subject is not yet in the map, insert it
386  needle = subjectTriples.insert(std::make_pair(
387  tripleCopy->subject(), std::vector<std::shared_ptr<Triple>>())).first;
388 
389  }
390  needle->second.push_back(tripleCopy);
391  }
392  });
393  // write all triples to the file
394  return semweb::TripleFormatter::exportTo(subjectTriples, filename, format);
395 }
virtual void batch(const TripleHandler &callback) const =0
static bool exportTo(const ExportedTriples &triples, const std::string &filename, TripleFormat format=TripleFormat::RDF_XML)
std::map< std::string_view, std::vector< std::shared_ptr< Triple > >> ExportedTriples
std::shared_ptr< TripleContainer > TripleContainerPtr

◆ exportTo() [2/2]

bool knowrob::QueryableStorage::exportTo ( const std::string &  filename,
semweb::TripleFormat  format = semweb::RDF_XML 
) const

Export all triples in the model to a file.

Parameters
filenamethe name of the file to export to.
formatthe format of the output file.
Returns
true if the export was successful

◆ foreach() [1/2]

void QueryableStorage::foreach ( const TripleVisitor visitor) const
virtual

Iterate over all triples in the model.

Parameters
visitorthe callback to handle the triples.
Returns
true if the iteration was successful.

Reimplemented in knowrob::MongoKnowledgeGraph, and knowrob::MongoKnowledgeGraph.

Definition at line 92 of file QueryableStorage.cpp.

92  {
93  batch([&](const TripleContainerPtr &container) {
94  for (auto &triple: *container) {
95  visitor(triple);
96  }
97  });
98 }

◆ foreach() [2/2]

virtual void knowrob::QueryableStorage::foreach ( const TripleVisitor visitor) const
virtual

Iterate over all triples in the model.

Parameters
visitorthe callback to handle the triples.
Returns
true if the iteration was successful.

Reimplemented in knowrob::MongoKnowledgeGraph, and knowrob::MongoKnowledgeGraph.

◆ getOrigins() [1/2]

std::vector< VersionedOriginPtr > QueryableStorage::getOrigins ( )
Returns
a list of all origins that have been asserted.

Definition at line 25 of file QueryableStorage.cpp.

25  {
26  static auto v_origin = std::make_shared<Variable>("Origin");
27  static auto v_version = std::make_shared<Variable>("Version");
28  std::vector<VersionedOriginPtr> origins;
29  match(TriplePattern(v_origin, versionProperty, v_version),
30  [&](const TriplePtr &triple) {
31  origins.push_back(std::make_shared<VersionedOrigin>(triple->subject(), triple->valueAsString()));
32  });
33  return origins;
34 }
static AtomPtr versionProperty
virtual std::string_view valueAsString() const =0
virtual std::string_view subject() const =0

◆ getOrigins() [2/2]

std::vector<VersionedOriginPtr> knowrob::QueryableStorage::getOrigins ( )
Returns
a list of all origins that have been asserted.

◆ getVersionOfOrigin() [1/2]

std::optional< std::string > QueryableStorage::getVersionOfOrigin ( std::string_view  origin)
Parameters
originan origin string.
Returns
the version of the origin, or an empty optional if the origin is unknown.

Definition at line 45 of file QueryableStorage.cpp.

45  {
46  static auto v_version = std::make_shared<Variable>("Version");
47  std::optional<std::string> version;
48  match(TriplePattern(std::make_shared<Atom>(origin), versionProperty, v_version),
49  [&](const TriplePtr &triple) { version = triple->createStringValue(); });
50  return version;
51 }
std::string createStringValue() const
Definition: Triple.cpp:71

◆ getVersionOfOrigin() [2/2]

std::optional<std::string> knowrob::QueryableStorage::getVersionOfOrigin ( std::string_view  origin)
Parameters
originan origin string.
Returns
the version of the origin, or an empty optional if the origin is unknown.

◆ isPersistent() [1/2]

virtual bool knowrob::QueryableStorage::isPersistent ( ) const
pure virtual

◆ isPersistent() [2/2]

virtual bool knowrob::QueryableStorage::isPersistent ( ) const
pure virtual

◆ match() [1/2]

void QueryableStorage::match ( const TriplePattern query,
const TripleVisitor visitor 
)
virtual
Parameters
querya framed triple pattern.
visitora function that is called for each matching framed triple.

Reimplemented in knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, knowrob::RedlandModel, and knowrob::MongoKnowledgeGraph.

Definition at line 69 of file QueryableStorage.cpp.

69  {
70  auto graph_query = std::make_shared<GraphQuery>(
71  std::make_shared<GraphPattern>(std::make_shared<TriplePattern>(q)),
73  query(graph_query, [&](const BindingsPtr &bindings) {
74  TriplePtr triplePtr;
75  // create a triple view that holds a reference to the bindings.
76  // this is done to allow the visitor to take over the ownership of the triple.
77  triplePtr.ptr = new TripleView_withBindings(bindings);
78  triplePtr.owned = true;
79  q.instantiateInto(*triplePtr, bindings);
80  visitor(triplePtr);
81  });
82 }
virtual void query(const GraphQueryPtr &query, const BindingsHandler &callback)=0
std::shared_ptr< const Bindings > BindingsPtr
Definition: Bindings.h:151
QueryContextPtr DefaultQueryContext()
Definition: Query.cpp:11
Triple * ptr
Definition: Triple.h:590

◆ match() [2/2]

virtual void knowrob::QueryableStorage::match ( const TriplePattern query,
const TripleVisitor visitor 
)
virtual
Parameters
querya framed triple pattern.
visitora function that is called for each matching framed triple.

Reimplemented in knowrob::RedlandModel, knowrob::MongoKnowledgeGraph, knowrob::RedlandModel, and knowrob::MongoKnowledgeGraph.

◆ no() [1/2]

std::shared_ptr< AnswerNo > QueryableStorage::no ( const GraphPathQueryPtr q)
static

Generates a negative answer to a query.

Parameters
qa graph path query.
Returns
a negative answer to the query.

Definition at line 138 of file QueryableStorage.cpp.

138  {
139  static const auto edbTerm = Atom::Tabled("EDB");
140 
141  // send one negative answer if no positive answer was found
142  auto negativeAnswer = std::make_shared<AnswerNo>();
143  negativeAnswer->setReasonerTerm(edbTerm);
144  // Apply query context "origin" and "perspective" to the answer if any
145  negativeAnswer->applyFrame(q->ctx()->selector);
146  // the answer is uncertain as we only were not able to obtain a positive answer
147  // which does not mean that there is no positive answer.
148  negativeAnswer->setIsUncertain(true, std::nullopt);
149 
150  // Add ungrounded literals to negative answer.
151  // But at the moment the information is not provided by EDBs, would be difficult to implement e.g. in MongoDB.
152  // Well at least we know if the query is only a single triple pattern.
153  if (q->path().size() == 1) {
154  negativeAnswer->addUngrounded(q->path().front()->predicate(),
155  q->path().front()->isNegated());
156  }
157  return negativeAnswer;
158 }
static std::shared_ptr< knowrob::Atom > Tabled(std::string_view stringForm)
Definition: Atom.cpp:40

◆ no() [2/2]

static std::shared_ptr<AnswerNo> knowrob::QueryableStorage::no ( const GraphPathQueryPtr q)
static

Generates a negative answer to a query.

Parameters
qa graph path query.
Returns
a negative answer to the query.

◆ query() [1/2]

virtual void knowrob::QueryableStorage::query ( const GraphQueryPtr query,
const BindingsHandler callback 
)
pure virtual

Submits a graph query to this storage.

Parameters
querya graph query
callbacka function that is called for each answer to the query.

Implemented in knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ query() [2/2]

virtual void knowrob::QueryableStorage::query ( const GraphQueryPtr query,
const BindingsHandler callback 
)
pure virtual

Submits a graph query to this storage.

Parameters
querya graph query
callbacka function that is called for each answer to the query.

Implemented in knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, knowrob::PrologBackend, knowrob::SPARQLBackend, knowrob::MongoKnowledgeGraph, and knowrob::PrologBackend.

◆ setVersionOfOrigin() [1/2]

void QueryableStorage::setVersionOfOrigin ( std::string_view  origin,
std::string_view  version 
)

Set the version of an origin.

Parameters
originan origin string.
versiona version string.

Definition at line 36 of file QueryableStorage.cpp.

36  {
37  TripleView triple;
38  triple.setSubject(origin);
39  triple.setPredicate(versionProperty->stringForm());
40  triple.setStringValue(version);
41  triple.setGraph(origin);
42  insertOne(triple);
43 }
virtual bool insertOne(const Triple &triple)=0
void setStringValue(std::string_view v) override
Definition: Triple.h:464
void setPredicate(std::string_view predicate) override
Definition: Triple.h:449
void setGraph(std::string_view graph) override
Definition: Triple.h:497
void setSubject(std::string_view subject) override
Definition: Triple.h:446

◆ setVersionOfOrigin() [2/2]

void knowrob::QueryableStorage::setVersionOfOrigin ( std::string_view  origin,
std::string_view  version 
)

Set the version of an origin.

Parameters
originan origin string.
versiona version string.

◆ yes() [1/2]

std::shared_ptr< AnswerYes > QueryableStorage::yes ( const GraphPathQueryPtr original,
const GraphQueryExpansionPtr expansion,
const BindingsPtr bindings 
)
static

Generates a positive answer to a query.

Parameters
originala graph path query.
expansiona graph query expansion.
bindingsa set of bindings.
Returns
a positive answer to the query.

Definition at line 100 of file QueryableStorage.cpp.

102  {
103  static const auto edbTerm = Atom::Tabled("EDB");
104 
105  auto positiveAnswer = std::make_shared<AnswerYes>(bindings);
106  // Indicate that EDB has computed the grounding.
107  positiveAnswer->setReasonerTerm(edbTerm);
108  // Apply query context to the answer for some parameters.
109  positiveAnswer->applyFrame(original->ctx()->selector);
110 
111  // Add predicate groundings to the answer
112  for (auto &rdfLiteral: original->path()) {
113  auto p = rdfLiteral->predicate();
114  auto p_instance = applyBindings(p, *positiveAnswer->substitution());
115  positiveAnswer->addGrounding(
116  std::static_pointer_cast<Predicate>(p_instance),
117  rdfLiteral->isNegated(),
118  positiveAnswer->frame());
119  }
120 
121  // The answer is uncertain if any of the groundings is uncertain.
122  positiveAnswer->setIsUncertain(
123  std::any_of(expanded->u_vars.begin(), expanded->u_vars.end(), [&](const VariablePtr &v) {
124  auto &u_v = bindings->get(v->name());
125  return (u_v && u_v->isNumeric() && std::static_pointer_cast<Numeric>(u_v)->asBoolean());
126  }), std::nullopt);
127 
128  // The answer is occasional if any of the groundings has occasional=true flag
129  positiveAnswer->setIsOccasionallyTrue(
130  std::any_of(expanded->o_vars.begin(), expanded->o_vars.end(), [&](const VariablePtr &v) {
131  auto &o_v = bindings->get(v->name());
132  return (o_v && o_v->isNumeric() && std::static_pointer_cast<Numeric>(o_v)->asBoolean());
133  }));
134 
135  return positiveAnswer;
136 }
std::shared_ptr< Variable > VariablePtr
Definition: Variable.h:60
FirstOrderLiteralPtr applyBindings(const FirstOrderLiteralPtr &lit, const Bindings &bindings)

◆ yes() [2/2]

static std::shared_ptr<AnswerYes> knowrob::QueryableStorage::yes ( const GraphPathQueryPtr original,
const GraphQueryExpansionPtr expansion,
const BindingsPtr bindings 
)
static

Generates a positive answer to a query.

Parameters
originala graph path query.
expansiona graph query expansion.
bindingsa set of bindings.
Returns
a positive answer to the query.

Member Data Documentation

◆ versionProperty

AtomPtr QueryableStorage::versionProperty = IRIAtom::Tabled("http://knowrob.org/kb/knowrob.owl#hasVersionOfOrigin")
static

Definition at line 29 of file QueryableStorage.h.


The documentation for this class was generated from the following files: