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

Located triples with graph information #1572

Merged
merged 25 commits into from
Oct 22, 2024

Conversation

joka921
Copy link
Member

@joka921 joka921 commented Oct 21, 2024

Triples from a SPARQL 1.1 Update operation also belong to a graph, but so far, our located triples did not contain graph information. Now each located triple holds an array of four Ids, where the first three denote the subject, predicate, and object (in the order of the permutation in which the triple is located), and the fourth denotes the graph.

Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 97.36842% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.99%. Comparing base (aec57fe) to head (74391ab).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/index/LocatedTriples.cpp 95.65% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1572      +/-   ##
==========================================
+ Coverage   88.98%   88.99%   +0.01%     
==========================================
  Files         368      368              
  Lines       33825    33853      +28     
  Branches     3827     3827              
==========================================
+ Hits        30098    30127      +29     
  Misses       2473     2473              
+ Partials     1254     1253       -1     

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

Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

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

Round 2 of reviewing from the train, looks good now + revised various comments, just one question about a requires.

// is `2` and `includeGraphColumn` is `true`, the function returns
// `std::tie(row[0], row[1], row[2])`.
template <size_t numIndexColumns, bool includeGraphColumn>
requires(numIndexColumns >= 1 && numIndexColumns <= IdTriple<0>::NumCols)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the second condition somehow depend on row and not on IdTriple<0>::NumCols?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be a hardcoded 3 as it was before, since the graph column is now handled explicitly.

Hannah Bast and others added 7 commits October 21, 2024 22:25
Signed-off-by: Johannes Kalmbach <[email protected]>
# Conflicts:
#	test/CompressedRelationsTest.cpp
#	test/IndexMetaDataTest.cpp
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
# Conflicts:
#	src/index/IndexFormatVersion.h
#	test/CompressedRelationsTest.cpp
#	test/IndexMetaDataTest.cpp
Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fix and the added test. I have left a suggestion for also testing the false case, assuming that it's easy to do (please le me know in case I overlooked something)

Comment on lines +556 to +557
auto merged = locatedTriplesPerBlock.mergeTriples(1, block, 2, true);
EXPECT_THAT(merged, testing::ElementsAreArray(resultExpected));
Copy link
Member

Choose a reason for hiding this comment

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

How about also testing here (and in the following) the call, where the last argument is false. A simple helper lambda that strips the last column from resultExpected should do the job (and it can be reused for the following cases).

Copy link
Member Author

Choose a reason for hiding this comment

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

If I understand you correctly, then this doesn't work. The result changes as soon as we drop the graph column, as triples that don't match because of the GRAPH now suddenly match etc.
We already (preexisting, so not shown in the diff) have exhaustive tests for the case where the last argument is false.

Copy link
Member

Choose a reason for hiding this comment

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

You are right, thanks for the clarification

Signed-off-by: Johannes Kalmbach <[email protected]>
Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

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

Looks great now

Signed-off-by: Johannes Kalmbach <[email protected]>
@sparql-conformance
Copy link

@hannahbast hannahbast changed the title Also store the ID of the graph in the LocatedTriples Located triples with graph info Oct 22, 2024
@hannahbast hannahbast changed the title Located triples with graph info Located triples with graph information Oct 22, 2024
@hannahbast hannahbast merged commit f856919 into ad-freiburg:master Oct 22, 2024
21 checks passed
Copy link

sonarcloud bot commented Oct 22, 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.

2 participants