knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob_module.cpp File Reference
#include <iostream>
#include <functional>
#include <future>
#include <memory>
#include <boost/python.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "knowrob/Logger.h"
#include "knowrob/terms/ListTerm.h"
#include "knowrob/terms/Numeric.h"
#include "knowrob/terms/Blank.h"
#include "knowrob/terms/String.h"
#include "knowrob/terms/IRIAtom.h"
#include "knowrob/formulas/Formula.h"
#include "knowrob/queries/QueryContext.h"
#include "knowrob/queries/QueryParser.h"
#include "knowrob/reasoner/Reasoner.h"
#include "knowrob/KnowledgeBase.h"
#include "knowrob/integration/python/converter.h"
#include "knowrob/integration/python/utils.h"
#include "knowrob/knowrob.h"
#include "knowrob/integration/InterfaceUtils.h"
#include "knowrob/storage/redland/RedlandModel.h"
#include "knowrob/integration/prolog/PrologBackend.h"
#include "knowrob/storage/mongo/MongoKnowledgeGraph.h"
Include dependency graph for knowrob_module.cpp:

Go to the source code of this file.

Macros

#define MODULENAME   knowrob
 

Functions

 BOOST_PYTHON_MODULE (MODULENAME)
 

Macro Definition Documentation

◆ MODULENAME

#define MODULENAME   knowrob

Definition at line 33 of file knowrob_module.cpp.

Function Documentation

◆ BOOST_PYTHON_MODULE()

BOOST_PYTHON_MODULE ( MODULENAME  )

Definition at line 88 of file knowrob_module.cpp.

88  {
89  using namespace boost::python;
90  using namespace knowrob::py;
91 
92  // convert std::string_view to python::str and vice versa.
97 
99  // mappings for KnowRob types
101  register_common_types();
102  register_term_types();
103  register_formula_types();
104  register_triple_types();
105 
116 
117  // register builtin storage types.
118  // without it seems the to-python conversion is not mapping to QueryableStorage but only Storage type!
119  class_<RedlandModel, std::shared_ptr<RedlandModel>, bases<QueryableStorage>, boost::noncopyable>
120  ("RedlandModel", init<>());
121  class_<PrologBackend, std::shared_ptr<PrologBackend>, bases<QueryableStorage>, boost::noncopyable>
122  ("PrologBackend", init<>());
123  class_<MongoKnowledgeGraph, std::shared_ptr<MongoKnowledgeGraph>, bases<QueryableStorage>, boost::noncopyable>
124  ("MongoKnowledgeGraph", init<>());
125 
127  // mappings for optionals used in the structs above
129  // Note: At the moment each optional must be listed individually in the module declaration.
130  // It would be nice if this could be avoided...
135 }
void createType< KnowledgeBase >()
void register_pair_converter()
Definition: pair.h:24
void register_string_view_converter()
Definition: string_view.h:33
void createType< QueryContext >()
void createType< InterfaceUtils >()
void createType< Storage >()
Definition: Storage.cpp:49
void createType< TokenStream >()
void staticKnowRobModuleInit()
Definition: knowrob.cpp:134
void register_dict_to_map_converter()
Definition: dict.h:59
void createType< Reasoner >()
Definition: Reasoner.cpp:65
void createType< DataSourceHandler >()
void createType< DataSource >()
Definition: DataSource.cpp:144
void register_list_converter()
Definition: list.h:29
void createType< QueryParser >()
Definition: QueryParser.cpp:62