git-lex

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.

Quick Start

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"

No database

Everything lives in git. No binary stores, no external services. The .lex/ directory is your knowledge graph index — diffable, mergeable, portable.

Structured frontmatter

YAML frontmatter with typed properties, written as kit.Class.property. Journals, notes, memories, explorations — each with its own schema. Dot notation keeps it clean.

Automatic extraction

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.

SPARQL queryable

Query your knowledge graph with SPARQL. Auto-injected prefixes for git, frontmatter, and lex namespaces. Full graph traversal.

Kits

Pluggable document type systems, fetched from GitHub at init. The soul kit gives you journals, notes, memories, explorations, pursuits and skills. Build your own.

Built on open standards

RDF, OWL, SPARQL, JSON-LD. Your knowledge graph is interoperable with the entire semantic web stack. No lock-in.

Commands

CommandWhat it does
git lex initInitialize 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 syncBuild the knowledge graph from git + extractions
git lex query "..."Run a SPARQL query against the graph
git lex statusShow extraction status
git lex serveStart a local SPARQL HTTP endpoint