Build a versioned lesson-concept graph that rejects invalid claims and explains every prerequisite path it serves.
Project: publish an evidence-backed lesson knowledge graph
Create the schema
Define lesson and concept entities with immutable IDs, aliases, teaches and requires predicates, allowed source and target types, and a strict prerequisite acyclicity rule. Add claim IDs, effective and recorded times, evidence revision IDs and review status. The claim contract should make a title change harmless and a false merge reversible.
Ingest an adversarial fixture
Include a renamed lesson, two ambiguous “streams” aliases, duplicate claim delivery, an unreviewed extracted edge, a retracted prerequisite and a three-lesson cycle. Resolve identities with context, quarantine schema violations and preserve all accepted claim history. Produce a validation report with exact counts and reasons rather than dropping difficult rows.
Serve bounded answers
Implement direct and two-hop prerequisite lookup against a versioned snapshot. Return lesson IDs, relation path, claim IDs and current evidence revision. Apply a withdrawal gate to retired pages. Compare graph candidate recall with a text-only lesson search on a small judged query set, including a new isolated lesson that needs a fallback.
Submit a release packet
Provide schema, raw fixture, identity decisions, claim ledger, validation output, snapshot manifest, path traces and an error review. Rebuild the historical graph at a prior time and explain why a retracted edge was visible then but not now. A reviewer should reconstruct one served answer from recorded claims and passage versions.
Implementation
def accepted_claims(claim_rows, relation_types):
return [claim for claim in claim_rows
if claim["reviewed"] and relation_types.get(claim["predicate"])
== (claim["subject_type"], claim["object_type"])
and not claim["withdrawn"]]Performance and operating cost
Filtering C claims costs O(C) expected time and O(A) output space for A accepted claims. Indexing, cycle validation and historical snapshots add work, but they make answer paths and corrections reproducible.
Common Mistakes
- Do not publish unreviewed extracted claims as facts.
- Do not erase retracted claim history.
- Do not serve a withdrawn lesson from an old graph snapshot.
