Syft Schema¶
Nodes¶
SyftPackage¶
Package nodes created from Syft’s artifacts array.
Label: SyftPackage
Property |
Type |
Description |
|---|---|---|
|
string |
Normalized package ID (e.g., |
|
string |
Package name |
|
string |
Package version |
|
string |
Package type (e.g., |
|
string |
Package URL |
|
string |
Same as |
|
string |
Programming language |
|
string |
Syft cataloger that discovered the package |
|
int |
Timestamp of last update |
Relationships¶
SyftPackage DEPENDS_ON SyftPackage¶
Self-referential dependency relationships between SyftPackage nodes.
(:SyftPackage)-[:DEPENDS_ON]->(:SyftPackage)
Property |
Type |
Description |
|---|---|---|
|
int |
Timestamp of last update |
Direction: Parent package DEPENDS_ON its dependency (child package).
Direct vs Transitive Dependencies¶
Direct and transitive dependencies are determined by graph structure rather than stored properties:
Direct dependencies: Packages with no incoming
DEPENDS_ONedges (nothing depends on them)Transitive dependencies: Packages that have incoming
DEPENDS_ONedges
Query to find direct dependencies¶
MATCH (p:SyftPackage)
WHERE NOT exists((p)<-[:DEPENDS_ON]-())
RETURN p.name
Query to find transitive dependencies¶
MATCH (p:SyftPackage)
WHERE exists((p)<-[:DEPENDS_ON]-())
RETURN p.name
Example Graph¶
(express:SyftPackage) <-- direct (nothing depends on it)
-[:DEPENDS_ON]->
(body-parser:SyftPackage) <-- transitive (express depends on it)
-[:DEPENDS_ON]->
(bytes:SyftPackage) <-- transitive (body-parser depends on it)