Building a Curriculum-Aligned Knowledge Graph for K–12 Math and English

Explore a static, open-source K–12 learning graph with 1,244 topics, 5,123 questions, prerequisite tracing, and adaptive diagnostics—with important caveats about AI-generated content.

A learner who gets a question wrong may not have forgotten the topic being tested. The gap could be several steps earlier: factoring a quadratic might depend on understanding perfect-square identities, while a high-school function concept may rely on ideas introduced in middle school. A useful diagnostic therefore needs more than a score. It needs a model of how concepts depend on one another—and a way to follow those dependencies back to their roots.

That is the problem cn-math-taxonomy sets out to address. The repository combines a curriculum-oriented knowledge graph with question banks and a browser-based adaptive diagnostic tool. Its current dataset contains 1,244 formal knowledge points, 1,877 prerequisite edges, 382 curriculum-standard entries, and 5,123 questions across mathematics and English.

What the graph covers

The project’s mathematics graph spans primary school through high school: grades 1–6, grades 7–9, the two required high-school mathematics volumes, and three selective-required volumes. The high-school material uses the People’s Education Press A edition (2019). English is a separate graph, covering primary grades 3–6 and middle-school grades 7–9.

The counts break down as follows:

Subject and level Topics Prerequisite edges Questions
Primary mathematics 216 311 internal 864
Middle-school mathematics 315 563 internal 1,407
High-school required mathematics 143 196 total, including cross-level links 572
High-school selective-required mathematics 128 194 total, including cross-module links 512
Primary English 197 236 788
Middle-school English 245 342 980

The full mathematics graph has 802 topics and 1,299 edges. English contributes 442 topics and 578 edges. Across both subjects, the graph contains 1,877 edges: 1,279 hard and 598 soft.

These labels distinguish different kinds of prerequisites. A hard edge means the learner is unlikely to study the target successfully without the prerequisite. A soft edge means the earlier concept is useful, but not an absolute gate. For example, a genuinely required algebraic skill may be hard, while a suggested ordering based on textbook sequence may be soft.

The distinction matters for diagnostics: treating every earlier topic as mandatory can produce a bloated remediation path. Treating every relationship as optional, on the other hand, can hide the source of a real learning gap.

From a wrong answer to a learning path

The diagnostic tool uses those edges to decide what to ask next. Start from a topic or a whole chapter. If the learner answers the first question correctly, the tool marks the topic mastered and skips its ancestors. If the learner answers incorrectly, it asks a second question at the same or an easier level. A second correct answer marks the topic “unstable” without tracing farther back; two incorrect answers mark it as weak and trigger prerequisite tracing, checking hard prerequisites before soft ones.

The result is more actionable than a single percentage: it can show weak root concepts, topics that appear unstable, and a learning path ordered from earlier grades to later ones. The tool also displays related curriculum-standard entries and a graph of the path. Results can be saved locally, exported as JSON, printed, or turned into a shareable image.

For example, a learner struggling with completing the square can be traced back toward the perfect-square formula. A high-school function target can lead through middle-school quadratic-function concepts. This is the central idea behind the project: diagnose a likely cause, not just record an incorrect answer.

Inspecting the data and running the demo

The repository keeps its core data in plain JSON arrays:

  • data/topics.json stores topic names, domains, descriptions, mastery criteria, diagnostic questions, and standard mappings.
  • data/dependencies.json stores prerequisite relationships, their strength, and a short rationale.
  • data/questions.json contains the question banks.
  • data/cn-curriculum-standards.json contains 382 standard entries: 310 mathematics and 72 English.

A topic record includes fields such as id, name, domain, grade, chapter, type, mastery_criteria, and diagnostic_question. A dependency has the form:

{
  "topicId": "cnm_221",
  "prerequisiteId": "cnm_p042",
  "strength": "hard",
  "reason": "This concept uses the earlier skill directly."
}

The graph stores direct prerequisites and applies transitive reduction to newly added edges, so it can avoid repeating relationships already implied by a nearer prerequisite path. Existing middle-school mathematics edges were deliberately left unchanged during later additions.

The site is static, but its pages fetch JSON data, so open it through a local web server rather than file://:

python3 -m http.server 8000

Then visit http://localhost:8000/ for the home page, http://localhost:8000/explore/ for the graph, or http://localhost:8000/diagnose/ for diagnostics. A demo target is available at http://localhost:8000/diagnose/?target=cnm_221&demo=1.

Validation and engine tests can be run locally:

python3 scripts/validate.py
node tests/test_engine.js

The validator checks JSON validity, unique IDs, required fields, valid edge endpoints, duplicate edges, cycles, isolated nodes, and standard references. Setting STRICT_STANDARDS=1 makes missing standard mappings an error rather than a warning. The diagnostic engine is implemented as dependency-free JavaScript that runs in both the browser and Node.

Treat it as a research prototype, not a ready-made assessment

The repository is unusually explicit about its limitations—and that caution should shape how developers use it. The content is an AI-generated first draft and has not been reviewed by teachers. Topic granularity, mastery criteria, answer quality, and especially the existence and strength of prerequisite links need expert review before the graph is used for instruction or automated learning recommendations.

Verification coverage also varies. Primary- and middle-school mathematics questions received automated checks, and middle-school mathematics had an independent second-pass review. Primary English and high-school mathematics questions have automated verification, but their answers were not independently blind-solved; the verification expression and answer may come from the same generation path. English questions and curriculum mappings are not teacher-reviewed. English items exclude listening and speaking.

Curriculum alignment is not the same as official certification. Some standard entries are public paraphrases, marked verbatim: false and “待核” (“needs verification”). Several textbook chapter lists rely on third-party sources rather than an official publisher catalog. In particular, parts of the primary-school and high-school mappings, and the projected grade-nine lower-volume mathematics contents, are explicitly provisional. The repository also warns that high-school grade labels are organizational: the required second volume is labeled as grade 11 in the tool even though it is commonly taught in the second semester of grade 10.

The question bank is small by assessment standards: most topics have four questions, and the diagnostic asks at most two per topic. There is no student response data to calibrate difficulty, distractors, or diagnostic accuracy. The tool can help explore a curriculum graph and generate hypotheses about gaps; it cannot replace a teacher, a validated exam, or a complete measurement of mastery.

A useful foundation for review and experimentation

Despite those caveats, the repository offers developers a concrete, inspectable example of representing a curriculum as data: concepts become nodes, dependencies become typed edges, standards become mappings, and diagnostic behavior becomes a testable algorithm. It also supports two subject-specific graphs without linking English and mathematics, while allowing middle-school English prerequisites to point back to primary English.

The project is released under CC BY-NC 4.0 for the data, tool, and documentation. Personal learning, teaching, research, modification, and redistribution are permitted with attribution; commercial use requires separate permission. Vendored Cytoscape-related libraries retain their own MIT licenses.

For developers working on learning analytics, curriculum tooling, or educational RAG and graph systems, the most valuable next step is not to add more generated nodes. It is to audit the existing edges and questions with teachers, verify standards against official documents, and eventually test the diagnostic against real learner data. A graph becomes educationally useful not when it is large, but when its relationships and conclusions are trustworthy.

Source

xiaoyang111222/cn-math-taxonomy: 中小学知识图谱 + 前置诊断:数学(一–九年级、高中必修与选择性必修)+ 英语(小学、初中),课标对齐、人教版,1244 知识点、5123 题、自适应诊断