Goal
Extract and store non-CALLS edge types during indexing: IMPORTS, IMPLEMENTS, INHERITS, CHILD_OF.
Context
#429 wires up store_kg_edges() for the edges table but focuses on CALLS only (migration from call_graph). This issue extends extraction to other edge kinds.
Per-Language Extraction Rules
| Edge Kind |
Rust |
Python |
TypeScript |
Go |
| IMPORTS |
use crate::foo |
import foo |
import { x } from 'y' |
import "pkg" |
| IMPLEMENTS |
impl Trait for Struct |
class inherits ABC |
implements Interface |
interface satisfaction |
| INHERITS |
derive(Parent) |
class Child(Parent) |
class C extends P |
struct embedding |
| CHILD_OF |
nested mods |
nested classes |
namespaces |
sub-packages |
Implementation
- Extend
src/index/extract.rs per language
- Rust: parse
use, impl ... for, #[derive]
- Python: parse
import, from ... import, class X(Y)
- TypeScript: parse
import, implements, extends
- Go: parse
import, struct embedding
- Store via
store_kg_edges() with appropriate EdgeKind
Acceptance
SELECT kind, COUNT(*) FROM edges GROUP BY kind shows IMPORTS + IMPLEMENTS
cora query "* <- IMPORTS <- main" works after indexing
- No regression in indexing speed (< 10% overhead)
Depends On
Estimated Effort
1-2 weeks
Goal
Extract and store non-CALLS edge types during indexing: IMPORTS, IMPLEMENTS, INHERITS, CHILD_OF.
Context
#429 wires up
store_kg_edges()for theedgestable but focuses on CALLS only (migration fromcall_graph). This issue extends extraction to other edge kinds.Per-Language Extraction Rules
use crate::fooimport fooimport { x } from 'y'import "pkg"impl Trait for Structimplements Interfacederive(Parent)class Child(Parent)class C extends PImplementation
src/index/extract.rsper languageuse,impl ... for,#[derive]import,from ... import,class X(Y)import,implements,extendsimport, struct embeddingstore_kg_edges()with appropriateEdgeKindAcceptance
SELECT kind, COUNT(*) FROM edges GROUP BY kindshows IMPORTS + IMPLEMENTScora query "* <- IMPORTS <- main"works after indexingDepends On
store_kg_edges()— populateedgestable #429 (wire up edges table)Estimated Effort
1-2 weeks