6 #ifndef KNOWROB_MONGO_PIPELINE_H
7 #define KNOWROB_MONGO_PIPELINE_H
12 #include <string_view>
14 #include "knowrob/semweb/GraphTerm.h"
15 #include "knowrob/semweb/TriplePattern.h"
16 #include "knowrob/semweb/GraphBuiltin.h"
18 #include "knowrob/semweb/GraphUnion.h"
56 void limit(uint32_t maxDocuments);
63 void unwind(std::string_view field,
bool preserveNullAndEmptyArrays =
false);
69 void unset(std::string_view field);
81 void project(
const std::vector<std::string_view> &fields);
93 void merge(std::string_view collection);
112 void setUnion(std::string_view field,
const std::vector<std::string_view> &sets);
120 void addToArray(std::string_view key, std::string_view arrayKey, std::string_view elementKey);
134 static bson_t *
loadFromJSON(std::string_view filename,
const std::map<std::string, std::string> ¶meters);
139 std::list<bson_wrapper>
stages_;
147 std::set<std::string_view> &groundedVariables);
157 std::set<std::string_view> &groundedVariables);
bson_t * appendStageBegin(std::string_view stageOperator)
void setUnion(std::string_view field, const std::vector< std::string_view > &sets)
static bson_t * loadFromJSON(std::string_view filename, const std::map< std::string, std::string > ¶meters)
void appendUnion(const knowrob::GraphUnion &unionTerm, const TripleStore &tripleStore, std::set< std::string_view > &groundedVariables)
void setIsNested(bool isNested)
void matchEmptyArray(std::string_view arrayKey)
Pipeline(bson_t *arrayDocument=nullptr)
void append(const knowrob::TriplePattern &query, const TripleStore &tripleStore)
void limit(uint32_t maxDocuments)
void sortDescending(std::string_view field)
void appendTerm_recursive(const knowrob::GraphTerm &query, const TripleStore &tripleStore, std::set< std::string_view > &groundedVariables)
auto * arrayDocument() const
void replaceRoot(std::string_view newRootField)
void matchBinary(const knowrob::GraphBuiltin &builtin, std::string_view predicate)
std::list< bson_wrapper > stageOperators_
void addToArray(std::string_view key, std::string_view arrayKey, std::string_view elementKey)
void sortAscending(std::string_view field)
std::list< bson_wrapper > stages_
void appendBuiltin(const knowrob::GraphBuiltin &builtin)
void unset(std::string_view field)
void setAccumulated(const knowrob::GraphBuiltin &builtin, std::string_view predicate)
void project(const std::vector< std::string_view > &fields)
void bindValue(const knowrob::GraphBuiltin &builtin)
bson_t * appendStageBegin()
void append(const knowrob::GraphTerm &query, const TripleStore &tripleStore)
void unwind(std::string_view field, bool preserveNullAndEmptyArrays=false)
void appendStageEnd(bson_t *stage)
void project(std::string_view field)
void merge(std::string_view collection)