knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
ConjunctiveQuery.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_CONJUNCTIVE_QUERY_H
7 #define KNOWROB_CONJUNCTIVE_QUERY_H
8 
9 #include "knowrob/queries/Query.h"
10 #include "knowrob/semweb/GraphTerm.h"
11 #include "knowrob/semweb/TriplePattern.h"
12 #include "knowrob/formulas/SimpleConjunction.h"
13 
14 namespace knowrob {
19  class ConjunctiveQuery : public Query {
20  public:
25  explicit ConjunctiveQuery(const std::vector<FirstOrderLiteralPtr> &query,
27 
32  explicit ConjunctiveQuery(const FirstOrderLiteralPtr &query, const QueryContextPtr &ctx);
33 
37  auto &formula() const { return formula_; }
38 
42  auto &literals() const { return formula_->literals(); }
43 
44  // Override Printable
45  void write(std::ostream &os) const override;
46 
47  protected:
49 
51  };
52 
53  // A shared pointer to a GraphQuery
54  using ConjunctiveQueryPtr = std::shared_ptr<ConjunctiveQuery>;
55 
56 } // knowrob
57 
58 #endif //KNOWROB_CONJUNCTIVE_QUERY_H
ConjunctiveQuery(const FirstOrderLiteralPtr &query, const QueryContextPtr &ctx)
SimpleConjunctionPtr formula_
ConjunctiveQuery(const QueryContextPtr &ctx=DefaultQueryContext())
ConjunctiveQuery(const std::vector< FirstOrderLiteralPtr > &query, const QueryContextPtr &ctx=DefaultQueryContext())
void write(std::ostream &os) const override
auto & ctx() const
Definition: Query.h:41
std::shared_ptr< SimpleConjunction > SimpleConjunctionPtr
QueryContextPtr DefaultQueryContext()
Definition: Query.cpp:11
std::shared_ptr< ConjunctiveQuery > ConjunctiveQueryPtr
std::shared_ptr< const QueryContext > QueryContextPtr
Definition: QueryContext.h:41
std::shared_ptr< FirstOrderLiteral > FirstOrderLiteralPtr