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

#include <QueryParser.h>

Static Public Member Functions

static FormulaPtr parse (const std::string &queryString)
 
static PredicatePtr parsePredicate (const std::string &queryString)
 
static std::shared_ptr< GraphTermparseGraphTerm (const std::string &queryString)
 
static FunctionPtr parseFunction (const std::string &queryString)
 
static TermPtr parseConstant (const std::string &queryString)
 
static std::string parseRawAtom (const std::string &queryString)
 
static FormulaPtr parse (const std::string &queryString)
 
static PredicatePtr parsePredicate (const std::string &queryString)
 
static std::shared_ptr< GraphTermparseGraphTerm (const std::string &queryString)
 
static FunctionPtr parseFunction (const std::string &queryString)
 
static TermPtr parseConstant (const std::string &queryString)
 
static std::string parseRawAtom (const std::string &queryString)
 

Detailed Description

Constructs formulae from strings.

Definition at line 18 of file QueryParser.h.

Member Function Documentation

◆ parse() [1/2]

FormulaPtr QueryParser::parse ( const std::string &  queryString)
static

Parse a query string into a formula.

Parameters
queryStringthe query string.
Returns
the parsed formula.

Definition at line 33 of file QueryParser.cpp.

33  {
34  return parse_<FormulaPtr, knowrob::parsers::formula::FormulaRule>(queryString,
36 }
FormulaRule & formula()
Definition: formula.cpp:283

◆ parse() [2/2]

static FormulaPtr knowrob::QueryParser::parse ( const std::string &  queryString)
static

Parse a query string into a formula.

Parameters
queryStringthe query string.
Returns
the parsed formula.

◆ parseConstant() [1/2]

TermPtr QueryParser::parseConstant ( const std::string &  queryString)
static

Parse a query string into a constant term.

Parameters
queryStringthe query string.
Returns
the parsed constant term.

Definition at line 52 of file QueryParser.cpp.

52  {
53  return parse_<TermPtr, knowrob::parsers::terms::TermRule>(queryString, knowrob::parsers::terms::atomic());
54 }
TermRule & atomic()
Definition: terms.cpp:79

◆ parseConstant() [2/2]

static TermPtr knowrob::QueryParser::parseConstant ( const std::string &  queryString)
static

Parse a query string into a constant term.

Parameters
queryStringthe query string.
Returns
the parsed constant term.

◆ parseFunction() [1/2]

FunctionPtr QueryParser::parseFunction ( const std::string &  queryString)
static

Parse a query string into a function.

Parameters
queryStringthe query string.
Returns
the parsed function.

Definition at line 48 of file QueryParser.cpp.

48  {
49  return parse_<FunctionPtr, knowrob::parsers::terms::FunctionRule>(queryString, knowrob::parsers::terms::function());
50 }
FunctionRule & function()
Definition: terms.cpp:140

◆ parseFunction() [2/2]

static FunctionPtr knowrob::QueryParser::parseFunction ( const std::string &  queryString)
static

Parse a query string into a function.

Parameters
queryStringthe query string.
Returns
the parsed function.

◆ parseGraphTerm() [1/2]

std::shared_ptr< GraphTerm > QueryParser::parseGraphTerm ( const std::string &  queryString)
static

Parse a query string into a graph term.

Parameters
queryStringthe query string.
Returns
the parsed graph term.

Definition at line 43 of file QueryParser.cpp.

43  {
44  return parse_<std::shared_ptr<GraphTerm>, knowrob::parsers::graph::GraphTermRule>(queryString,
46 }
boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< GraphTerm >(), boost::spirit::ascii::space_type > GraphTermRule
Definition: graph.h:14
GraphTermRule & graphTerm()
Definition: graph.cpp:77

◆ parseGraphTerm() [2/2]

static std::shared_ptr<GraphTerm> knowrob::QueryParser::parseGraphTerm ( const std::string &  queryString)
static

Parse a query string into a graph term.

Parameters
queryStringthe query string.
Returns
the parsed graph term.

◆ parsePredicate() [1/2]

PredicatePtr QueryParser::parsePredicate ( const std::string &  queryString)
static

Parse a query string into a predicate.

Parameters
queryStringthe query string.
Returns
the parsed predicate.

Definition at line 38 of file QueryParser.cpp.

38  {
39  return parse_<PredicatePtr, knowrob::parsers::formula::PredicateRule>(queryString,
41 }
PredicateRule & predicate()
Definition: formula.cpp:221

◆ parsePredicate() [2/2]

static PredicatePtr knowrob::QueryParser::parsePredicate ( const std::string &  queryString)
static

Parse a query string into a predicate.

Parameters
queryStringthe query string.
Returns
the parsed predicate.

◆ parseRawAtom() [1/2]

std::string QueryParser::parseRawAtom ( const std::string &  queryString)
static

Parse a query string into a raw atom.

Parameters
queryStringthe query string.
Returns
the parsed raw atom.

Definition at line 56 of file QueryParser.cpp.

56  {
57  return parse_<std::string, knowrob::parsers::str::StringRule>(queryString, knowrob::parsers::str::atom_or_iri());
58 }
StringRule & atom_or_iri()
Definition: strings.cpp:58

◆ parseRawAtom() [2/2]

static std::string knowrob::QueryParser::parseRawAtom ( const std::string &  queryString)
static

Parse a query string into a raw atom.

Parameters
queryStringthe query string.
Returns
the parsed raw atom.

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