CSV-to-JSON Record Mapper
Run the CSV-to-JSON Record Mapper MicroSim Fullscreen
About This MicroSim
learning-graph.csv opens with the header ConceptID,ConceptLabel,Dependencies,TaxonomyID.
This MicroSim takes one row under that header — the sample is 6,Learning Graph,5|4,FOUND —
and shows, four clicks at a time, exactly what csv-to-json.py turns it into.
The transformation mirrors this project's real script:
1 2 3 4 5 | |
So the sample row produces one node record and two edge records:
1 2 3 4 | |
The asymmetry worth noticing
Three of the four CSV fields map one-to-one onto a JSON key. Dependencies does not.
CSV has no list type. Every cell holds exactly one value — so when a concept depends on two
prior concepts, the pipe character has to carry the structure that the format itself cannot:
5|4 is two ConceptIDs packed into one cell. Splitting it is what produces two edge records
from one row, and it is why the chapter's record table says a row yields zero or more edge
records rather than exactly one.
That is the whole reason this step is worth a click of its own. Try 1,Concept,,FOUND — a real
row from this book's own CSV — in the input box: an empty Dependencies cell produces a node and
no edges at all.
How to Use
- Next Step reveals one field's transformation at a time, in four steps: ConceptID →
id, ConceptLabel →label, Dependencies → edge records, TaxonomyID →group. - Each CSV field carries a color, and the JSON key it becomes carries the same color. A dashed arrow connects the field to the key on the step it fires.
- Watch step 3 closely: the pipe turns red, and the single Dependencies cell fans out into one edge record per value.
- Try your own row with the input box. It does the same comma-split and pipe-split the real script does. Predict the output before you press Transform — that prediction is the point.
Rows worth trying: 1,Concept,,FOUND (no dependencies), 12,Readiness Estimation,9|7|3,LEARN
(three dependencies, three edges).
Iframe Embed Code
You can add this MicroSim to any web page by adding this to your HTML:
1 2 3 4 | |
Lesson Plan
Audience
Instructional designers, curriculum developers, and educational technologists working with concept dependency graphs.
Duration
10–15 minutes
Prerequisites
Learners need CSV, CSV Header, Pipe-Delimited Field, Node Record, and Edge Record from Chapter 26. No ability to read Python is required.
Activities
- Trace the sample (4 min): Step through all four steps of
6,Learning Graph,5|4,FOUND. At each step, have learners name the JSON key the field will become before clicking. - Predict an unseen row (5 min): Give learners
12,Readiness Estimation,9|7|3,LEARNon paper and ask them to write the complete JSON output. Then type it in and check. The common miss is producing one edge record instead of three. - The empty cell (4 min): Ask what
1,Concept,,FOUNDproduces. Most learners expect an edge with an emptyto. It produces none. Discuss why "zero or more" is the correct cardinality in the chapter's record table.
Assessment
Learners can:
- Name which JSON key each CSV field becomes.
- Predict the complete JSON output for an unseen CSV row, including the correct edge count.
- Explain why one row can produce several edge records but only ever one node record.
- Explain what the pipe character is doing and why CSV needs it.
Related Concepts
- CSV Header — the four column names this mapping depends on
- Pipe-Delimited Field — the
5|4cell, and why CSV needs it - Node Record — one per row, always
- Edge Record — zero or more per row, one per dependency
- Group Record — generated once per distinct TaxonomyID across the whole file, not per row
- JSON Serialization — the final
json.dump()that writes these records to disk
References
- Chapter 26: Data Pipeline Internals - The chapter this MicroSim supports.
- Chapter 5: Graph Quality, Validation, and File Formats - Where CSV and JSON are first named.
- Comma-separated values - The format, and its lack of any list type.
- JSON - The target format, which does have arrays and objects.
- Delimiter - Why a secondary delimiter like the pipe is needed inside a delimited field.