CoolFace
Datasetpublic

brandburner/startrektng-mega-narrative-kg

Star Trek: The Next Generation - Narrative Knowledge Graph A rich narrative knowledge graph extracted from Star Trek: The Next Generation screenplays using the Fabula pipeline. Contains characters, locations, objects, organizations, events, themes, and conflict arcs with full participation semantics and Graph Gravity importance tiers. Dataset Overview Metric Value Source database startrektng.mega Type Megagraph (cross-season merged) Episodes 177… See the full description on the dataset page: https://huggingface.co/datasets/brandburner/startrektng-mega-narrative-kg.

sourceHugging Facecc-by-sa-4.0updated 15d agoView on Hugging Face
0likes154downloads
Dataset Card

Star Trek: The Next Generation - Narrative Knowledge Graph

A rich narrative knowledge graph extracted from Star Trek: The Next Generation screenplays using the Fabula pipeline. Contains characters, locations, objects, organizations, events, themes, and conflict arcs with full participation semantics and Graph Gravity importance tiers.

Dataset Overview

MetricValue
Source databasestartrektng.mega
TypeMegagraph (cross-season merged)
Episodes177
Seasons merged1, 2, 3, 4, 5, 6, 7
Total nodes50,630
Total edges161,593
Schema version1.2.1
Exported2026-09-12

Entity Breakdown

TypeCount
Act935
Agent2,117
ConflictArc381
Episode177
Event9,333
Location2,521
Object8,354
Organization793
PlotBeat20,286
SceneBoundary5,378
Theme221
Writer134

Graph Gravity Tiers

TierCountDescription
anchor299Main characters / key locations
planet1,102Recurring entities
asteroid12,384Minor / one-off entities

Relationship Types

AFFILIATED_WITH, BELONGS_TO_EPISODE, CALLBACK, CAUSAL, CHARACTER_CONTINUITY, CONTAINS_BEAT, CREDITED_ON, EMOTIONAL_ECHO, ESCALATION, EXEMPLIFIES_THEME, FORESHADOWING, INVOLVED_IN_ARC, INVOLVED_WITH, IN_EVENT, NARRATIVELY_FOLLOWS, OCCURS_IN, OWNS, PARTICIPATED_AS, PART_OF, PART_OF_ACT ... and 6 more

Megagraph vs. Season Datasets

This is a megagraph — a cross-season unified knowledge graph, not a simple concatenation of per-season datasets.

Key differences from individual season datasets:

  • —Unified entity identities: Cross-season entities (recurring characters, locations, organizations) are reconciled through a Global Entity Registry (GER) and assigned new canonical UUIDs. The same character will have a different node_id here than in any individual season dataset.
  • —Distilled descriptions: Entity descriptions may be rewritten during GER reconciliation to reflect a character's full arc rather than a single season's perspective.
  • —Cross-season Graph Gravity: Tier assignments (anchor/planet/asteroid) reflect importance across all 177 episodes. An entity that is "planet" tier in one season may become "anchor" in the megagraph because they recur across multiple seasons.
  • —Season-unique entities preserved: Entities appearing in only one season are transferred with their original UUIDs and properties.
  • —Cross-season relationship topology: The megagraph contains participation and narrative connection patterns that span season boundaries.

For single-season analysis, use the individual season datasets:

For cross-season analysis (character arcs, thematic evolution, entity importance across the full series), use this megagraph.

Files

FileDescription
nodes.parquetAll graph nodes with properties
edges.parquetAll relationships with properties
positions.parquet3D layout coordinates for visualization
meta.jsonDataset metadata and entity counts

Schema

Nodes (nodes.parquet)

ColumnTypeDescription
node_idstringUnique node identifier (UUID)
primary_labelstringNode type (Agent, Location, Event, etc.)
namestringDisplay name
descriptionstringFoundational description
tierstring (nullable)Graph Gravity tier: anchor / planet / asteroid
episode_countint (nullable)Number of distinct episodes entity appears in
first_episode_seqint (nullable)First appearance episode
last_episode_seqint (nullable)Last appearance episode
properties_jsonstringFull node properties as JSON

Edges (edges.parquet)

ColumnTypeDescription
source_node_idstringSource node UUID
target_node_idstringTarget node UUID
relationship_typestringRelationship type (e.g., PARTICIPATED_AS)
properties_jsonstringEdge properties as JSON

All relationship properties are carried verbatim inside properties_json. Notably, PARTICIPATED_AS edges may carry incarnation_identifier (the extractor's free-text label for the identity the character appears under) and, where the persona normalisation pass has run, persona — a controlled value reused verbatim across episodes, absent when the character appears as themselves (schema v1.2.1).

Positions (positions.parquet)

ColumnTypeDescription
node_idstringNode UUID
x, y, zfloat3D coordinates
sizefloatNode size (Graph Gravity weighted)
r, g, bintRGB color by entity type
communityintLouvain community index (seeded, deterministic)
tierstring (nullable)Graph Gravity tier
Layout method (schema ≥ 1.2.0): Coordinates are derived from the entities' semantic text embeddings (UMAP with a fixed seed and PCA initialization), so narratively similar entities sit near each other. Non-embedded nodes (events, scenes, episodes, etc.) are placed at the weighted barycenter of their narrative neighbours. The layout is deterministic: re-exporting an unchanged graph reproduces identical coordinates, and lightly-changed graphs keep comparable layouts. Not comparable with positions published under schema ≤ 1.1.0, which used a non-deterministic node2vec structural embedding. See meta.json → positions for the exact method and coverage stats.

Usage

python
from datasets import load_dataset
import pandas as pd

# Load from HuggingFace
ds = load_dataset("brandburner/startrektng-mega-narrative-kg")

# Or load parquet directly
nodes = pd.read_parquet("nodes.parquet")
edges = pd.read_parquet("edges.parquet")

# Filter to anchor characters
anchors = nodes[(nodes['primary_label'] == 'Agent') & (nodes['tier'] == 'anchor')]

# Build a NetworkX graph
import networkx as nx
G = nx.DiGraph()
for _, n in nodes.iterrows():
    G.add_node(n['node_id'], label=n['primary_label'], name=n['name'])
for _, e in edges.iterrows():
    G.add_edge(e['source_node_id'], e['target_node_id'], type=e['relationship_type'])

Citation

bibtex
@misc{fabula_startrektng_mega,
  title = {Star Trek: The Next Generation Narrative Knowledge Graph},
  author = {Fabula Pipeline},
  year = {2026},
  publisher = {HuggingFace},
  howpublished = {\url{https://huggingface.co/datasets/brandburner/startrektng-mega-narrative-kg}}
}

License

CC BY-SA 4.0