Repository navigation
feat(retrieval): REFINE best paths through nested hyperedges - #118
Merged
Merged
Conversation
REFINE walks down from root hyperedges through a fixed sequence of child hyperedge types to leaf members and returns the best paths, scored by the product of membership weights. A best-first search over path bounds, tightened by each edge's largest member weight, emits results in exact descending order, so it stops after TOP k. Child links come from the child-edge index and leaves from the member tree, both pruned by role, validity and weight summaries. With an anchored leaf the search climbs the reverse index instead. Paths never revisit a hyperedge, weights outside [0, 1] are refused, and children or leaves of another tenant are skipped. No issue tracks this work.
…etrieval # Conflicts: # database/src/main/java/io/hstore/db/Reader.java
A bottom-up search that ran out of budget returned whatever paths it had found, which was not a prefix of the answer; it now fails instead, as a top-down search does while roots are still being read. Weight ranges must lie inside [0, 1], so a membership outside it is simply not followed and an unrelated member no longer fails the statement. Roots of a type are read lazily, and every root, posting, child and leaf counts against the budget; bottom-up filters postings on role and validity before reading anything else. A leaf is never a hyperedge already on its path, in either direction, and repeated roots are counted once. No issue tracks this work.
…retrieval # Conflicts: # database/src/main/java/io/hstore/db/Reader.java # database/src/main/java/io/hstore/db/query/Ast.java # database/src/main/java/io/hstore/db/query/Executor.java # database/src/main/java/io/hstore/db/query/Parser.java # database/src/test/java/io/hstore/db/SecurityTest.java # docs/database/hql.md # server/src/main/java/io/hstore/server/StatementLogger.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #115: it reads the child-edge index (slot 56) that #115 adds. Merge #115 first, then retarget this to
main.REFINEwalks down nested hyperedges from root hyperedges, through a fixed sequence of child hyperedge types, to leaf members. It returns the best paths, scored by the product of the membership weights along each path.The syntax is open for renaming before merge.
Refinement.on(reader).run(spec, meter)is the Java entry point.How it works
TOP k.TO … = @leaf): the search climbs the reverse index instead.DISTINCT: keeps the best path per leaf.Testing
Independent review. It found four important issues, fixed here with tests that failed first:
Repeated roots are also counted once now.
Not done here
DISTINCTmode.