knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
MongoTaxonomy.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_MONGO_TAXONOMY_H
7 #define KNOWROB_MONGO_TAXONOMY_H
8 
9 #include <vector>
10 #include <string>
11 #include <memory>
12 #include "Pipeline.h"
13 #include "Collection.h"
14 
15 namespace knowrob::mongo {
19  class MongoTaxonomy {
20  public:
21  using StringPair = std::pair<std::string_view, std::string_view>;
22 
23  MongoTaxonomy(const std::shared_ptr<mongo::Collection> &tripleCollection,
24  const std::shared_ptr<mongo::Collection> &oneCollection,
25  const VocabularyPtr &vocabulary);
26 
28  const std::vector<StringPair> &subClassAssertions,
29  const std::vector<StringPair> &subPropertyAssertions);
30 
32  const std::vector<StringPair> &subClassAssertions,
33  const std::vector<StringPair> &subPropertyAssertions);
34 
35  protected:
36  std::shared_ptr<mongo::Collection> tripleCollection_;
37  std::shared_ptr<mongo::Collection> oneCollection_;
39 
40  void update(
41  const std::vector<StringPair> &subClassAssertions,
42  const std::vector<StringPair> &subPropertyAssertions,
43  bool isInsert);
44  };
45 
46 } // knowrob
47 
48 #endif //KNOWROB_MONGO_TAXONOMY_H
MongoTaxonomy(const std::shared_ptr< mongo::Collection > &tripleCollection, const std::shared_ptr< mongo::Collection > &oneCollection, const VocabularyPtr &vocabulary)
std::pair< std::string_view, std::string_view > StringPair
Definition: MongoTaxonomy.h:21
std::shared_ptr< mongo::Collection > oneCollection_
Definition: MongoTaxonomy.h:37
void updateInsert(const std::vector< StringPair > &subClassAssertions, const std::vector< StringPair > &subPropertyAssertions)
void update(const std::vector< StringPair > &subClassAssertions, const std::vector< StringPair > &subPropertyAssertions, bool isInsert)
std::shared_ptr< mongo::Collection > tripleCollection_
Definition: MongoTaxonomy.h:36
void updateRemove(const std::vector< StringPair > &subClassAssertions, const std::vector< StringPair > &subPropertyAssertions)
std::shared_ptr< Vocabulary > VocabularyPtr
Definition: Vocabulary.h:233