Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPARQL Update Part 1: Located Triples #1379

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

Qup42
Copy link
Member

@Qup42 Qup42 commented Jun 20, 2024

This is the first PR in a series of PRs that will come from #1351.

Changes:

  • LocatedTriple is a triple that is to be deleted/inserted and has been assigned to a block in the index.
    • An operation to locate a batch of Triples: locateTriplesInPermutation
  • LocatedTriples are an ordered set of LocatedTriples.
  • LocatedTriplesPerBlock are LocatedTriples for different blocks. This data structure will later exist once per Permutation.
    • An operation to add and remove LocatedTriples: add and erase
    • An operation to update IdTable by the changes: mergeTriples

@Qup42
Copy link
Member Author

Qup42 commented Jun 20, 2024

This PR will run somewhat parallel to #1351. To keep it in sync I will cherry-pick the changes made here back to it.

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 88.73239% with 24 lines in your changes missing coverage. Please review.

Project coverage is 88.98%. Comparing base (f9e730c) to head (cfea64b).
Report is 5 commits behind head on master.

Files Patch % Lines
src/index/LocatedTriples.cpp 85.88% 13 Missing and 10 partials ⚠️
src/index/Permutation.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1379      +/-   ##
==========================================
+ Coverage   88.89%   88.98%   +0.08%     
==========================================
  Files         327      332       +5     
  Lines       28974    29370     +396     
  Branches     3210     3258      +48     
==========================================
+ Hits        25756    26134     +378     
- Misses       2066     2073       +7     
- Partials     1152     1163      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some preliminary comments, haven't looked at everything yet.

test/LocatedTriplesTest.cpp Show resolved Hide resolved
src/index/LocatedTriples.h Outdated Show resolved Hide resolved
src/index/LocatedTriples.h Show resolved Hide resolved
src/index/LocatedTriples.h Show resolved Hide resolved
src/index/LocatedTriples.h Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some more comments.

src/index/LocatedTriples.cpp Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
test/LocatedTriplesTest.cpp Outdated Show resolved Hide resolved
test/LocatedTriplesTest.cpp Outdated Show resolved Hide resolved
test/LocatedTriplesTest.cpp Outdated Show resolved Hide resolved
test/LocatedTriplesTest.cpp Outdated Show resolved Hide resolved
test/LocatedTriplesTest.cpp Show resolved Hide resolved
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some additional suggestions and discussions.

src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.h Show resolved Hide resolved
src/engine/idTable/IdTableRow.h Outdated Show resolved Hide resolved
Comment on lines 36 to 39
// TODO<qup42>: should this be a `PermutedTriple`?
IdTriple permute(const std::array<size_t, 3>& keyOrder) const {
return IdTriple{ids_[keyOrder[0]], ids_[keyOrder[1]], ids_[keyOrder[2]]};
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is in fact a REALLY good idea.
We should have Triples where the order is subject, predicate, object (and the member are maybe even called as such).
And then we have permuted triples that always belong to a permutation.

Copy link
Member Author

@Qup42 Qup42 Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applying this somewhat consistently would entail quite a lot more changes. To not loose the payload, PermutedTriple would also have to get one. We'd want constructors to convert between them and (maybe comparators). For this PermutedTriple should be extracted to a separate header and both would require header+implementation. src/global would be a good, but currently only has headers... Not to speak of using it. I'll look how the need develops for the rest but, I think that this could be too much for a single PR.

src/global/IdTriple.h Outdated Show resolved Hide resolved
src/global/IdTriple.h Outdated Show resolved Hide resolved
src/index/LocatedTriples.cpp Outdated Show resolved Hide resolved
src/index/LocatedTriples.h Outdated Show resolved Hide resolved
@Qup42
Copy link
Member Author

Qup42 commented Jun 24, 2024

@joka921 whats the usual procedure for the coverage of debugging <<s? Write a test only to satisfy or even include a simple testcase?

@Qup42
Copy link
Member Author

Qup42 commented Jul 1, 2024

@joka921 I investigated the build failure on MacOS. The <=> was only implemented for array in libc++ in May 2023 1. I would expect it to available from LLVM 17 (September 2023 2) on, but we're currently building against LLVM 16.

Footnotes

  1. https://reviews.llvm.org/D132265

  2. https://releases.llvm.org/

Copy link

sonarcloud bot commented Jul 2, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants