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

Give each index a (reasonably) unique ID #984

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Give each index a (reasonably) unique ID #984

merged 1 commit into from
Jan 19, 2024

Conversation

hannahbast
Copy link
Member

@hannahbast hannahbast commented May 19, 2023

The index ID is currently just a concatenation of the index name, and the number of triples, subjects, predicates, and objects. This makes it unlikely (but not impossible) that two different indexes have the same ID. The ID can be obtained via the API with cmd=get-index-id.

This feature is useful for applications like https://github.com/ad-freiburg/qlever-petrimaps, which have an internal cache that depends on the index. When the index changes, the application should be able to notice that, and with the index ID, it now can.

@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d7635f0) 85.80% compared to head (d231e67) 85.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #984   +/-   ##
=======================================
  Coverage   85.80%   85.81%           
=======================================
  Files         308      308           
  Lines       29261    29266    +5     
  Branches     3430     3430           
=======================================
+ Hits        25108    25114    +6     
- Misses       2787     2789    +2     
+ Partials     1366     1363    -3     

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@hannahbast hannahbast force-pushed the index-id branch 2 times, most recently from 2d3d8b6 to 3b21d2d Compare July 12, 2023 19:51
@hannahbast hannahbast force-pushed the index-id branch 2 times, most recently from b71939e to fc11809 Compare July 21, 2023 07:19
@hannahbast hannahbast force-pushed the index-id branch 2 times, most recently from 2872384 to 66d5893 Compare August 4, 2023 20:32
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

warning The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

sonarqubecloud bot commented Dec 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

The ID is a string that can be obtained via the API with
cmd=get-index-id. It is currently just a concatenation of the index name
and several statistics on the number of triples (which is reasonably
but not perfectly unique).

This feature is useful for applications like
https://github.com/ad-freiburg/qlever-petrimaps, which have an internal
cache that depends on the index. When the index changes, the application
should be able to notice this an clear its cache. With an index ID it
can.
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

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

See analysis details on SonarCloud

@hannahbast
Copy link
Member Author

@joka921 This has been lying around for some time now (and has already been in active use for month). It's simplistic but good enough IMO. I just rebased it to the current master and added a simple test. Please have a quick look and let me know whether you want anything changed before we merge this?

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.

We can extend this in the future, but as it seems, this works for your current use case (knowledge graphs only tend to grow, so the probability of false positives is very low),
so you can merge this as is.

@hannahbast hannahbast changed the title Give each index a unique ID Give each index a (reasonably) unique ID Jan 19, 2024
@hannahbast hannahbast merged commit 95fc20b into master Jan 19, 2024
18 checks passed
@hannahbast hannahbast deleted the index-id branch February 8, 2024 17:02
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