#include "rule_internal.h"
#include "rule_term_base.h"
namespace rule {
namespace internal {
const unsigned int beta_relation::NO_LOOKUP_INDEX = std::numeric_limits<unsigned int>::max();
std::string relation_row_map::to_string()const
{
std::ostringstream out;
data_type::const_iterator itor = m_data.begin();
data_type::const_iterator end = m_data.end();
bool is_first = true;
out << "[";
for(;itor!=end; ++itor) {
if(!is_first) out << ", ";
out << rdf::internal::to_resource_base(*itor);
is_first = false;
}
out << "]";
return out.str();
};
std::string relation_row_map::to_string(rule_term_base const& rule_term)const
{
std::ostringstream out;
data_type::const_iterator itor = m_data.begin();
data_type::const_iterator end = m_data.end();
index_map_helper::label_iterator litor = rule_term.label_iterator_begin();
index_map_helper::label_iterator lend = rule_term.label_iterator_end();
bool is_first = true;
out << "[";
for(;itor!=end; ++itor) {
if(!is_first) out << ", ";
if(litor != lend) {
out << *litor << "=" << rdf::internal::to_resource_base(*itor);
++litor;
} else {
out << rdf::internal::to_resource_base(*itor);
}
is_first = false;
}
out << "]";
return out.str();
};
}; /* internal */
}; /* rule */