owlcpp  v0.3.3~
C++ library for working with OWL ontologies
 All Classes Namespaces Files Functions Macros Pages
test_utils.hpp
Go to the documentation of this file.
1 
6 #ifndef TEST_UTILS_HPP_
7 #define TEST_UTILS_HPP_
8 #include "boost/range.hpp"
9 
10 #include "owlcpp/rdf/triple.hpp"
11 
12 namespace owlcpp{ namespace test{
13 
14 
15 Triple triple(const unsigned t0, const unsigned t1, const unsigned t2, const unsigned t3) {
16  return Triple::make(Node_id(t0), Node_id(t1), Node_id(t2), Doc_id(t3));
17 }
18 
19 template<class Tm, class Seq> void insert_triple(Tm& tm, Seq const& s) {
20  tm.insert(Node_id(s[0]), Node_id(s[1]), Node_id(s[2]), Doc_id(s[3]));
21 }
22 
23 template<class Tm, class Seq> void insert_seq(Tm& tm, Seq const& s) {
24  for(std::size_t i = 0; i != boost::size(s); ++i) insert_triple(tm, s[i]);
25 }
26 
27 }//namespace test
28 }//namespace owlcpp
29 #endif /* TEST_UTILS_HPP_ */