knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphRestructuring.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_RESTRUCTURING_H
7 #define KNOWROB_GRAPH_RESTRUCTURING_H
8 
9 #include <redland.h>
10 #include "string"
11 #include "GraphTransformation.h"
13 #include "knowrob/storage/redland/RedlandModel.h"
14 
15 namespace knowrob {
19  class GraphRestructuring : public GraphTransformation {
20  public:
22 
27  void addRule(std::shared_ptr<GraphTransformationRule> rule);
28 
29  // override GraphTransformation
30  bool configure(const boost::property_tree::ptree &opts) override;
31 
32  protected:
33  std::unique_ptr<RedlandModel> model_;
34  std::vector<std::shared_ptr<GraphTransformationRule>> rules_;
35 
37 
38  bool readFromFile(const std::string &filename);
39 
41 
42  // override GraphTransformation
43  void initializeTransformation() override;
44 
45  // override GraphTransformation
46  void finalizeTransformation() override;
47 
48  // override GraphTransformation
49  void pushInputTriples(const TripleContainerPtr &triples) override;
50  };
51 
52 } // knowrob
53 
54 #endif //KNOWROB_GRAPH_RESTRUCTURING_H
bool readFromFile(const std::string &filename)
void pushInputTriples(const TripleContainerPtr &triples) override
void doTransformation(GraphTransformationRule &rule)
static TriplePatternPtr readTriplePattern(const std::string &filename)
void finalizeTransformation() override
void addRule(std::shared_ptr< GraphTransformationRule > rule)
std::unique_ptr< RedlandModel > model_
std::vector< std::shared_ptr< GraphTransformationRule > > rules_
void initializeTransformation() override
bool configure(const boost::property_tree::ptree &opts) override
TermRule & string()
Definition: terms.cpp:63
std::shared_ptr< TriplePattern > TriplePatternPtr
std::shared_ptr< TripleContainer > TripleContainerPtr