knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
TriplePattern.cpp File Reference
#include "knowrob/semweb/TriplePattern.h"
#include "knowrob/Logger.h"
#include "knowrob/queries/QueryError.h"
#include "knowrob/terms/Atomic.h"
#include "knowrob/terms/Numeric.h"
#include "knowrob/terms/Atom.h"
#include "knowrob/terms/IRIAtom.h"
#include "knowrob/terms/Blank.h"
#include "knowrob/integration/python/utils.h"
#include "knowrob/semweb/rdf.h"
#include "knowrob/integration/python/converter/vector.h"
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
Include dependency graph for TriplePattern.cpp:

Go to the source code of this file.

Namespaces

 knowrob
 
 knowrob::py
 

Functions

template<typename NumType >
bool filterNumeric (const NumType &a, const NumType &b, FilterType op)
 
TriplePatternPtr knowrob::applyBindings (const TriplePatternPtr &pat, const Bindings &bindings)
 
template<>
void knowrob::py::createType< TriplePattern > ()
 

Function Documentation

◆ filterNumeric()

template<typename NumType >
bool filterNumeric ( const NumType &  a,
const NumType &  b,
FilterType  op 
)

Definition at line 229 of file TriplePattern.cpp.

229  {
230  switch (op) {
231  case FilterType::EQ:
232  return a == b;
233  case FilterType::NEQ:
234  return a != b;
235  case FilterType::LEQ:
236  return a <= b;
237  case FilterType::GEQ:
238  return a >= b;
239  case FilterType::GT:
240  return a > b;
241  case FilterType::LT:
242  return a < b;
243  }
244  return false;
245 }