Reference for Graphify edge types — imports_from, calls, contains, references reads, writes.
Reference for all relationship types (edges) in the Graphify knowledge graph.
| Edge Type | Direction | Description | Code Example |
|---|---|---|---|
imports_from | A → B | Module A imports module B | import yaml |
calls | A → B | Function A calls function B | main() → parse_args() |
contains | A → B | File/module A contains symbol B | file.py → mergeParams() |
references | A → B | Symbol A references symbol B | mergeParams() → deepMerge() |
reads | A → B | Code A reads file B | script → config.yaml |
writes | A → B | Code A writes file B | script → output.yaml |
imports_fromMeaning: Module/file imports another module.
Source: Import statements in code.
Examples:
1import yaml # file.py --imports_from--> yaml
2from pathlib import Path # file.py --imports_from--> pathlib
3import scripts.dictionary.merge_params # file.py --imports_from--> merge_params
In Graph:
scripts/dictionary/yt-to-content-v2.py
--imports_from [context=import]--> argparse
--imports_from [context=import]--> yaml
--imports_from [context=import]--> scripts.dictionary.merge_params
Query:
1graphify query "what does scripts/dictionary/yt-to-content-v2.py import?"
callsMeaning: Function/method calls another function/method.
Source: Function call expressions in code.
Examples:
1def main():
2 parse_args() # main --calls--> parse_args
3 mergeParams() # main --calls--> mergeParams
4
5def mergeParams():
6 deepMerge() # mergeParams --calls--> deepMerge
7 readYaml() # mergeParams --calls--> readYaml
In Graph:
main() --calls [context=call]--> parse_args()
main() --calls [context=call]--> mergeParams()
mergeParams() --calls [context=call]--> deepMerge()
Query:
1graphify query "what functions does main() call?"
2graphify path main mergeParams
containsMeaning: File or module contains a symbol (function, class, variable).
Source: Symbol definitions in files.
Examples:
1# file.py contains:
2def mergeParams(): ... # file.py --contains--> mergeParams
3class Config: ... # file.py --contains--> Config
4ARGS = [] # file.py --contains--> ARGS
In Graph:
scripts/dictionary/yt-to-content-v2.py
--contains--> main()
--contains--> parse_args()
--contains--> mergeParams()
--contains--> ARGS
--contains--> CONFIG_DIR
Query:
1graphify query "what functions are in scripts/dictionary/yt-to-content-v2.py?"
2graphify explain scripts/dictionary/yt-to-content-v2.py
referencesMeaning: Symbol references (uses, mentions) another symbol without calling it.
Source: Variable references, attribute access, type annotations, docstrings.
Examples:
1# mergeParams references deepMerge (calls it)
2# mergeParams references readYaml (calls it)
3# mergeParams references ARGS (uses variable)
4# Config references ARGS (type annotation)
Distinction from calls:
calls = explicit function call func()references = any other reference (variable use, attribute, type hint)In Graph:
mergeParams() --references--> deepMerge
mergeParams() --references--> ARGS
Config --references--> ARGS
Query:
1graphify query "what symbols does mergeParams reference?"
readsMeaning: Code reads a file (config, data, template, transcript).
Source: File I/O operations: open(), read(), yaml.safe_load(), etc.
Examples:
1with open("tasks/content.yaml") as f: # script --reads--> tasks/content.yaml
2yaml.safe_load(f) # script --reads--> tasks/content.yaml
3transcript = fetch_transcript(url) # script --reads--> transcript.txt
In Graph:
scripts/dictionary/yt-to-content-v2.py
--reads--> tasks/content.yaml
--reads--> .prompts/youtube/transcripts/...-transcript.txt
Query:
1graphify query "what files does yt-to-content-v2.py read?"
writesMeaning: Code writes/creates a file.
Source: File output operations: open(..., 'w'), write(), yaml.dump(), etc.
Examples:
1with open("output.yaml", "w") as f: # script --writes--> output.yaml
2yaml.dump(data, f) # script --writes--> output.yaml
3create_folders() # script --writes--> directory structure
In Graph:
scripts/dictionary/yt-to-content-v2.py
--writes--> .prompts/youtube/prompts/...-prompt.md
--writes--> .prompts/youtube/transcripts/...-transcript.txt
--writes--> content/courses/.../index.md (via prompt)
Query:
1graphify query "what files does yt-to-content-v2.py write?"
tasks/content.yaml
--contains (task def)--> yt:content
--references (vars)--> scripts/dictionary/yt-to-content-v2.py
--reads (by script)--> (script reads task vars)
scripts/dictionary/yt-to-content-v2.py
--contains--> main, parse_args, mergeParams
--imports_from--> argparse, yaml, scripts.dictionary.merge_params
--calls (main)--> parse_args, mergeParams
--calls (mergeParams)--> deepMerge, readYaml
--reads--> tasks/content.yaml, transcript.txt
--writes--> prompt.md, transcript.txt
1# All imports
2graphify query "what does file.py import?"
3
4# All calls from function
5graphify query "what does functionName call?"
6
7# All contained symbols
8graphify query "what functions are in file.py?"
9
10# Files read
11graphify query "what files does file.py read?"
12
13# Files written
14graphify query "what files does file.py write?"
15
16# Full trace
17graphify path file.py target.yaml
Some edges have attributes (shown in [brackets]):
| Attribute | Edge Types | Example |
|---|---|---|
context=import | imports_from | --imports_from [context=import]--> yaml |
context=call | calls | --calls [context=call]--> parse_args() |
context=reference | references | --references [context=reference]--> deepMerge |