knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphQuery.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_GRAPH_QUERY_H
7 #define KNOWROB_GRAPH_QUERY_H
8 
9 #include "knowrob/queries/Query.h"
10 #include "knowrob/semweb/GraphTerm.h"
11 #include "knowrob/semweb/TriplePattern.h"
12 
13 namespace knowrob {
18  class GraphQuery : public Query {
19  public:
24  explicit GraphQuery(const std::shared_ptr<GraphTerm> &query,
26 
31  explicit GraphQuery(const std::vector<TriplePatternPtr> &query,
33 
37  explicit GraphQuery(const TriplePatternPtr &query);
38 
43  explicit GraphQuery(const TriplePatternPtr &query, const QueryContextPtr &ctx);
44 
48  auto term() const { return term_; }
49 
55 
56  protected:
57  std::shared_ptr<GraphTerm> term_;
58 
59  void write(std::ostream &os) const override;
60 
62  };
63 
64  // A shared pointer to a GraphQuery
65  using GraphQueryPtr = std::shared_ptr<GraphQuery>;
66 
67 } // knowrob
68 
69 #endif //KNOWROB_GRAPH_QUERY_H
auto term() const
Definition: GraphQuery.h:48
GraphQuery(const TriplePatternPtr &query, const QueryContextPtr &ctx)
GraphQuery(const std::shared_ptr< GraphTerm > &query, const QueryContextPtr &ctx=DefaultQueryContext())
void write(std::ostream &os) const override
std::shared_ptr< GraphTerm > term_
Definition: GraphQuery.h:57
GraphQuery(const QueryContextPtr &ctx=DefaultQueryContext())
Definition: GraphQuery.h:61
GraphQuery(const TriplePatternPtr &query)
GraphQuery(const std::vector< TriplePatternPtr > &query, const QueryContextPtr &ctx=DefaultQueryContext())
FormulaPtr toFormula() const
auto & ctx() const
Definition: Query.h:41
std::shared_ptr< TriplePattern > TriplePatternPtr
QueryContextPtr DefaultQueryContext()
Definition: Query.cpp:11
std::shared_ptr< Formula > FormulaPtr
Definition: Formula.h:99
std::shared_ptr< const QueryContext > QueryContextPtr
Definition: QueryContext.h:41
std::shared_ptr< GraphQuery > GraphQueryPtr
Definition: GraphQuery.h:65