State mutations
A world mutates its state using RDF patches, which are additions and deletions of facts. A world stores current state: a deleted fact is removed, and Worlds does not keep a history of earlier states yet. Fact-level history is planned as an append-only change log that records every patch beside the current state (worlds-sdk-ts#221).Import quads
The hosted API has two mutation paths: the import endpoint and SPARQL UPDATE through SPARQL. Both require an API key with thedata:write scope. To add facts, send quads to import:
wazoo:worlds is a schema:SoftwareApplication.
Set contentType to text/plain to ingest unstructured text chunks instead.
Mutation and state
Every update to a world is a transaction that adds and removes facts. You can query the current state; earlier states are not retained. To keep a record of how information changed, write it as facts, for example a timestamp or a superseded-by property.RDF patches
An RDF patch is a structured set of additions and deletions. When you update a relationship, the engine performs a patch:- Deletion: Remove the outdated triple.
- Addition: Insert the new triple.