When it comes to [[Tabular Data]], the standard minimal storage using plaintext is the almighty [[CSV]] file. When it comes to non-tabular data, the closest analog is probably [[JSON]]. JSON works very well for hierarchical data.
There is no "obvious standard" for representing [[Graph]]s with [[Plain Text Durability|plaintext]]. This is partly because "graph data" isn't really used for *one* thing - it's used for several [[Similar-but-Different]] things, each of which lends itself more naturally to different [[Data Serialization Methods]] for graph data.
Each of these examples represents this:
![[Plaintext Graph Data 2026-02-07 13.07.42.excalidraw.svg]]
%%[[Plaintext Graph Data 2026-02-07 13.07.42.excalidraw.md|🖋 Edit in Excalidraw]]%%
See the
## JSON-based
```json
nodes: [
{id:"A"},
{id:"B"},
{id:"C"}
],
edges: [
{from:"A", to: "B"},
{from:"B", to: "C"}
]
```
The main way I've seen graph data represented "in the wild". This is how [[Obsidian Canvas]] works. It's good for associating properties with nodes and edges. **I'd use JSON by default**, unless there was some reason not to.
It's incredibly flexible, which is its strength, but also its weakness. Tooling cannot *assume* really anything about the structure of the JSON, and thus you can't build much onto it.
### [[JSON-LD]]
Under the JSON umbrella would be the approach for **linked data** called [[JSON-LD]]. This is essentially a more constrained version of JSON that uses a more standardized structure & schema that lets it be [[Data Merging|Merged]] more easily across sources.
![[Untitled 45.jpeg]]
## [[Turtle]]
```turtle
:A :knows :B .
:B :knows :C .
```
Turtle is short for *terse RDF triple language*. It's an [[Resource Description Framework|RDF]] language, used for [[Ontology Language|representing ontologies]]. It's great for saying Entity 1 and Entity 2 have a specific kind of relationship. It's not as easy to specify additional *properties* of the entities or the relationship between them, though. You can do it, but it's awkward. You essentially [[Reify]] the concept of "exhibits_property" and promote things like numbers and dates to being their own form of entity. This sort of mixing of entities and properties feels clunky.
### Turtle for Properties
```turtle
:Aaron :has_car :My_Car
:My_Car :exhibits_color :White
:My_Car :manufactured_in_year :2022
```
## Edge List (aka Adjacency Matrix)
```plaintext
A B
B C
```
Probably the **most CSV-like** entry in this list, an edge list is literally just [[Tuple]]s separated by new lines. In so doing, it's incredibly limited in its expressive scope.
## [[DOT Language]]
```DOT
graph my_graph{
A -> B,
B -> C,
}
```
DOT Language is designed to be the standard for *drawing* graphs. It's supported by [[PlantUML]], but apparently **not [[Mermaid JS]]**.
### DOT with Attributes
```DOT
graph graphname {
size="1,1";
a [label="Foo"];
b [shape=box];
a -- b -- c [color=blue];
b -- d [style=dotted];
}
```
Once you start adding attributes in, it pretty quickly loses its simplicity. The example above includes properties detailing how the graph should *look*, but in theory they could be done other ways.
## GraphML
```xml
<node id="A"/>
<node id="B"/>
<node id="C"/>
<edge source="A" target="B"/>
<edge source="B" target="C"/>
```
GraphML is an [[XML]]-based method. Like all XML things, I don't like it.
## Aspen
```aspen
default Person, name
default_attribute Employer, company_name
reciprocal knows, is friends with
# Write out the narrative data
(Matt) [is friends with] (Brianna).
(Eliza) [knows] (Brianna).
(Matt) [is friends with] (Eliza).
(Matt) [works for] (Employer, UMass Boston).
```
> [!warning] Aspen is, I think, **dead**.
[Its Github](https://github.com/thepeergroup/aspen) hasn't been touched in 5 years, but it looked promising. Aspen is bill itself as "like [[Markdown]], but for graph data". It's a slightly-more readable plaintext alternative to [[Cypher]], used by [[Neo4j]]. I like the "it reads like plain english" aspect to it.
# ChatGPT's Excellent Summarization
This is one of the best responses I've seen from ChatGPT.
> Excel works because:
> - Rows are entities
> - Columns are attributes
> - The projection is obvious
>
> Graphs do not have:
> - A canonical “row”
> - A stable grain
> - A privileged traversal
>
> Every graph format bakes in an answer to:
> “What is the primary thing here?”
>
> And different communities answer that differently:
> - Edge
> - Node
> - Triple
> - Path
> - Predicate
>
> So instead of one CSV, you get five half-winners.
****
# More
## Source
- Chat with ChatGPT
- https://en.wikipedia.org/wiki/DOT_(graph_description_language)
- https://www.graphviz.org/doc/info/lang.html
- [https://aspen-lang.org](https://aspen-lang.org/)