Skip to content

Commit

Permalink
Fix merge conflicts.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Kalmbach <[email protected]>
  • Loading branch information
joka921 committed Nov 7, 2024
1 parent 1b4c7cd commit 15edb4d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/index/DeltaTriples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ DeltaTriples::locateAndAddTriples(CancellationHandle cancellationHandle,
cancellationHandle);
cancellationHandle->throwIfCancelled();
intermediateHandles[static_cast<size_t>(permutation)] =
locatedTriples()[static_cast<size_t>(permutation)].add(locatedTriples);
this->locatedTriples()[static_cast<size_t>(permutation)].add(
locatedTriples);
cancellationHandle->throwIfCancelled();
}
std::vector<DeltaTriples::LocatedTripleHandles> handles{idTriples.size()};
Expand Down
2 changes: 1 addition & 1 deletion test/DeltaTriplesTestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ inline auto InAllPermutations =
absl::StrCat(".getLocatedTriplesPerBlock(",
Permutation::toString(perm), ")"),
[perm](const DeltaTriples& deltaTriples) {
return deltaTriples.getLocatedTriplesPerBlock(perm);
return deltaTriples.getLocatedTriplesForPermutation(perm);
},
InnerMatcher);
}));
Expand Down
54 changes: 35 additions & 19 deletions test/IndexTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ TEST(IndexTest, createFromTurtleTest) {
return;
}
const auto& [index, qec] = getIndex();
const auto& deltaTriples = qec.locatedTriplesSnapshot_();
const auto& locatedTriplesSnapshot = qec.locatedTriplesSnapshot();

auto getId = makeGetId(getQec(kb)->getIndex());
Id a = getId("<a>");
Expand All @@ -103,33 +103,49 @@ TEST(IndexTest, createFromTurtleTest) {
Id c2 = getId("<c2>");

// TODO<joka921> We could also test the multiplicities here.
ASSERT_TRUE(index.PSO().getMetadata(b, deltaTriples).has_value());
ASSERT_TRUE(index.PSO().getMetadata(b2, deltaTriples).has_value());
ASSERT_FALSE(index.PSO().getMetadata(a2, deltaTriples).has_value());
ASSERT_FALSE(index.PSO().getMetadata(c, deltaTriples).has_value());
ASSERT_TRUE(
index.PSO().getMetadata(b, locatedTriplesSnapshot).has_value());
ASSERT_TRUE(
index.PSO().getMetadata(b2, locatedTriplesSnapshot).has_value());
ASSERT_FALSE(
index.PSO().getMetadata(a2, locatedTriplesSnapshot).has_value());
ASSERT_FALSE(
index.PSO().getMetadata(c, locatedTriplesSnapshot).has_value());
ASSERT_FALSE(
index.PSO()
.getMetadata(Id::makeFromVocabIndex(VocabIndex::make(735)),
deltaTriples)
locatedTriplesSnapshot)
.has_value());
ASSERT_FALSE(
index.PSO().getMetadata(b, deltaTriples).value().isFunctional());
ASSERT_TRUE(
index.PSO().getMetadata(b2, deltaTriples).value().isFunctional());
ASSERT_FALSE(index.PSO()
.getMetadata(b, locatedTriplesSnapshot)
.value()
.isFunctional());
ASSERT_TRUE(index.PSO()
.getMetadata(b2, locatedTriplesSnapshot)
.value()
.isFunctional());

ASSERT_TRUE(index.POS().getMetadata(b, deltaTriples).has_value());
ASSERT_TRUE(index.POS().getMetadata(b2, deltaTriples).has_value());
ASSERT_FALSE(index.POS().getMetadata(a2, deltaTriples).has_value());
ASSERT_FALSE(index.POS().getMetadata(c, deltaTriples).has_value());
ASSERT_TRUE(
index.POS().getMetadata(b, locatedTriplesSnapshot).has_value());
ASSERT_TRUE(
index.POS().getMetadata(b2, locatedTriplesSnapshot).has_value());
ASSERT_FALSE(
index.POS().getMetadata(a2, locatedTriplesSnapshot).has_value());
ASSERT_FALSE(
index.POS().getMetadata(c, locatedTriplesSnapshot).has_value());
ASSERT_FALSE(
index.POS()
.getMetadata(Id::makeFromVocabIndex(VocabIndex::make(735)),
deltaTriples)
locatedTriplesSnapshot)
.has_value());
ASSERT_TRUE(
index.POS().getMetadata(b, deltaTriples).value().isFunctional());
ASSERT_TRUE(
index.POS().getMetadata(b2, deltaTriples).value().isFunctional());
ASSERT_TRUE(index.POS()
.getMetadata(b, locatedTriplesSnapshot)
.value()
.isFunctional());
ASSERT_TRUE(index.POS()
.getMetadata(b2, locatedTriplesSnapshot)
.value()
.isFunctional());

// Relation b
// Pair index
Expand Down

0 comments on commit 15edb4d

Please sign in to comment.