Graph schema¶
A sonagram graph is a kglite knowledge graph with one shape: a Track hub,
small dimension nodes to group and traverse by, and two derived
structures — a SIMILAR_TO nearest-neighbour web and Style community nodes.
Key-[:CAMELOT_ADJACENT]->Key encodes the harmonic-mixing wheel. This page is
the node/edge/property reference; for how to query it, see the
Agent guide.
Every node exposes its id as .id and a display string as .title.
Track — one per audio file¶
Id = content_hash. Every signal an agent filters or sorts by is a flat scalar
on Track, so filtering never needs a join. Null? marks properties that can
be null (opt-in analysis that wasn’t run, or a tag the file lacked).
Property |
Type |
Null? |
Meaning / range |
|---|---|---|---|
|
str |
no |
blake3 audio hash = stable identity (survives retag/move). Also |
|
str |
no |
tag title, else filename. Also |
|
str |
no |
library-root-relative path (mutable) |
|
str |
no |
file name only |
|
str |
no |
artist tag, else |
|
str |
yes |
album tag |
|
str |
yes |
raw genre tag (case preserved; the |
|
str |
no |
container, e.g. |
|
int |
yes |
file/edition year tag — on reissues/compilations this is the reissue date, not the recording date |
|
int |
yes |
original release year (ID3 |
|
str |
yes |
which year fed |
|
int |
yes |
track number (tag) |
|
int |
no |
bytes |
|
float |
no |
length in seconds |
|
float |
no |
tempo, typical 60–180. Gate on |
|
float |
no |
pre-octave-correction tempo |
|
float |
no |
0–1 trust signal for |
|
float |
yes |
perceptual energy 0–1 |
|
float |
yes |
musical positivity 0–1 |
|
float |
yes |
0–1 |
|
float |
yes |
0–1, absolute scale: electronic ≈ 0.11, acoustic ≈ 0.71 |
|
float |
yes |
0–1, higher = more vocal (harsh/screamed > clean singing > instrumental) |
|
float |
yes |
0–1, exactly |
|
float |
yes |
0–1 |
|
float |
yes |
0–1 heuristic |
|
int |
yes |
coarse energy bucket 1–10 |
|
str |
yes |
e.g. |
|
str |
yes |
Camelot code, e.g. |
|
float |
yes |
0–1 |
|
str |
yes |
most-present chord |
|
float |
yes |
chords per second |
|
str |
yes |
e.g. |
|
float |
yes |
beat-grid detail |
|
float |
no |
onsets per second |
|
float |
no |
integrated loudness |
|
float |
no |
dynamic range |
|
float |
yes |
opt-in loudness |
|
float |
yes |
structure/silence |
|
int |
yes |
number of structural sections |
|
float |
no |
brightness (Hz) |
|
float |
yes |
noisiness 0–1 |
|
float |
no |
timbre proxy |
|
int |
no |
provenance |
|
int |
yes |
provenance |
Dimension + derived nodes¶
Node |
id |
Properties |
|---|---|---|
|
artist name |
|
|
|
|
|
lowercased tag |
|
|
key name |
|
|
band name |
|
|
|
|
|
e.g. |
|
|
|
|
|
label |
|
Edges¶
Edge |
Direction |
Props |
Notes |
|---|---|---|---|
|
|
— |
always for Track |
|
|
— |
only if album tag present |
|
|
— |
only if genre tag present |
|
|
— |
only if key detected |
|
|
— |
always (bpm always present) |
|
|
— |
only if |
|
|
— |
only if a year tag present; uses |
|
|
|
top-10 kNN by audio embedding; directed (A→B ≠ B→A) |
|
|
|
tracks in a similarity community |
|
|
|
the Camelot wheel (72 edges) |
Enrichment additions (after enrich)¶
Running sonagram enrich before build folds Last.fm
data into the same schema: popularity, MBID, and original-album properties on
Track / Artist / Album; extra folksonomy-tag IN_GENRE edges; and
CROWD_SIMILAR edges (weighted Track→Track and source="lastfm"
Artist→Artist) alongside the audio-derived SIMILAR_TO web. A plain build
(no enrichment cache) omits these.
Determinism¶
The mapping is deterministic: the same library scanned twice produces a byte-identical graph — same node ids, same ordering, same canonical digest. That is a tested contract, not an accident; see Determinism.