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

#include <GraphTransformationRule.h>

Public Member Functions

 GraphTransformationRule (const std::vector< TriplePatternPtr > &from, const std::vector< TriplePatternPtr > &to)
 
SPARQLQuery getSPARQLQuery () const
 
const std::vector< TriplePatternPtr > & from () const
 
const std::vector< TriplePatternPtr > & to () const
 
 GraphTransformationRule (const std::vector< TriplePatternPtr > &from, const std::vector< TriplePatternPtr > &to)
 
SPARQLQuery getSPARQLQuery () const
 
const std::vector< TriplePatternPtr > & from () const
 
const std::vector< TriplePatternPtr > & to () const
 

Protected Attributes

std::vector< TriplePatternPtrfrom_
 
std::vector< TriplePatternPtrto_
 

Detailed Description

A graph transformation rule that restructures and possibly renames entities in the input graph.

Definition at line 15 of file GraphTransformationRule.h.

Constructor & Destructor Documentation

◆ GraphTransformationRule() [1/2]

knowrob::GraphTransformationRule::GraphTransformationRule ( const std::vector< TriplePatternPtr > &  from,
const std::vector< TriplePatternPtr > &  to 
)
inline
Parameters
fromthe statements to match in the input graph.
tothe statements to replace in the input graph.

Definition at line 21 of file GraphTransformationRule.h.

23  : from_(from), to_(to) {}
std::vector< TriplePatternPtr > from_
const std::vector< TriplePatternPtr > & from() const
std::vector< TriplePatternPtr > to_
const std::vector< TriplePatternPtr > & to() const

◆ GraphTransformationRule() [2/2]

knowrob::GraphTransformationRule::GraphTransformationRule ( const std::vector< TriplePatternPtr > &  from,
const std::vector< TriplePatternPtr > &  to 
)
inline
Parameters
fromthe statements to match in the input graph.
tothe statements to replace in the input graph.

Definition at line 21 of file GraphTransformationRule.h.

23  : from_(from), to_(to) {}

Member Function Documentation

◆ from() [1/2]

const std::vector<TriplePatternPtr>& knowrob::GraphTransformationRule::from ( ) const
inline
Returns
the statements to match in the input graph.

Definition at line 33 of file GraphTransformationRule.h.

33 { return from_; }

◆ from() [2/2]

const std::vector<TriplePatternPtr>& knowrob::GraphTransformationRule::from ( ) const
inline
Returns
the statements to match in the input graph.

Definition at line 33 of file GraphTransformationRule.h.

33 { return from_; }

◆ getSPARQLQuery() [1/2]

SPARQLQuery knowrob::GraphTransformationRule::getSPARQLQuery ( ) const
inline
Returns
the SPARQL query that is used to match the input graph.

Definition at line 28 of file GraphTransformationRule.h.

28 { return SPARQLQuery(std::make_shared<GraphQuery>(from_)); }

◆ getSPARQLQuery() [2/2]

SPARQLQuery knowrob::GraphTransformationRule::getSPARQLQuery ( ) const
inline
Returns
the SPARQL query that is used to match the input graph.

Definition at line 28 of file GraphTransformationRule.h.

28 { return SPARQLQuery(std::make_shared<GraphQuery>(from_)); }

◆ to() [1/2]

const std::vector<TriplePatternPtr>& knowrob::GraphTransformationRule::to ( ) const
inline
Returns
the statements to replace in the input graph.

Definition at line 38 of file GraphTransformationRule.h.

38 { return to_; }

◆ to() [2/2]

const std::vector<TriplePatternPtr>& knowrob::GraphTransformationRule::to ( ) const
inline
Returns
the statements to replace in the input graph.

Definition at line 38 of file GraphTransformationRule.h.

38 { return to_; }

Member Data Documentation

◆ from_

std::vector< TriplePatternPtr > knowrob::GraphTransformationRule::from_
protected

Definition at line 41 of file GraphTransformationRule.h.

◆ to_

std::vector< TriplePatternPtr > knowrob::GraphTransformationRule::to_
protected

Definition at line 42 of file GraphTransformationRule.h.


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