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
- Update graph_loader to create nodes with both labels:
[:Function:Method]
- Update queries in documentation to leverage multi-label pattern
- Maintain backwards compatibility temporarily (keep existing
:Method queries working)
- Update schema documentation
Related
Acceptance Criteria
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
:Functionand:Method:MATCH (f:Function)gets all functions AND methodsMATCH (f:Function:Method)gets only methodsMATCH (f:Function) WHERE NOT f:Methodgets only standalone functionsBenefits
WHERE (f:Function OR f:Method):Function:Externalpattern from Improve property storage: Replace string serialization with structured data #30Implementation
[:Function:Method]:Methodqueries working)Related
Acceptance Criteria
:Functionand:MethodlabelsMATCH (f:Function)returns both functions and methodsMATCH (f:Method)still works (backwards compatible)