CypherBench: Towards Precise Retrieval over Full-scale Modern Knowledge Graphs in the LLM Era
Paper β’ 2412.18702 β’ Published β’ 8
Error code: StreamingRowsError
Exception: CastError
Message: Couldn't cast
source: string
target: string
relation: string
role: string
degree_distribution: struct<5: int64, 3: int64, 7: int64, 4: int64, 9: int64, 6: int64, 11: int64, 8: int64, 10: int64, 1 (... 119 chars omitted)
child 0, 5: int64
child 1, 3: int64
child 2, 7: int64
child 3, 4: int64
child 4, 9: int64
child 5, 6: int64
child 6, 11: int64
child 7, 8: int64
child 8, 10: int64
child 9, 13: int64
child 10, 17: int64
child 11, 15: int64
child 12, 12: int64
child 13, 14: int64
child 14, 16: int64
child 15, 19: int64
child 16, 20: int64
child 17, 21: int64
child 18, 18: int64
child 19, 22: int64
communities: list<item: struct<community_id: int64, size: int64, top_members: list<item: string>, dominant_genres (... 997 chars omitted)
child 0, item: struct<community_id: int64, size: int64, top_members: list<item: string>, dominant_genres: struct<la (... 985 chars omitted)
child 0, community_id: int64
child 1, size: int64
child 2, top_members: list<item: string>
child 0, item: string
child 3, dominant_genres: struct<latin: int64, dancehall: int64, dance: int64, hip-hop: int64, latino: int64, chicago-house: i (... 893 chars omitted)
child 0, latin: int64
child 1, dancehall: int64
child 2, dance: int64
child 3, hip-hop: int64
child 4, latino: int64
child 5, chicago-house: int64
child 6, detroit-techno: int64
child 7, minimal-techno: int64
...
name: string
top_betweenness: list<item: struct<node_id: string, betweenness: double, name: string>>
child 0, item: struct<node_id: string, betweenness: double, name: string>
child 0, node_id: string
child 1, betweenness: double
child 2, name: string
entity_type_counts: struct<Track: int64, Artist: int64, Album: int64, Genre: int64, Era: int64, AudioCluster: int64>
child 0, Track: int64
child 1, Artist: int64
child 2, Album: int64
child 3, Genre: int64
child 4, Era: int64
child 5, AudioCluster: int64
num_weakly_connected_components: int64
relation_type_counts: struct<PERFORMED_BY: int64, APPEARS_ON: int64, HAS_GENRE: int64, IN_AUDIO_CLUSTER: int64, POPULARITY (... 210 chars omitted)
child 0, PERFORMED_BY: int64
child 1, APPEARS_ON: int64
child 2, HAS_GENRE: int64
child 3, IN_AUDIO_CLUSTER: int64
child 4, POPULARITY_TIER: int64
child 5, ARTIST_GENRE: int64
child 6, SIMILAR_AUDIO: int64
child 7, FEATURED_ON: int64
child 8, COLLABORATED_WITH: int64
child 9, GENRE_CROSSOVER: int64
child 10, RELEASED_BY: int64
child 11, ALBUM_GENRE: int64
child 12, GENRE_RELATED: int64
child 13, CLUSTER_GENRE: int64
top_hubs: list<item: struct<node_id: string, degree: int64, entity_type: string, name: string>>
child 0, item: struct<node_id: string, degree: int64, entity_type: string, name: string>
child 0, node_id: string
child 1, degree: int64
child 2, entity_type: string
child 3, name: string
max_degree: int64
to
{'entity_type_counts': {'Track': Value('int64'), 'Artist': Value('int64'), 'Album': Value('int64'), 'Genre': Value('int64'), 'Era': Value('int64'), 'AudioCluster': Value('int64')}, 'relation_type_counts': {'PERFORMED_BY': Value('int64'), 'APPEARS_ON': Value('int64'), 'HAS_GENRE': Value('int64'), 'IN_AUDIO_CLUSTER': Value('int64'), 'POPULARITY_TIER': Value('int64'), 'ARTIST_GENRE': Value('int64'), 'SIMILAR_AUDIO': Value('int64'), 'FEATURED_ON': Value('int64'), 'COLLABORATED_WITH': Value('int64'), 'GENRE_CROSSOVER': Value('int64'), 'RELEASED_BY': Value('int64'), 'ALBUM_GENRE': Value('int64'), 'GENRE_RELATED': Value('int64'), 'CLUSTER_GENRE': Value('int64')}, 'total_nodes': Value('int64'), 'total_edges': Value('int64'), 'density': Value('float64'), 'avg_degree': Value('float64'), 'max_degree': Value('int64'), 'degree_distribution': {'5': Value('int64'), '3': Value('int64'), '7': Value('int64'), '4': Value('int64'), '9': Value('int64'), '6': Value('int64'), '11': Value('int64'), '8': Value('int64'), '10': Value('int64'), '13': Value('int64'), '17': Value('int64'), '15': Value('int64'), '12': Value('int64'), '14': Value('int64'), '16': Value('int64'), '19': Value('int64'), '20': Value('int64'), '21': Value('int64'), '18': Value('int64'), '22': Value('int64')}, 'top_hubs': List({'node_id': Value('string'), 'degree': Value('int64'), 'entity_type': Value('string'), 'name': Value('string')}), 'num_artist_communities': Value('int64'), 'communities': List({'community_id': Value('int64')
...
64'), 'progressive-house': Value('int64'), 'edm': Value('int64'), 'trance': Value('int64'), 'happy': Value('int64'), 'drum-and-bass': Value('int64'), 'hardstyle': Value('int64'), 'breakbeat': Value('int64'), 'pop-film': Value('int64'), 'indian': Value('int64'), 'k-pop': Value('int64'), 'folk': Value('int64'), 'party': Value('int64'), 'j-idol': Value('int64'), 'power-pop': Value('int64'), 'alt-rock': Value('int64'), 'punk-rock': Value('int64'), 'cantopop': Value('int64'), 'acoustic': Value('int64'), 'mandopop': Value('int64'), 'show-tunes': Value('int64'), 'dub': Value('int64'), 'heavy-metal': Value('int64'), 'metalcore': Value('int64'), 'death-metal': Value('int64'), 'dubstep': Value('int64'), 'pagode': Value('int64'), 'forro': Value('int64'), 'sertanejo': Value('int64'), 'samba': Value('int64'), 'mpb': Value('int64'), 'funk': Value('int64'), 'brazil': Value('int64'), 'j-dance': Value('int64'), 'turkish': Value('int64'), 'world-music': Value('int64'), 'gospel': Value('int64'), 'groove': Value('int64'), 'salsa': Value('int64'), 'honky-tonk': Value('int64'), 'children': Value('int64'), 'kids': Value('int64'), 'afrobeat': Value('int64'), 'tango': Value('int64'), 'jazz': Value('int64'), 'blues': Value('int64')}}), 'top_betweenness': List({'node_id': Value('string'), 'betweenness': Value('float64'), 'name': Value('string')}), 'top_pagerank': List({'node_id': Value('string'), 'pagerank': Value('float64'), 'name': Value('string')}), 'num_weakly_connected_components': Value('int64')}
because column names don't match
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 99, in get_rows_or_raise
return get_rows(
^^^^^^^^^
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/utils.py", line 77, in get_rows
rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2690, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2227, in __iter__
for key, pa_table in self._iter_arrow():
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2251, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 494, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 384, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 295, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 128, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2321, in table_cast
return cast_table_to_schema(table, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2249, in cast_table_to_schema
raise CastError(
datasets.table.CastError: Couldn't cast
source: string
target: string
relation: string
role: string
degree_distribution: struct<5: int64, 3: int64, 7: int64, 4: int64, 9: int64, 6: int64, 11: int64, 8: int64, 10: int64, 1 (... 119 chars omitted)
child 0, 5: int64
child 1, 3: int64
child 2, 7: int64
child 3, 4: int64
child 4, 9: int64
child 5, 6: int64
child 6, 11: int64
child 7, 8: int64
child 8, 10: int64
child 9, 13: int64
child 10, 17: int64
child 11, 15: int64
child 12, 12: int64
child 13, 14: int64
child 14, 16: int64
child 15, 19: int64
child 16, 20: int64
child 17, 21: int64
child 18, 18: int64
child 19, 22: int64
communities: list<item: struct<community_id: int64, size: int64, top_members: list<item: string>, dominant_genres (... 997 chars omitted)
child 0, item: struct<community_id: int64, size: int64, top_members: list<item: string>, dominant_genres: struct<la (... 985 chars omitted)
child 0, community_id: int64
child 1, size: int64
child 2, top_members: list<item: string>
child 0, item: string
child 3, dominant_genres: struct<latin: int64, dancehall: int64, dance: int64, hip-hop: int64, latino: int64, chicago-house: i (... 893 chars omitted)
child 0, latin: int64
child 1, dancehall: int64
child 2, dance: int64
child 3, hip-hop: int64
child 4, latino: int64
child 5, chicago-house: int64
child 6, detroit-techno: int64
child 7, minimal-techno: int64
...
name: string
top_betweenness: list<item: struct<node_id: string, betweenness: double, name: string>>
child 0, item: struct<node_id: string, betweenness: double, name: string>
child 0, node_id: string
child 1, betweenness: double
child 2, name: string
entity_type_counts: struct<Track: int64, Artist: int64, Album: int64, Genre: int64, Era: int64, AudioCluster: int64>
child 0, Track: int64
child 1, Artist: int64
child 2, Album: int64
child 3, Genre: int64
child 4, Era: int64
child 5, AudioCluster: int64
num_weakly_connected_components: int64
relation_type_counts: struct<PERFORMED_BY: int64, APPEARS_ON: int64, HAS_GENRE: int64, IN_AUDIO_CLUSTER: int64, POPULARITY (... 210 chars omitted)
child 0, PERFORMED_BY: int64
child 1, APPEARS_ON: int64
child 2, HAS_GENRE: int64
child 3, IN_AUDIO_CLUSTER: int64
child 4, POPULARITY_TIER: int64
child 5, ARTIST_GENRE: int64
child 6, SIMILAR_AUDIO: int64
child 7, FEATURED_ON: int64
child 8, COLLABORATED_WITH: int64
child 9, GENRE_CROSSOVER: int64
child 10, RELEASED_BY: int64
child 11, ALBUM_GENRE: int64
child 12, GENRE_RELATED: int64
child 13, CLUSTER_GENRE: int64
top_hubs: list<item: struct<node_id: string, degree: int64, entity_type: string, name: string>>
child 0, item: struct<node_id: string, degree: int64, entity_type: string, name: string>
child 0, node_id: string
child 1, degree: int64
child 2, entity_type: string
child 3, name: string
max_degree: int64
to
{'entity_type_counts': {'Track': Value('int64'), 'Artist': Value('int64'), 'Album': Value('int64'), 'Genre': Value('int64'), 'Era': Value('int64'), 'AudioCluster': Value('int64')}, 'relation_type_counts': {'PERFORMED_BY': Value('int64'), 'APPEARS_ON': Value('int64'), 'HAS_GENRE': Value('int64'), 'IN_AUDIO_CLUSTER': Value('int64'), 'POPULARITY_TIER': Value('int64'), 'ARTIST_GENRE': Value('int64'), 'SIMILAR_AUDIO': Value('int64'), 'FEATURED_ON': Value('int64'), 'COLLABORATED_WITH': Value('int64'), 'GENRE_CROSSOVER': Value('int64'), 'RELEASED_BY': Value('int64'), 'ALBUM_GENRE': Value('int64'), 'GENRE_RELATED': Value('int64'), 'CLUSTER_GENRE': Value('int64')}, 'total_nodes': Value('int64'), 'total_edges': Value('int64'), 'density': Value('float64'), 'avg_degree': Value('float64'), 'max_degree': Value('int64'), 'degree_distribution': {'5': Value('int64'), '3': Value('int64'), '7': Value('int64'), '4': Value('int64'), '9': Value('int64'), '6': Value('int64'), '11': Value('int64'), '8': Value('int64'), '10': Value('int64'), '13': Value('int64'), '17': Value('int64'), '15': Value('int64'), '12': Value('int64'), '14': Value('int64'), '16': Value('int64'), '19': Value('int64'), '20': Value('int64'), '21': Value('int64'), '18': Value('int64'), '22': Value('int64')}, 'top_hubs': List({'node_id': Value('string'), 'degree': Value('int64'), 'entity_type': Value('string'), 'name': Value('string')}), 'num_artist_communities': Value('int64'), 'communities': List({'community_id': Value('int64')
...
64'), 'progressive-house': Value('int64'), 'edm': Value('int64'), 'trance': Value('int64'), 'happy': Value('int64'), 'drum-and-bass': Value('int64'), 'hardstyle': Value('int64'), 'breakbeat': Value('int64'), 'pop-film': Value('int64'), 'indian': Value('int64'), 'k-pop': Value('int64'), 'folk': Value('int64'), 'party': Value('int64'), 'j-idol': Value('int64'), 'power-pop': Value('int64'), 'alt-rock': Value('int64'), 'punk-rock': Value('int64'), 'cantopop': Value('int64'), 'acoustic': Value('int64'), 'mandopop': Value('int64'), 'show-tunes': Value('int64'), 'dub': Value('int64'), 'heavy-metal': Value('int64'), 'metalcore': Value('int64'), 'death-metal': Value('int64'), 'dubstep': Value('int64'), 'pagode': Value('int64'), 'forro': Value('int64'), 'sertanejo': Value('int64'), 'samba': Value('int64'), 'mpb': Value('int64'), 'funk': Value('int64'), 'brazil': Value('int64'), 'j-dance': Value('int64'), 'turkish': Value('int64'), 'world-music': Value('int64'), 'gospel': Value('int64'), 'groove': Value('int64'), 'salsa': Value('int64'), 'honky-tonk': Value('int64'), 'children': Value('int64'), 'kids': Value('int64'), 'afrobeat': Value('int64'), 'tango': Value('int64'), 'jazz': Value('int64'), 'blues': Value('int64')}}), 'top_betweenness': List({'node_id': Value('string'), 'betweenness': Value('float64'), 'name': Value('string')}), 'top_pagerank': List({'node_id': Value('string'), 'pagerank': Value('float64'), 'name': Value('string')}), 'num_weakly_connected_components': Value('int64')}
because column names don't matchNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
A richly structured Heterogeneous Knowledge Graph mapping the interconnected music universe with 166,330 nodes, 759,236 edges, 6 entity types, and 16 relation types.
| Metric | Value |
|---|---|
| Total Nodes | 166,330 |
| Total Edges | 759,236 |
| Entity Types | 6 (Artist, Track, Album, Genre, AudioCluster, Era) |
| Relation Types | 16 |
| Artist Communities | 1,341 (Louvain) |
| Graph Density | 0.000027 |
| Type | Count | Ontology Reference |
|---|---|---|
| π€ Artist | 29,858 | mo:MusicArtist / MusicBrainz:Artist |
| π΅ Track | 89,740 | mo:Track / MusicBrainz:Recording |
| πΏ Album | 46,589 | mo:Record / MusicBrainz:Release |
| π Genre | 113 | MusicBrainz:Genre / Wikidata:P136 |
| π AudioCluster | 25 | Derived (K-Means on audio features) |
| π Era | 5 | Derived (popularity tiers) |
| Relation | Source β Target | Count |
|---|---|---|
| PERFORMED_BY | Track β Artist | 123,424 |
| APPEARS_ON | Track β Album | 89,740 |
| HAS_GENRE | Track β Genre | 89,740 |
| IN_AUDIO_CLUSTER | Track β AudioCluster | 89,740 |
| POPULARITY_TIER | Track β Era | 89,740 |
| RELEASED_BY | Album β Artist | 85,490 |
| ALBUM_GENRE | Album β Genre | 46,589 |
| COLLABORATED_WITH | Artist β Artist | 38,684 |
| SIMILAR_AUDIO | Artist β Artist | 37,939 |
| FEATURED_ON | Artist β Track | 33,684 |
| ARTIST_GENRE | Artist β Genre | 32,243 |
| GENRE_CROSSOVER | Artist β Genre | 2,733 |
| GENRE_RELATED | Genre β Genre | 537 |
| CLUSTER_GENRE | AudioCluster β Genre | 75 |
| File | Format | Description |
|---|---|---|
data/nodes.jsonl |
JSONL | All 166K nodes with properties |
data/edges.jsonl |
JSONL | All 759K edges with relation types and properties |
data/triples.tsv |
TSV | (subject, predicate, object) triple format |
data/schema.json |
JSON | Full schema with entity/relation type definitions |
data/analytics_report.json |
JSON | Graph analytics, communities, centrality |
data/graph.pkl |
Pickle | NetworkX DiGraph for direct Python loading |
data/REPORT.md |
Markdown | Comprehensive analysis report |
import pickle
import networkx as nx
# Load the full graph
from huggingface_hub import hf_hub_download
path = hf_hub_download("Jaiminshahh/music-universe-hkg", "data/graph.pkl", repo_type="dataset")
with open(path, "rb") as f:
G = pickle.load(f)
print(f"Nodes: {G.number_of_nodes()}, Edges: {G.number_of_edges()}")
# Find all collaborators of an artist
artist_node = [n for n, d in G.nodes(data=True) if d.get("name") == "Armin van Buuren"][0]
collabs = [(G.nodes[v].get("name"), d.get("track_count"))
for _, v, d in G.out_edges(artist_node, data=True)
if d.get("relation") == "COLLABORATED_WITH"]
# Get genre landscape
genre_edges = [(G.nodes[u].get("name"), G.nodes[v].get("name"), d.get("jaccard_similarity"))
for u, v, d in G.edges(data=True) if d.get("relation") == "GENRE_RELATED"]
Explore this graph interactively: Music Universe HKG Explorer Space
Built from maharshipandya/spotify-tracks-dataset with derived relationships computed via collaboration analysis, audio feature similarity (cosine), genre co-occurrence (Jaccard), and K-Means clustering.