Linked Markdown Protocol

Linked Markdown

JSR PyPI version DOI License: MIT

A specification for structuring, validating, and querying typed Markdown documents as first-class semantic graph nodes.

---
{
  "@id": "https://example.org/docs/ethan-davidson",
  "@type": "schema:Person",
  "@context": {
    "schema": "https://schema.org/"
  },
  "schema:givenName": "Ethan",
  "schema:familyName": "Davidson"
}
---

# Ethan Davidson

Ethan Davidson is a [knowledge graph engineer](./roles/knowledge-graph-engineer.md).

Installation

# Python
pip install linked-markdown
# TypeScript (Deno)
deno add jsr:@wazoo/linked-markdown

# TypeScript (Node)
npx jsr add @wazoo/linked-markdown

RDF compatibility

The attrs returned by extract() is valid JSON-LD, directly loadable into the standard RDF library of your choice:

Python — uses rdflib:

import json
import rdflib
from linked_markdown import extract

result = extract(markdown)
g = rdflib.Graph()
g.parse(data=json.dumps(result.attrs), format="json-ld")

TypeScript — uses jsonld:

import jsonld from "jsonld";
import { extract } from "@wazoo/linked-markdown";

const result = extract(markdown);
const quads = await jsonld.toRDF(result.attrs);