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

Implement functions UUID() and STRUUID() #1366

Merged
merged 35 commits into from
Jun 13, 2024

Conversation

realHannes
Copy link
Collaborator

@realHannes realHannes commented Jun 9, 2024

These functions generate a random UUID for each invocation.

realHannes and others added 28 commits April 25, 2024 19:07
@realHannes realHannes requested a review from joka921 June 9, 2024 08:50
@realHannes
Copy link
Collaborator Author

Should the urn:uuid for the Iri be defined in Constants.h?

Copy link

codecov bot commented Jun 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.88%. Comparing base (8bbd3a7) to head (35b061b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1366      +/-   ##
==========================================
- Coverage   88.89%   88.88%   -0.01%     
==========================================
  Files         326      327       +1     
  Lines       28992    29034      +42     
  Branches     3214     3217       +3     
==========================================
+ Hits        25773    25808      +35     
- Misses       2066     2068       +2     
- Partials     1153     1158       +5     

☔ 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 very minor suggestions, overall this looks good!


using LiteralOrIri = ad_utility::triple_component::LiteralOrIri;

inline constexpr auto fromLiteral = [](std::string_view str) {
Copy link
Member

Choose a reason for hiding this comment

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

  1. inline is redundant for constexpr values, so it can be dropped.
  2. Those inline functions are a bit prone to multiple definition errors etc, better move them into a namespace sparqlExpression::uuidExpression::detail or something.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Somehow the tests for builtInCall don't pass if i remove the inline.

src/engine/sparqlExpressions/UuidExpressions.h Outdated Show resolved Hide resolved
src/engine/sparqlExpressions/UuidExpressions.h Outdated Show resolved Hide resolved
src/util/Random.h Outdated Show resolved Hide resolved
test/RandomTest.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.

Only a very very minor change left.

src/engine/sparqlExpressions/UuidExpressions.h Outdated Show resolved Hide resolved
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@joka921 joka921 changed the title implementation of UUID() and STRUUID() Implement functions UUID() and STRUUID() Jun 13, 2024
@joka921 joka921 merged commit 01d369d into ad-freiburg:master Jun 13, 2024
19 checks passed
realHannes added a commit to realHannes/qlever that referenced this pull request Jun 15, 2024
These functions generate a random UUID for each invocation.
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