feat: allow filtering neighbor expansion by vertex ID#1895
Open
vishwakt wants to merge 1 commit into
Open
Conversation
Add "ID" as a selectable option in the neighbor expansion filter dropdown so a specific neighbor can be found by its ID. Because the ID is not a real property, it is partitioned out of the property filter criteria into a new filterByIds request field and handled directly by each connector's neighbor query: - Gremlin: hasId(...) - openCypher: ID(tgt) IN [...] - SPARQL: FILTER(?neighbor IN (...)) ID is always offered, even for types with no searchable attributes, so the filter section now renders whenever a neighbor type is selected. Closes aws#274
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.
Closes #274
Problem
When expanding a node's neighbors, you could only narrow the results by property values. There was no way to target a specific neighbor by its ID, which is what the issue asks for.
Approach
I'd love a sanity check on the approach before polishing further, happy to change any of it.
1. UI (
NodeExpandFilters/NodeExpandContent)NodeExpandContentpartitions ID filter rows out of the propertyfilterCriteriaand into a newfilterByIdsrequest field. A reserved sentinel name (ID_FILTER_NAME) marks the ID option; it never reaches the connectors.2. Request contract (
NeighborsRequest)filterByIds?: Array<VertexId>. This keeps ID filtering fully separate from the property-basedfilterCriteriapath.3. Connectors each translate
filterByIdsinto their native id filter:hasId(...)ID(tgt) IN [...]FILTER(?neighbor IN (...))Testing
oneHop*template tests (single ID, and multiple IDs combined with a type filter).pnpm checksandpnpm testpass (2071 tests).Open questions for maintainers
INlist (OR). Property filters remain AND-combined. Let me know if you'd expect different semantics.