6 #include "knowrob/semweb/GraphTransformation.h"
7 #include "knowrob/Logger.h"
8 #include "knowrob/semweb/GraphRenaming.h"
9 #include "knowrob/semweb/GraphRestructuring.h"
11 #define TRANSFORMATION_SETTING_KEY_TYPE "type"
12 #define TRANSFORMATION_SETTING_TYPE_RENAMING "renaming"
13 #define TRANSFORMATION_SETTING_TYPE_RESTRUCTURING "restructuring"
14 #define TRANSFORMATION_SETTING_TYPE_RULES "rules"
24 KB_WARN(
"No next transformation or handler set");
42 std::shared_ptr<GraphTransformation> last;
62 std::shared_ptr<GraphTransformation> last, first;
65 for (
const auto &elem_pair: config) {
66 auto &elem = elem_pair.second;
73 auto type_name = *type_opt;
75 std::shared_ptr<GraphTransformation> next;
78 next = std::make_shared<GraphRestructuring>();
80 next = std::make_shared<GraphRenaming>();
82 KB_ERROR(
"Unknown transformation type \"{}\"", type_name);
85 if (!next->configure(config)) {
86 KB_ERROR(
"Failed to configure transformation");
98 KB_ERROR(
"No transformations created");
virtual bool load(const TripleHandler &callback)=0
std::shared_ptr< TripleContainer > TripleContainerPtr
std::function< void(const TripleContainerPtr &)> TripleHandler