knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphPattern.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_PATTERN_H
7 #define KNOWROB_GRAPH_PATTERN_H
8 
9 #include "knowrob/semweb/GraphTerm.h"
10 #include "knowrob/semweb/TriplePattern.h"
11 
12 namespace knowrob {
16  class GraphPattern : public GraphTerm {
17  public:
20  pattern_(std::move(pattern)) {}
21 
22  explicit GraphPattern(const TermPtr &subject, const TermPtr &predicate, const TermPtr &object)
24  pattern_(std::make_shared<TriplePattern>(subject, predicate, object)) {}
25 
29  const auto &value() const { return pattern_; }
30 
31  void write(std::ostream &os) const override { os << *pattern_; }
32 
33  protected:
35  };
36 } // knowrob
37 
38 #endif //KNOWROB_GRAPH_PATTERN_H
const auto & value() const
Definition: GraphPattern.h:29
TriplePatternPtr pattern_
Definition: GraphPattern.h:34
GraphPattern(TriplePatternPtr pattern)
Definition: GraphPattern.h:18
void write(std::ostream &os) const override
Definition: GraphPattern.h:31
GraphPattern(const TermPtr &subject, const TermPtr &predicate, const TermPtr &object)
Definition: GraphPattern.h:22
PredicateRule & predicate()
Definition: formula.cpp:221
GraphTermRule & pattern()
Definition: graph.cpp:23
std::shared_ptr< TriplePattern > TriplePatternPtr
std::shared_ptr< Term > TermPtr
Definition: Term.h:117
GraphTermType
Definition: GraphTerm.h:16