Skip to content

Commit

Permalink
Corrected the benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Griezn committed Dec 4, 2024
1 parent a7d9f62 commit b670616
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions benchmark/Query1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ bool natural_join(const triple_t in1, const triple_t in2)
return in1.subject == in2.subject;
}

bool filter_obs_prop(const triple_t in)
{
return in.predicate == SOSA_OBSERVED_PROPERTY;
}

bool filter_has_value(const triple_t in)
{
return in.predicate == SOSA_HAS_SIMPLE_RESULT;
}

bool filter_obs_id(const triple_t in)
{
return in.predicate == SOSA_MADE_BY_SENSOR;
}

static void query1(benchmark::State& state)
{
source_t *source1 = create_file_source("../../benchmark/data/AarhusTrafficData182955.bin", 1, 255);
Expand All @@ -53,28 +68,28 @@ static void query1(benchmark::State& state)
multi_source_add(msource, source1);
multi_source_add(msource, source2);

uint8_t obs_prop[1] = {SOSA_OBSERVED_PROPERTY};
filter_check_t obs_prop[1] = {filter_obs_prop};
operator_t select_obs_prop = {
.type = SELECT,
.type = FILTER,
.left = nullptr,
.right = nullptr,
.params = {.select = {.size = 1, .colums = obs_prop}}
.params = {.filter = {.size = 1, .checks = obs_prop}}
};

uint8_t has_value[1] = {SOSA_HAS_SIMPLE_RESULT};
filter_check_t has_value[1] = {filter_has_value};
operator_t select_has_value = {
.type = SELECT,
.type = FILTER,
.left = nullptr,
.right = nullptr,
.params = {.select = {.size = 1, .colums = has_value}}
.params = {.filter = {.size = 1, .checks = has_value}}
};

uint8_t obs_id[1] = {SOSA_MADE_BY_SENSOR};
filter_check_t obs_id[1] = {filter_obs_id};
operator_t select_obs_id = {
.type = SELECT,
.type = FILTER,
.left = nullptr,
.right = nullptr,
.params = {.select = {.size = 1, .colums = obs_id}}
.params = {.filter = {.size = 1, .checks = obs_id}}
};

join_check_t cond[1] = {natural_join};
Expand Down

0 comments on commit b670616

Please sign in to comment.