git extensions for knowledge graphs
What if git is the knowledge graph? Git already has content-addressed storage, branching, merging, diffing, blame, and a full temporal DAG.
git-lex extends git with structured knowledge.
Write markdown. Commit normally. git-lex extracts entities, relationships, and metadata into an RDF knowledge graph — tracked by git, queryable with SPARQL.
cargo install git-lex
cd my-project
git lex init --kit soul
git lex create note
git lex save "first note"
git lex query "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10"
Everything lives in git. No binary stores, no external services. The .lex/ directory is your knowledge graph index — diffable, mergeable, portable.
YAML frontmatter with typed properties, written as kit.Class.property. Journals, notes, memories, explorations — each with its own schema. Dot notation keeps it clean.
Ordinary markdown links in your documents become linksTo edges in the graph, read in the same pass as the frontmatter. Root-relative paths survive a file moving. Relationships emerge naturally.
Query your knowledge graph with SPARQL. Auto-injected prefixes for git, frontmatter, and lex namespaces. Full graph traversal.
Pluggable document type systems, fetched from GitHub at init. The soul kit gives you journals, notes, memories, explorations, pursuits and skills. Build your own.
RDF, OWL, SPARQL, JSON-LD. Your knowledge graph is interoperable with the entire semantic web stack. No lock-in.
| Command | What it does |
|---|---|
git lex init | Initialize git-lex in a repository |
git lex create <type> | Scaffold a new document from kit templates |
git lex save "msg" | Stage, commit, and extract in one step |
git lex sync | Build the knowledge graph from git + extractions |
git lex query "..." | Run a SPARQL query against the graph |
git lex status | Show extraction status |
git lex serve | Start a local SPARQL HTTP endpoint |