2title = "Graph Store - Reference"
9Graph Store can be poked with a `graph-update`, which can:
11### Add and remove a graph
13- `[%add-graph =resource =graph mark=(unit mark) overwrite=?]`
15- `[%remove-graph =resource]`
17### Add and remove a node
19- `[%add-nodes =resource nodes=(map index node)]`
21- `[%remove-posts =resource indices=(set index)]`
23### Add and remove signatures
25- `[%add-signatures =uid =signatures]`
27- `[%remove-signatures =uid =signatures]`
29### Add and remove tags
31- `[%add-tag =term =uid]`
33- `[%remove-tag =term =uid]`
35### Archive and unarchive a graph
37- `[%archive-graph =resource]`
39- `[%unarchive-graph =resource]`
41### Manually process an update log on a resource
43- `[%run-updates =resource =update-log]`
47What follows is a summary of the scries available in graph-store.
49<!-- enhancement: add examples -->
50<!-- enhancement: add refrences to relevant sections in data structures explanation -->
54Obtain a vase of the current state of graph-store as a noun.
57- Output Type: `network:store`
61Fetch the resources of all graphs that graph-store is currently tracking.
64- Output Type: `update:store`, `%keys`
68Fetch the available tag queries from graph-store.
70- Path: `/x/tag-queries`
71- Output Type: `tag-queries`
75Fetch all available tags from graph-store.
77- Path: `/x/tag-queries/tags`
78- Output Type: `(list term)`
80### Fetch the update log by resource
82This returns the full update log for the graph associated with the given resource.
84- Path: `/x/update-log/[ship]/[name]`
86 - **ship** (`ship`) - The ship of the resource.
87 - **name** (`@tas`) - The name of the resource.
88- Output Type: `update-log:store`
90### Fetch time of the latest log entry by resource
92Fetch the time of the latest log entry by resource, if the update-log for the given resource exists.
94- Path: `/x/update-log/[ship]/[name]/latest`
96 - **ship** (`ship`) - The ship of the resource.
97 - **name** (`@tas`) - The name of the resource.
98- Output Type: `(unit time)`
100### Fetch a subset of the update log
102- Path: `/x/update-log/[ship]/[name]/subset/[start]/[end]`
104 - **ship** (`ship`) - The ship of the resource.
105 - **name** (`@tas`) - The name of the resource.
106 - **start** and **end** (`@da`) - All logs after **start** and before **end** are to be included in the result.
107- Output Type: `update-log:store`
109### Fetch a specific graph by resource
111Returns the full graph for a given resource.
113- Path: `/x/graph/[ship]/[name]`
115 - **ship** (`ship`) - The ship of the resource.
116 - **name** (`@tas`) - The name of the resource.
117- Output Type: `update:store`, `%add-graph`
119### Request the mark of a graph
121Returns the mark associated a given graph, if one exists.
123- Path: `/x/graph/[ship]/[name]/mark`
125 - **ship** (`ship`) - The ship of the resource.
126 - **name** (`@tas`) - The name of the resource.
127- Output Type: `(unit mark)`
129### Request a subset of the graph
131Returns a subset of nodes from a graph, with or without descendants, optionally filtering for ones that fall between the start and end indexes.
133- Path: `/x/graph/[ship]/[name]/subset/[mode]/[start?]/[end?]`
135 - **ship** (`ship`) - The ship of the resource.
136 - **name** (`@tas`) - The name of the resource.
137 - **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude.
138 - **start** and **end** (`(unit atom)`) - Atoms used to start and end the subset. If these are unable to be parsed, the subset will start at the smallest node.
139- Output Type: `update:store` `%add-nodes`
141### Check if node exists
143Returns a flag, `%.y` if the node exists and `%.n` otherwise.
145- Path: `/x/graph/[ship]/[name]/node/exists/[index+]`
147 - **ship** (`ship`) - The ship of the resource.
148 - **name** (`@tas`) - The name of the resource.
149 - **[index+]** `(list atom)`- The index of the node to check. The index should be appended to the path as a list.
154Returns an `%add-nodes` update containing the node that was requested.
156- Path: `/x/graph/[ship]/[name]/node/index/[mode]/[index+]`
158 - **ship** (`ship`) - The ship of the resource.
159 - **name** (`@tas`) - The name of the resource.
160 - **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude
161 - **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
162- Output Type: `update:store` `%add-nodes`
164### Request a node's children
166Returns a subset of a node's children, with or without descendants, optionally filtering for ones that fall between the start and end indexes.
168- Path: `/x/graph/[ship]/[name]/node/children/[mode]/[start?]/[end?]/[index+]`
171 - **ship** (`ship`) - The ship of the resource.
172 - **name** (`@tas`) - The name of the resource.
173 - **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude.
174 - **start** and **end** (`(unit atom)`) - Atoms used to start and end the subset. If these are unable to be parsed, the subset will start at the smallest node.
175 - **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
177- Output Type: `update:store` `%add-nodes`
179### Request a node's siblings
181<!-- todo figure out behavior of %newest and %oldest -->
183- Path: `/x/graph/[ship]/[name]/node/siblings/[direction]/[mode]/[count]/[index+]`
185 - **ship** (`ship`) - The ship of the resource.
186 - **name** (`@tas`) - The name of the resource.
187 - **direction** (`?(%older %newer %oldest %newest)`)-
188 - `%newer` - Load the siblings with keys larger than the requested node.
189 - `%older` - Load the siblings with keys smaller than the requested node.
190 - `%newest` - Load the siblings with the largest keys.
191 - `%oldest` - Load the siblings with the largest keys.
192 - **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude.
193 - **count** (`atom`) - A limit to the number of nodes to return.
194 - **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
195- Output Type: `update:store` `%add-nodes`
197### Request a node's firstborn child
199<!-- todo explanation -->
201- Path: `/x/graph/[ship]/[name]/node/firstborn/[index+]`
204 - **ship** (`ship`) - The ship of the resource.
205 - **name** (`@tas`) - The name of the resource.
206 - **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
208- Output: `update:store` `%add-nodes`
210### Request nodes, depth first
212- Path: `/x/graph/[ship]/[name]/depth-first/[count]/[start]`
213- Mark: `%graph-update-3`
216 - **ship** (`ship`) - The ship of the resource.
217 - **name** (`@tas`) - The name of the resource.
218 - **count** (`(unit atom)`) - A limit to the number of nodes to return.
219 - **start** (`(unit atom)`) - The index fragment to start at.
221- Output Type: `update:store` `%add-nodes`
225The following is the definition of the agent state, known as `network`.
239- `graphs` represents all graphs that graph store is aware of an is storing data about.
240- `tag-queries` is how graph store implements its tagging system, and uses it to keep track of associations between tags and the respective index.
241- `update-logs` is where graph-store stores the update-log that backs each graph, keyed by resource. <!-- refrence to advanced section talking about how this is the source of truth -->
242- `archive` is where graph-store stores archived graphs. These are graphs which can no longer be updated through `%run-updates`. <!-- this nuance should/could also be present in the advanced info -->
244For more information on these types, please take a look at the [data structure overview](/docs/userspace/graph-store/data-structure-overview).
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list