Modeling a Classical Chinese Novel as a Knowledge Graph: Data, Ontology, and One 4.4 MB HTML
Domain knowledge graphs rarely have to model fictional timelines and debated geography; this project shows a workable approach by flagging 42 of 71 dates as estimated, marking disputed map points as dashed lines, and packing the entire dataset into a single offline-capable HTML file.
The project, built by a developer who goes by wangweilong334, takes the Jiaxu edition with Zhiyanzhai commentary as its base text and extracts 623,645 characters of body text plus 5,634 commentary entries across 80 chapters. All structured data lives in a JSON file with 115 people, 54 places, 51 events, 163 relations, and 71 day records. The ontology layer follows classic TBox/ABox design: 7 top-level classes and 22 subclasses, with 21 object properties linking people, events, and places. Parsing the accompanying Turtle file yields 3,428 RDF triples.
Time is handled by anchoring to a fictional 'Red Chamber Year 1' and mapping lunar dates and two-hour watch markers to numeric values; 42 of the 71 day records carry an 'estimated' flag. Geography uses modern provincial boundaries as a base, with disputed locations drawn as dashed lines and labeled as conjectural. The final deliverable is a single 4.4 MB index.html with all data, 255 base64-embedded illustrations, and no external URLs, so it opens by double-clicking and works offline.
The gap between the 3,311 triples displayed in the graph and the 3,428 parsed from the Turtle file shows that UI counts and data counts can diverge; the author exposes that discrepancy instead of smoothing it over.
Marking inferred dates and disputed map locations as 'estimated' or 'doubtful' keeps a humanities dataset honest when it becomes machine-readable; without those flags, graph queries would treat speculation as fact.
Choosing a single self-contained HTML file trades initial size for zero-friction distribution and offline availability, a practical pattern for archival or teaching tools.