Skip to content

Support multi-label nodes: Method as :Function:Method #48

Description

@octo-youcef

User Outcome

A user can write queries that work seamlessly across both functions and methods without duplicating query logic, while still being able to filter specifically for methods when needed.

Background

Currently, methods are labeled only as :Method, separate from :Function. This requires duplicating queries when you want to query "all callable code" (both functions and methods).

Neo4j supports multi-label nodes (e.g., :Function:Method), which is idiomatic and provides query flexibility.

Proposal

Label methods with both :Function and :Method:

  • Query MATCH (f:Function) gets all functions AND methods
  • Query MATCH (f:Function:Method) gets only methods
  • Query MATCH (f:Function) WHERE NOT f:Method gets only standalone functions

Benefits

Implementation

  1. Update graph_loader to create nodes with both labels: [:Function:Method]
  2. Update queries in documentation to leverage multi-label pattern
  3. Maintain backwards compatibility temporarily (keep existing :Method queries working)
  4. Update schema documentation

Related

Acceptance Criteria

  • Methods created with both :Function and :Method labels
  • Query MATCH (f:Function) returns both functions and methods
  • Query MATCH (f:Method) still works (backwards compatible)
  • Schema documentation updated
  • User journey examples updated to show multi-label benefits

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions