knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphPathQuery.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_PATH_QUERY_H
7 #define KNOWROB_GRAPH_PATH_QUERY_H
8 
9 #include "knowrob/semweb/GraphQuery.h"
10 
11 namespace knowrob {
15  class GraphPathQuery : public GraphQuery {
16  public:
21  explicit GraphPathQuery(const std::vector<TriplePatternPtr> &query,
23  : GraphQuery(query, ctx), path_(query) {}
24 
28  explicit GraphPathQuery(const TriplePatternPtr &query)
29  : GraphQuery(query), path_({query}) {}
30 
35  explicit GraphPathQuery(const TriplePatternPtr &query, const QueryContextPtr &ctx)
36  : GraphQuery(query, ctx), path_({query}) {}
37 
41  auto &path() const { return path_; }
42 
43  protected:
44  std::vector<TriplePatternPtr> path_;
45  };
46 
47  // A shared pointer to a GraphQuery
48  using GraphPathQueryPtr = std::shared_ptr<GraphPathQuery>;
49 } // knowrob
50 
51 #endif //KNOWROB_GRAPH_PATH_QUERY_H
GraphPathQuery(const TriplePatternPtr &query, const QueryContextPtr &ctx)
std::vector< TriplePatternPtr > path_
GraphPathQuery(const TriplePatternPtr &query)
GraphPathQuery(const std::vector< TriplePatternPtr > &query, const QueryContextPtr &ctx=DefaultQueryContext())
auto & ctx() const
Definition: Query.h:41
std::shared_ptr< TriplePattern > TriplePatternPtr
QueryContextPtr DefaultQueryContext()
Definition: Query.cpp:11
std::shared_ptr< const QueryContext > QueryContextPtr
Definition: QueryContext.h:41
std::shared_ptr< GraphPathQuery > GraphPathQueryPtr