7 #include "knowrob/semweb/GraphSelector.h"
8 #include "knowrob/knowrob.h"
9 #include "knowrob/integration/python/utils.h"
42 if (other.
end.has_value() && (!
end.has_value() || other.
end.value() >
end.value())) {
75 os << std::setprecision(1);
77 bool hasEpistemicOperator =
false;
79 hasEpistemicOperator =
true;
86 hasEpistemicOperator =
true;
90 if (!hasEpistemicOperator) {
96 bool hasTemporalOperator =
false;
98 hasTemporalOperator =
true;
101 if (
begin.has_value() ||
end.has_value()) {
102 if (!hasTemporalOperator) {
106 if (
begin.has_value()) {
110 if (
end.has_value()) {
118 uncertain = config.get<
bool>(
"uncertain",
false);
119 occasional = config.get<
bool>(
"occasional",
false);
120 if (config.count(
"graph")) {
123 if (config.count(
"perspective")) {
126 if (config.count(
"begin")) {
127 begin = config.get<
double>(
"begin");
129 if (config.count(
"end")) {
130 end = config.get<
double>(
"end");
132 if (config.count(
"confidence")) {
133 confidence = config.get<
double>(
"confidence");
139 static auto defaultSelector = std::make_shared<const GraphSelector>();
140 return defaultSelector;
145 #define BOOST_PYTHON_ADD_OPTIONAL(X, Y) add_property(X, \
146 make_getter(Y, return_value_policy<return_by_value>()), \
147 make_setter(Y, return_value_policy<return_by_value>()))
153 class_<GraphSelector, std::shared_ptr<GraphSelector>>
154 (
"GraphSelector", init<>())
static std::shared_ptr< knowrob::Atom > Tabled(std::string_view stringForm)
static bool isEgoPerspective(std::string_view iri)
void createType< GraphSelector >()
GraphSelectorPtr DefaultGraphSelector()
std::shared_ptr< const GraphSelector > GraphSelectorPtr
void hashCombine(std::size_t &seed, const std::size_t &v)
void write(std::ostream &os) const override
std::optional< double > confidence
std::optional< double > end
PerspectivePtr perspective
void set(const boost::property_tree::ptree &config)
std::optional< double > begin
bool mergeWith(const GraphSelector &other)