Skip to content

query: bounded node-and-neighborhood expansion with edge identities #649

Description

@ragnorc

Problem

Clients exploring an unfamiliar schema need a generic way to retrieve one entity and its immediate graph context. Existing typed traversals work when edge types are known, but there is no generic bounded expansion surface.

Proposed change

Accept a typed entity selector (type plus stable ID or declared key), edge/type/direction filters, requested display properties and explicit bounds. Return the root entity, edge identities/properties/direction, and neighbor identities/display fields in one consistent snapshot.

Define pagination and truncation signals. Start with a one-hop contract, or explicitly bound depth and visited/result counts if supporting more. Preserve parallel edges and self-loops with clear semantics; do not collapse relationships solely by endpoint pair.

Acceptance criteria

  • Clients can expand a root without fetching and compiling the full schema first.
  • Zero-neighbor roots return successfully; multiple edge types and parallel edges retain identity.
  • Results obey entity/property authorization and a single graph snapshot.
  • High-degree nodes have bounded memory/response size, stable pagination and visible truncation.
  • Type-qualified selectors prevent collisions between identical keys on different node types.

This is separate from adding optional joins or edge unions to GQ, though those may help implementation. Existing API: openapi.json; query execution: exec/query.rs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature proposalneeds-triageAwaiting maintainer triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions