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.
Branch IDs stay stable when a branch is renamed or replicated to another host. The latest commit for a branch may arrive asynchronously from peers or custodians depending on workspace policy, but the branch identity itself does not change. Use branch names for human-facing workflows and branch IDs when you need an exact durable reference.
Creating branches
Create a branch from the current HEAD of main:
wwkg graph branch create experimentFork from a specific branch:
wwkg graph branch create experiment --from stagingListing branches
wwkg graph branch listQuerying a branch
Query commands accept --branch; upload uses --target-branch for the final
merge target:
wwkg graph query "SELECT * WHERE { ?s ?p ?o }" --branch experiment
wwkg graph upload data.ttl --target-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 "urn:wwkg:commit:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
TO "urn:wwkg:branch:660e8400-e29b-41d4-a716-446655440000" {
?op ?s ?p ?o .
}
}Use canonical commit or branch IRIs as DELTA endpoints. Branch names are
mutable labels, so resolve them before using a branch as a query endpoint.
?op binds to wwkg:Insert or wwkg:Delete.
History queries
Query the commit log of a branch:
SELECT ?commit ?timestamp ?author ?message WHERE {
HISTORY "urn:wwkg:branch:660e8400-e29b-41d4-a716-446655440000" {
?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 graph branch delete experimentThis removes the branch pointer. The underlying commits remain available as long as they are referenced by other branches.