knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphTransformationRule.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_TRANSFORMATION_RULE_H
7 #define KNOWROB_GRAPH_TRANSFORMATION_RULE_H
8 
9 #include "knowrob/semweb/SPARQLQuery.h"
10 
11 namespace knowrob {
15  class GraphTransformationRule {
16  public:
21  GraphTransformationRule(const std::vector<TriplePatternPtr> &from,
22  const std::vector<TriplePatternPtr> &to)
23  : from_(from), to_(to) {}
24 
28  SPARQLQuery getSPARQLQuery() const { return SPARQLQuery(std::make_shared<GraphQuery>(from_)); }
29 
33  const std::vector<TriplePatternPtr> &from() const { return from_; }
34 
38  const std::vector<TriplePatternPtr> &to() const { return to_; }
39 
40  protected:
41  std::vector<TriplePatternPtr> from_;
42  std::vector<TriplePatternPtr> to_;
43  };
44 
45 } // knowrob
46 
47 #endif //KNOWROB_GRAPH_TRANSFORMATION_RULE_H
std::vector< TriplePatternPtr > from_
const std::vector< TriplePatternPtr > & from() const
std::vector< TriplePatternPtr > to_
GraphTransformationRule(const std::vector< TriplePatternPtr > &from, const std::vector< TriplePatternPtr > &to)
const std::vector< TriplePatternPtr > & to() const