knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
ReifiedTriple.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_REIFIED_TRIPLE_H
7 #define KNOWROB_REIFIED_TRIPLE_H
8 
9 #include "vector"
10 #include "knowrob/semweb/Triple.h"
11 #include "knowrob/semweb/Vocabulary.h"
12 
13 namespace knowrob {
19  class ReifiedTriple {
20  public:
27  explicit ReifiedTriple(const Triple &triple, const VocabularyPtr &vocabulary,
28  const IRIAtomPtr &reifiedName = nullptr);
29 
33  auto begin() { return reified_.begin(); }
34 
38  auto end() { return reified_.end(); }
39 
43  auto begin() const { return reified_.begin(); }
44 
48  auto end() const { return reified_.end(); }
49 
55  static bool isPartOfReification(const Triple &triple);
56 
63  static bool isReifiable(const Triple &triple);
64 
65  protected:
67  std::vector<TriplePtr> reified_;
70 
71  Triple *
72  create(std::string_view subject, const AtomPtr &property, const std::optional<std::string_view> &g);
73  };
74 
75  using ReifiedTriplePtr = std::shared_ptr<ReifiedTriple>;
76 
77 } // knowrob
78 
79 #endif //KNOWROB_REIFIED_TRIPLE_H
static bool isPartOfReification(const Triple &triple)
Triple * create(std::string_view subject, const AtomPtr &property, const std::optional< std::string_view > &g)
static bool isReifiable(const Triple &triple)
knowrob::IRIAtomPtr name_
Definition: ReifiedTriple.h:68
ReifiedTriple(const Triple &triple, const VocabularyPtr &vocabulary, const IRIAtomPtr &reifiedName=nullptr)
std::vector< TriplePtr > reified_
Definition: ReifiedTriple.h:67
VocabularyPtr vocabulary_
Definition: ReifiedTriple.h:66
std::string generatedString_
Definition: ReifiedTriple.h:69
TermRule & string()
Definition: terms.cpp:63
std::shared_ptr< ReifiedTriple > ReifiedTriplePtr
Definition: ReifiedTriple.h:75
std::shared_ptr< Atom > AtomPtr
Definition: Atom.h:69
std::shared_ptr< IRIAtom > IRIAtomPtr
Definition: IRIAtom.h:57
std::shared_ptr< Vocabulary > VocabularyPtr
Definition: Vocabulary.h:233