knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::GraphPattern Class Reference

#include <GraphPattern.h>

Inheritance diagram for knowrob::GraphPattern:
Collaboration diagram for knowrob::GraphPattern:

Public Member Functions

 GraphPattern (TriplePatternPtr pattern)
 
 GraphPattern (const TermPtr &subject, const TermPtr &predicate, const TermPtr &object)
 
const auto & value () const
 
void write (std::ostream &os) const override
 
 GraphPattern (TriplePatternPtr pattern)
 
 GraphPattern (const TermPtr &subject, const TermPtr &predicate, const TermPtr &object)
 
const auto & value () const
 
void write (std::ostream &os) const override
 
- Public Member Functions inherited from knowrob::GraphTerm
virtual ~GraphTerm ()=default
 
bool isPattern () const
 
bool isBuiltin () const
 
auto termType () const
 
virtual ~GraphTerm ()=default
 
bool isPattern () const
 
bool isBuiltin () const
 
auto termType () const
 
- Public Member Functions inherited from knowrob::Printable
virtual ~Printable ()=default
 
virtual std::string format () const
 
virtual ~Printable ()=default
 
virtual std::string format () const
 

Protected Attributes

TriplePatternPtr pattern_
 
- Protected Attributes inherited from knowrob::GraphTerm
GraphTermType termType_
 

Additional Inherited Members

- Protected Member Functions inherited from knowrob::GraphTerm
 GraphTerm (GraphTermType termType)
 
 GraphTerm (GraphTermType termType)
 

Detailed Description

A triple pattern that appears in a graph query.

Definition at line 16 of file GraphPattern.h.

Constructor & Destructor Documentation

◆ GraphPattern() [1/4]

knowrob::GraphPattern::GraphPattern ( TriplePatternPtr  pattern)
inlineexplicit

Definition at line 18 of file GraphPattern.h.

20  pattern_(std::move(pattern)) {}
TriplePatternPtr pattern_
Definition: GraphPattern.h:34
GraphTerm(GraphTermType termType)
Definition: GraphTerm.h:50
GraphTermRule & pattern()
Definition: graph.cpp:23

◆ GraphPattern() [2/4]

knowrob::GraphPattern::GraphPattern ( const TermPtr subject,
const TermPtr predicate,
const TermPtr object 
)
inlineexplicit

Definition at line 22 of file GraphPattern.h.

24  pattern_(std::make_shared<TriplePattern>(subject, predicate, object)) {}
PredicateRule & predicate()
Definition: formula.cpp:221

◆ GraphPattern() [3/4]

knowrob::GraphPattern::GraphPattern ( TriplePatternPtr  pattern)
inlineexplicit

Definition at line 18 of file GraphPattern.h.

20  pattern_(std::move(pattern)) {}

◆ GraphPattern() [4/4]

knowrob::GraphPattern::GraphPattern ( const TermPtr subject,
const TermPtr predicate,
const TermPtr object 
)
inlineexplicit

Definition at line 22 of file GraphPattern.h.

24  pattern_(std::make_shared<TriplePattern>(subject, predicate, object)) {}

Member Function Documentation

◆ value() [1/2]

const auto& knowrob::GraphPattern::value ( ) const
inline
Returns
the triple pattern.

Definition at line 29 of file GraphPattern.h.

29 { return pattern_; }

◆ value() [2/2]

const auto& knowrob::GraphPattern::value ( ) const
inline
Returns
the triple pattern.

Definition at line 29 of file GraphPattern.h.

29 { return pattern_; }

◆ write() [1/2]

void knowrob::GraphPattern::write ( std::ostream &  os) const
inlineoverridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Implements knowrob::GraphTerm.

Definition at line 31 of file GraphPattern.h.

31 { os << *pattern_; }

◆ write() [2/2]

void knowrob::GraphPattern::write ( std::ostream &  os) const
inlineoverridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Implements knowrob::GraphTerm.

Definition at line 31 of file GraphPattern.h.

31 { os << *pattern_; }

Member Data Documentation

◆ pattern_

TriplePatternPtr knowrob::GraphPattern::pattern_
protected

Definition at line 34 of file GraphPattern.h.


The documentation for this class was generated from the following file: