<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: William Hsu</title>
    <description>The latest articles on DEV Community by William Hsu (@williamhsu).</description>
    <link>https://dev.to/williamhsu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4283217%2F5dc0ee85-1781-4cde-af99-c2a7ebc117e5.png</url>
      <title>DEV Community: William Hsu</title>
      <link>https://dev.to/williamhsu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/williamhsu"/>
    <language>en</language>
    <item>
      <title>Writing an open standard for genograms</title>
      <dc:creator>William Hsu</dc:creator>
      <pubDate>Fri, 04 Dec 2026 16:45:35 +0000</pubDate>
      <link>https://dev.to/williamhsu/writing-an-open-standard-for-genograms-2a3h</link>
      <guid>https://dev.to/williamhsu/writing-an-open-standard-for-genograms-2a3h</guid>
      <description>&lt;p&gt;A genogram is a family diagram with a clinical layer. Squares and circles for people, lines for marriages and children, and then more lines and shadings for what a family tree leaves out: who is close, who is cut off, who drinks, who had depression, who lived in which household. Family therapists, social workers, nurses and genetic counsellors draw them by hand, in Visio, or in one of a handful of apps.&lt;/p&gt;

&lt;p&gt;The conventions are well established in the clinical literature (most people learn them from McGoldrick, Gerson and Petry's &lt;em&gt;Genograms: Assessment and Treatment&lt;/em&gt;), but they were never written down in a form software could use. There are no symbol ids and no file format, so every tool picks its own shapes and its own data model, and a chart drawn in one tool cannot be opened in another.&lt;/p&gt;

&lt;p&gt;Open Genogram Notation (OGN) is my attempt to write that missing layer down. This post covers the design decisions, with code from the repository.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/GenogramAI/open-genogram-notation" rel="noopener noreferrer"&gt;https://github.com/GenogramAI/open-genogram-notation&lt;/a&gt;&lt;br&gt;
Spec with pictures: &lt;a href="https://genogramai.com/notation" rel="noopener noreferrer"&gt;https://genogramai.com/notation&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Stable ids first
&lt;/h3&gt;

&lt;p&gt;Everything in the standard hangs off a symbol id: &lt;code&gt;person-female&lt;/code&gt;, &lt;code&gt;relationship-divorce&lt;/code&gt;, &lt;code&gt;child-adopted&lt;/code&gt;, &lt;code&gt;emotional-cutoff&lt;/code&gt;, &lt;code&gt;medical-shading-substance&lt;/code&gt;. There are 177 of them in 17 categories, each with a name, a meaning, a drawing rule, a "when to use" note and a standalone SVG.&lt;/p&gt;

&lt;p&gt;The ids are the contract. The versioning rules in the spec say a published id never changes meaning and is never reused. A symbol that should no longer be drawn is marked &lt;code&gt;legacy: true&lt;/code&gt; and stays valid in documents. Changing what an id means, or removing one, needs a 2.0 at a new permalink. Renderers may change stroke weight or spacing, but not meaning. That separation is what lets the drawings improve (the 1.0.x point releases so far are all drawing fixes) without breaking anyone's files.&lt;/p&gt;

&lt;p&gt;The dataset ships as one JSON file, &lt;code&gt;dist/genogram-symbols.json&lt;/code&gt;, and as SVG files, a sprite (&lt;code&gt;#ogn-&amp;lt;id&amp;gt;&lt;/code&gt;), and libraries for draw.io, Excalidraw, PowerPoint and Visio. A monochrome build of 148 icons in Iconify's JSON format is in &lt;code&gt;icons/&lt;/code&gt;, and inclusion in the Iconify collection is requested.&lt;/p&gt;
&lt;h3&gt;
  
  
  Two conformance levels
&lt;/h3&gt;

&lt;p&gt;Clinical practice is split between people who want the classic notation and people who need more: intersex and nonbinary people, donor and surrogate conception, life partners who never married, colour-coded medical categories. One flat list would force a choice. OGN has two levels instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Core&lt;/strong&gt; (56 symbols): the classic conventions. A chart is Core-conformant when every symbol it draws is Core, drawn as specified, and it follows the layout, accessibility and key rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extended&lt;/strong&gt; (121 symbols): Core plus the newer additions. Every Extended symbol used must appear in the chart's key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each symbol in the dataset carries &lt;code&gt;"notation": "standard"&lt;/code&gt; or &lt;code&gt;"notation": "extended"&lt;/code&gt;, so a tool can offer a Core-only palette with a one-line filter.&lt;/p&gt;
&lt;h3&gt;
  
  
  Genogram JSON 1.0
&lt;/h3&gt;

&lt;p&gt;A whole genogram is one JSON document. Every symbol field holds an id from the dataset. Here is the minimal example from the README:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://genogramai.com/schemas/genogram/v1.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"format"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"genogram-json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"indexPerson"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"people"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Ana"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"symbol"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"person-female"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"b"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Ben"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"symbol"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"person-male"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Cam"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"symbol"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"person-male"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"birth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1998"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"partnerships"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"partners"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"b"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"relationship-marriage"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"children"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"child"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"parents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"b"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few choices worth explaining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A partnership is one record with events.&lt;/strong&gt; A couple that married, divorced and remarried is one partnership with dated &lt;code&gt;events&lt;/code&gt; (&lt;code&gt;married&lt;/code&gt;, &lt;code&gt;divorced&lt;/code&gt;, &lt;code&gt;remarried&lt;/code&gt;), not three records. The validator warns if two people have more than one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Children hang from a couple.&lt;/strong&gt; A child with two parents points at both, and those two must have a partnership (rule GN-301). If the parents' relationship is unknown, &lt;code&gt;relationship-unknown&lt;/code&gt; exists for that case.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dates are partial.&lt;/strong&gt; &lt;code&gt;"1950"&lt;/code&gt;, &lt;code&gt;"1950-06"&lt;/code&gt; or &lt;code&gt;"1950-06-03"&lt;/code&gt;, with an optional qualifier (&lt;code&gt;about&lt;/code&gt;, &lt;code&gt;before&lt;/code&gt;, &lt;code&gt;after&lt;/code&gt;, &lt;code&gt;estimated&lt;/code&gt;). Clinical histories are rarely exact.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unknown data has a place.&lt;/strong&gt; &lt;code&gt;extensions&lt;/code&gt; takes anything else, namespaced by reverse domain, so tools can round-trip their own fields.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The schema is JSON Schema draft 2020-12, published at &lt;a href="https://genogramai.com/schemas/genogram/v1.json" rel="noopener noreferrer"&gt;https://genogramai.com/schemas/genogram/v1.json&lt;/a&gt; and listed in the JSON Schema Store, so VS Code and JetBrains editors validate and complete any &lt;code&gt;*.genogram.json&lt;/code&gt; file without setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validator and renderer
&lt;/h3&gt;

&lt;p&gt;The schema checks shape. The notation needs more than shape: nobody can be their own ancestor, a couple that never married cannot divorce, a miscarriage has no children. The spec defines 23 conformance checks with ids (GN-100 to GN-602) and severities, and the TypeScript package implements them with messages written for people ("Ana dies (1990) before being born (1995)").&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install genogram-notation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;writeFileSync&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'node:fs'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;validateGenogram&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;renderGenogram&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'genogram-notation'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'examples/three-generation.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'utf8'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;validateGenogram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// { valid, errors, warnings, issues, symbolsUsed }&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'genogram.svg'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;renderGenogram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;svg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The renderer is a reference implementation: generations in rows, birth order left to right, partners joined by their line type, children hanging from the couple, and a key that lists only the symbols the chart uses (rule K2).&lt;/p&gt;

&lt;h3&gt;
  
  
  GEDCOM 7 export
&lt;/h3&gt;

&lt;p&gt;Genealogy software speaks GEDCOM, so a genogram should be able to leave in GEDCOM too. The crosswalk in &lt;code&gt;docs/gedcom-crosswalk.md&lt;/code&gt; maps every Genogram JSON field. People, births, deaths, couples, children, adoption and twins go into standard GEDCOM 7 structures. Emotional relationships become associations (&lt;code&gt;ASSO&lt;/code&gt;). What GEDCOM has no structure for, such as health conditions, households and the symbol ids themselves, goes into &lt;code&gt;_OGN_&lt;/code&gt; extension tags, each declared in &lt;code&gt;HEAD.SCHMA&lt;/code&gt; with a URI that serves a YAML definition. The tags have been submitted to the FamilySearch GEDCOM registries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;toGedcom7&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'genogram-notation'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'family.ged'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;toGedcom7&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// or toGedcom7(doc, { omitHealth: true })&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;omitHealth&lt;/code&gt; exists because a family tree file often gets shared with relatives, and a depression diagnosis should not travel with it by default.&lt;/p&gt;

&lt;h3&gt;
  
  
  An MCP server
&lt;/h3&gt;

&lt;p&gt;Language models are often asked to "draw a genogram" and usually guess at the symbols. The standard has an MCP server at &lt;a href="https://genogramai.com/api/mcp" rel="noopener noreferrer"&gt;https://genogramai.com/api/mcp&lt;/a&gt; with seven tools: list, get and search symbols, explain a family description as symbols, return the drawing rules, and validate or render a Genogram JSON document. In Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add --transport http genogram-symbols https://genogramai.com/api/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is listed in the official MCP Registry as &lt;code&gt;com.genogramai/genogram-symbols&lt;/code&gt;, and the repo has a &lt;code&gt;.mcp.json&lt;/code&gt; so an MCP client opened in the repo picks it up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Who publishes it
&lt;/h3&gt;

&lt;p&gt;GenogramAI, which makes a commercial genogram editor, publishes the standard. The ids, schema, dataset and code are open (CC BY 4.0 for the spec and data, MIT for the code) and any editor, including competing ones, can implement them. There is a DOI (10.5281/zenodo.24801618) for anyone who wants to cite it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What would help
&lt;/h3&gt;

&lt;p&gt;The most useful thing right now is people who draw genograms or build tools telling me where the format is wrong. There are also five scoped issues labelled "good first issue": a Python port of the validator, a GEDCOM 7 importer, a first translation of the symbol names, a command-line tool, and more example genograms.&lt;/p&gt;

&lt;p&gt;If this is useful to you, a star on the repo helps other clinicians and developers find it, and an issue helps me fix it: &lt;a href="https://github.com/GenogramAI/open-genogram-notation" rel="noopener noreferrer"&gt;https://github.com/GenogramAI/open-genogram-notation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I used an AI assistant (Claude) to help draft this post; the code and claims are checked against the repo.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>json</category>
      <category>typescript</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
