owlcpp  v0.3.3~
C++ library for working with OWL ontologies
 All Classes Namespaces Files Functions Macros Pages
query_triples.hpp
Go to the documentation of this file.
1 
6 #ifndef QUERY_TRIPLES_HPP_
7 #define QUERY_TRIPLES_HPP_
8 #include "boost/range.hpp"
12 
13 namespace owlcpp{
14 
27 boost::iterator_range<Rdf_list_iter_s> inline rdf_list(
28  const Node_id nid, Triple_store const& ts) {
29  return boost::make_iterator_range(Rdf_list_iter_s(nid, ts), Rdf_list_iter_s());
30 }
31 
34 inline std::string find_label(const Node_id nid, Triple_store const& store) {
35  Triple_store::result_b<1,1,0,0>::type r =
36  store.find_triple(nid, owlcpp::terms::rdfs_label::id(), any(), any());
37  if( ! r ) return "";
38  return to_string(r.front().obj_, store);
39 }
40 
41 }//namespace owlcpp
42 #endif /* QUERY_TRIPLES_HPP_ */