Branching
WWKG uses a Git-inspired branching model. Every change creates a new commit that records exactly what changed, who made the change, and when. Branches are named pointers to the latest commit in a timeline.
Each branch has a stable opaque BranchId plus a mutable BranchName
slug path.
Users typically work with names like main or experiment; UUID-based
branch IDs are returned in metadata and can also be used as refs.
Creating branches
Create a branch from the current HEAD of main:
wwkg client branch create experimentFork from a specific branch:
wwkg client branch create experiment --from stagingListing branches
wwkg client branch listQuerying a branch
All query and load commands accept a --branch flag:
wwkg client query "SELECT * WHERE { ?s ?p ?o }" --branch experiment
wwkg load data.ttl --branch experimentSee the Querying guide for additional ways to specify a branch (HTTP headers, URL parameters, in-query pragmas).
Cross-branch queries
Compare data across branches using the SPARQL BRANCH pattern:
SELECT ?branch ?name WHERE {
VALUES ?branch {
<urn:wwkg:branch:660e8400-e29b-41d4-a716-446655440000>
<urn:wwkg:branch:660e8400-e29b-41d4-a716-446655440003>
}
BRANCH ?branch {
<http://example.org/Alice> <http://example.org/name> ?name .
}
}Delta queries — what changed
See which triples were inserted or deleted between two points in history:
SELECT ?op ?s ?p ?o WHERE {
DELTA FROM "main~3" TO "main" {
?op ?s ?p ?o .
}
}The ~N suffix means “N commits before HEAD”. ?op binds to wwkg:Insert or
wwkg:Delete.
History queries
Query the commit log of a branch:
SELECT ?commit ?timestamp ?author ?message WHERE {
HISTORY "main" {
?commit wwkg:timestamp ?timestamp ;
wwkg:author ?author ;
wwkg:message ?message .
}
}
ORDER BY DESC(?timestamp) LIMIT 10Merging
Merge a branch into another (typically main):
MERGE BRANCH "experiment" INTO "main"WWKG performs a three-way merge: it finds the common ancestor of the two branches, computes the deltas from ancestor to each branch head, and applies both sets of changes. If both branches modified the same triple in conflicting ways, the merge reports a conflict.
Merging is atomic — either the merge commit is fully created and the target branch advances, or the merge fails and nothing changes.
Branch naming conventions
| Pattern | Use case |
|---|---|
main | Primary timeline |
staging | Pre-production integration |
drafts/alice/2025-02 | Personal draft workspace |
imports/wikidata/2025 | Bulk data import |
experiments/schema-v2 | Schema experiments |
Deleting branches
wwkg client branch delete experimentThis removes the branch pointer. The underlying commits remain available as long as they are referenced by other branches.