11 #include "boost/assert.hpp"
15 #include "owlcpp/rdf/detail/map_id_object.hpp"
17 #include "owlcpp/detail/iterator_member_pair.hpp"
18 #include "owlcpp/detail/member_iterator.hpp"
19 #include "owlcpp/terms/detail/max_standard_id.hpp"
30 typedef detail::Map_id_object<Ns_iri, id_type> map_t;
33 typedef Iterator_member_pair<map_t::const_iterator, id_type const, 2> iterator;
34 typedef iterator const_iterator;
42 std::size_t size()
const {
return iri_.size();}
43 const_iterator begin()
const {
return iri_.begin();}
44 const_iterator end()
const {
return iri_.end();}
45 bool empty()
const {
return iri_.empty();}
46 Ns_iri
const& operator[](
const Ns_id
id)
const {
return iri_[id];}
47 Ns_iri
const& at(
const Ns_id
id)
const {
return iri_.at(
id);}
48 Ns_iri
const* find(
const Ns_id
id)
const {
return iri_.find(
id);}
49 std::string prefix(
const Ns_id
id)
const {
return pref_.prefix(
id);}
50 Ns_id
const* find_prefix(std::string
const& pref)
const {
return pref_.find(pref);}
57 Ns_id const* find(std::string
const& iri)
const {
return iri_.find(
Ns_iri(iri));}
59 Ns_id insert(Ns_iri
const& iri) {
return iri_.insert(iri);}
60 Ns_id insert(std::string
const& iri) {
return insert(Ns_iri(iri));}
62 void set_prefix(
const Ns_id
id, std::string
const& pref =
"") {
63 if( ! find(
id) ) BOOST_THROW_EXCEPTION(
65 << Err::msg_t(
"invalid namespace ID")
71 void remove(
const Ns_id id) {