on master help sign in
Merge pull request #1228 from ynx0/graph-fixes

Some graph store cleanup (part 1)

commit6ee82bdf80a28252f88c3b9c6d1628053c71e962 authortinnus-napbus <77721746+tinnus-napbus@users.noreply.github.com> dateThu 9 Dec 2021, 21:52 (5 years ago) parent6761da4b45541c
3 files changed+292−186
content/docs/userspace/graph-store/data-structure-overview.md+47−26 content/docs/userspace/graph-store/graph-store-reference.md+245 content/docs/userspace/landscape/reference/graph-store.md−160
content/docs/userspace/graph-store/data-structure-overview.md+47−26
@@ -6,11 +6,15 @@ template = "doc.html"
66insert_anchor_links = "right"
77+++
88
9−
109Let's go through the type definitions of some of the most used types when working with Graph Store.
1110
1211## Post
12+
1313Here's `sur/post.hoon`
14+
15+<details>
16+ <summary> Code Listing (Click to Expand)</summary>
17+
1418```hoon
1519+$ index (list atom)
1620+$ uid [=resource =index]
@@ -41,6 +45,7 @@ Here's `sur/post.hoon`
4145+$ reference
4246 $% [%graph group=resource =uid]
4347 [%group group=resource]
48+ [%app =ship =desk =path]
4449 ==
4550::
4651+$ content
@@ -50,11 +55,12 @@ Here's `sur/post.hoon`
5055 [%code expression=cord output=(list tank)]
5156 [%reference =reference]
5257 ==
53−--
5458```
5559
60+</details>
5661
5762### Index
63+
5864```hoon
5965+$ index (list atom)
6066+$ uid [=resource =index]
@@ -67,6 +73,7 @@ Here's `sur/post.hoon`
6773An index fragment is not an explicitly defined type, but since an index is `(list atom)`, it follows that the type of an index fragment is `atom`. This is what gives the developer the flexibility to use more than just numbers in an index: any type that is representable as an atom can be used in the index.
6874
6975### Hashing (Part 1)
76+
7077```hoon
7178:: +sham (half sha-256) hash of +validated-portion
7279+$ hash @ux
@@ -78,10 +85,12 @@ An index fragment is not an explicitly defined type, but since an index is `(lis
7885These types are used to cryptographically sign a given post, so that the host of some content cannot act as an imposter, and post content impersonating as someone else. `signature` represents a triple of signed message of hash, author, and author's life at time of posting. These can be used to cryptographically attest to a message. The implementation is a form of asymmetric/public-key encryption, where `q` and `r` are data necessary to look up a ship's public key on azimuth, which can be used to verify the validity of the message.
7986
8087### Content Types
88+
8189```hoon
8290+$ reference
8391 $% [%graph group=resource =uid]
8492 [%group group=resource]
93+ [%app =ship =desk =path]
8594 ==
8695::
8796+$ content
@@ -94,7 +103,11 @@ These types are used to cryptographically sign a given post, so that the host of
94103::
95104```
96105
97−`reference` is a type that models a reference to a graph object. Currently, the valid types of references are either a reference to a specific node in a graph, or a specific group.
106+`reference` is a type that models a reference to a graph object.
107+
108+- `%graph` is a reference to a specific node in a given graph identified by its resource
109+- `%group` is a reference to a given resource itself
110+- `%app` is a reference to an application, hosted on `ship`, located at `desk`, with a `path` that the receiving application can use to link to some content (this is just `/` when unused).
98111
99112`content` enumerates all the possible content types that a post can have. The possible content types can be:
100113
@@ -107,6 +120,7 @@ These types are used to cryptographically sign a given post, so that the host of
107120Currently, these are the only content types supported by Graph Store.
108121
109122### Post
123+
110124```hoon
111125+$ post
112126 $: author=ship
@@ -125,6 +139,7 @@ Post is a fundamental type that represents what we normally think of as a post o
125139An `indexed-post` is a post with an associated index fragment that can be used to validate a post's index with an index fragment that is expected at the end of the index list.
126140
127141### Hashing (Part 2)
142+
128143```hoon
129144+$ validated-portion
130145 $: parent-hash=(unit hash)
@@ -137,24 +152,26 @@ An `indexed-post` is a post with an associated index fragment that can be used t
137152
138153The parts of a `post` that are actually hashed to obtain a value of type the earlier type `hash`.
139154
140−
141155## Graph Store
142156
143157Here's `sur/graph-store.hoon`
144158
159+<details>
160+<summary>Code Listing (Click To Expand)</summary>
161+
145162```hoon
146163+$ graph ((mop atom node) gth)
147164+$ marked-graph [p=graph q=(unit mark)]
148165::
149−+$ node [=post children=internal-graph]
166++$ maybe-post (each post hash)
167++$ node [post=maybe-post children=internal-graph]
150168+$ graphs (map resource marked-graph)
151169::
152−+$ tag-queries (jug term resource)
170++$ tag-queries (jug term uid)
153171::
154172+$ update-log ((mop time logged-update) gth)
155173+$ update-logs (map resource update-log)
156174::
157−::
158175+$ internal-graph
159176 $~ [%empty ~]
160177 $% [%graph p=graph]
@@ -166,18 +183,18 @@ Here's `sur/graph-store.hoon`
166183 =tag-queries
167184 =update-logs
168185 archive=graphs
169− validators=(set mark)
186+ ~
170187 ==
171188::
172189+$ update [p=time q=action]
173190::
174191+$ logged-update [p=time q=logged-action]
175−
192+
176193::
177194+$ logged-action
178195 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
179196 [%add-nodes =resource nodes=(map index node)]
180− [%remove-nodes =resource indices=(set index)]
197+ [%remove-posts =resource indices=(set index)]
181198 [%add-signatures =uid =signatures]
182199 [%remove-signatures =uid =signatures]
183200 ==
@@ -186,8 +203,8 @@ Here's `sur/graph-store.hoon`
186203 $% logged-action
187204 [%remove-graph =resource]
188205 ::
189− [%add-tag =term =resource]
190− [%remove-tag =term =resource]
206+ [%add-tag =term =uid]
207+ [%remove-tag =term =uid]
191208 ::
192209 [%archive-graph =resource]
193210 [%unarchive-graph =resource]
@@ -199,22 +216,24 @@ Here's `sur/graph-store.hoon`
199216 [%tags tags=(set term)]
200217 [%tag-queries =tag-queries]
201218 ==
202−--
203−+$ permissions
219+::
220++$ permissions
204221 [admin=permission-level writer=permission-level reader=permission-level]
205222::
206223:: $permission-level: levels of permissions in increasing order
207−::
224+::
208225:: %no: May not add/remove node
209226:: %self: May only nodes beneath nodes that were added by
210227:: the same pilot, may remove nodes that the pilot 'owns'
211228:: %yes: May add a node or remove node
212229+$ permission-level
213230 ?(%no %self %yes)
214−::
215231```
216232
233+</details>
234+
217235### Graph, Node, and Related Objects
236+
218237```hoon
219238+$ graph ((mop atom node) gth)
220239+$ marked-graph [p=graph q=(unit mark)]
@@ -238,18 +257,20 @@ Here's `sur/graph-store.hoon`
238257 ==
239258::
240259```
260+
241261A graph is a loosely interconnected set of data which can reference each other and be arbitrarily nested and interconnected. This concept is based off of the mathematical concept of a graph: a collection of nodes, and connections between nodes called edges.
242262
243263`graph` is a `mop`, a map which maintains ordering on its keys based on a sorting function also known as an ordered map. A graph's keys are `atom`s representing a node's index fragment and whose values are `node`s, where entries are sorted by largest valued keys first, using `gth` as the sorting function. This is the fundamental data structure used in Graph Store.
244264
245265Here are some helpful Wikipedia pages for more info on what this data type represents:
246−- [Graph (abstract data type)](https://en.wikipedia.org/wiki/Graph_(abstract_data_type))
266+
267+- [Graph (abstract data type)](<https://en.wikipedia.org/wiki/Graph_(abstract_data_type)>)
247268- [Graph database](https://en.wikipedia.org/wiki/Graph_database#Background)
248−- [Graph (discrete mathematics)](https://en.wikipedia.org/wiki/Graph_(discrete_mathematics))
269+- [Graph (discrete mathematics)](<https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)>)
249270
250271`node` represents a pair of a `post` and all of its children, which is an `internal-graph`.
251272
252−`internal-graph` is a tagged union representing the state that children can be in. Either a `node` has children in the form of a `graph`, or does not have any and is labeled as `%empty`.
273+`internal-graph` is a tagged union representing the state that children can be in. Either a `node` has children in the form of a `graph`, or does not have any and is labeled as `%empty`.
253274
254275`marked-graph` is the pair of a `graph` and an optionally present `mark`, which is used by Graph Store to validate a graph against the provided validator.
255276
@@ -257,8 +278,6 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
257278
258279`network` is the highest level data structure used by Graph Store to represent all the information that the agent is aware of.
259280
260−
261−
262281### Tag Queries
263282
264283```hoon
@@ -268,13 +287,14 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
268287`tag-queries` is a mapping where the keys are `term`s and the values are a `set` of `resource`s (this pattern is called a `jug`). It is a simple tagging system that allows for various ad-hoc collections, similar to filesystem tags being used to sort different files/folders. While the type's name is `tag-queries`, there is no complex querying system as of now. Currently, you can add term/resources pairs into the tag queries, get a list of all terms in tag-queries, and get the whole `jug` out of Graph Store.
269288
270289### Update (Part 1)
290+
271291```hoon
272292+$ update [p=time q=action]
273293::
274294+$ logged-action
275295 $% [%add-graph =resource =graph mark=(unit mark) overwrite=?]
276296 [%add-nodes =resource nodes=(map index node)]
277− [%remove-nodes =resource indices=(set index)]
297+ [%remove-posts =resource indices=(set index)]
278298 [%add-signatures =uid =signatures]
279299 [%remove-signatures =uid =signatures]
280300 ==
@@ -283,8 +303,8 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
283303 $% logged-action
284304 [%remove-graph =resource]
285305 ::
286− [%add-tag =term =resource]
287− [%remove-tag =term =resource]
306+ [%add-tag =term =uid]
307+ [%remove-tag =term =uid]
288308 ::
289309 [%archive-graph =resource]
290310 [%unarchive-graph =resource]
@@ -301,9 +321,10 @@ Here are some helpful Wikipedia pages for more info on what this data type repre
301321
302322The `update` type is what is used to interact with Graph Store. It is used both to update subscribers with data (outgoing data) and to write to Graph Store itself (incoming data). All actions are meant to be sent as pokes to Graph Store in the form of a `action` (encapsulated by a `graph-update`), except for the last three actions ,`%keys`, `%tags`, and `%tag-queries`, which must be sent scry requests. All actions defined here allow you to create/read/update/delete various objects in a running Graph Store gall agent. An `action` encapsulates all `logged-action`; any `logged-action` is an `action`, but not necessarily the other way around.
303323
304−If you want to check out a relevant code listing to see how graph store handles these pokes, check out the `graph-update` arm in the poke handler at [`app/graph-store.hoon`](https://github.com/urbit/urbit/blob/e2ad6e3e9219c8bfad62f27f05c7cac94c9effa8/pkg/arvo/app/graph-store.hoon#L221-L227)
324+<!-- todo link to reference explaining pokes -->
305325
306326### Update (Part 2)
327+
307328```hoon
308329+$ update-log ((mop time logged-update) gth)
309330+$ update-logs (map resource update-log)
@@ -320,6 +341,7 @@ It is important to note that the source of truth is actually the `update-logs`,
320341The reason for having the main CRUD actions being `logged-update`s is so that Graph Store knows which order to process the log entries in when it is rebuilding its current state. The time associated with the `logged-update` is a way of specifying the canonical order to process operations. All other actions that aren't part of logged-update stand on their own and don't need a timestamp in order to properly apply them.
321342
322343### Permissions
344+
323345```hoon
324346+$ permissions
325347 [admin=permission-level writer=permission-level reader=permission-level]
@@ -335,4 +357,3 @@ The reason for having the main CRUD actions being `logged-update`s is so that Gr
335357```
336358
337359These are the types from the permissioning system explained earlier. `permissions` is just a length-3 cell of `permissions-level`s for Admins, Writers, and Readers respectively.
338−
content/docs/userspace/graph-store/graph-store-reference.mdnew file+245
@@ -0,0 +1,245 @@
1++++
2+title = "Graph Store - Reference"
3+weight = 5
4+template = "doc.html"
5++++
6+
7+
8+## Pokes
9+
10+Graph Store can be poked with a `graph-update`, which can:
11+
12+### Add and remove a graph
13+
14+- `[%add-graph =resource =graph mark=(unit mark) overwrite=?]`
15+
16+- `[%remove-graph =resource]`
17+
18+### Add and remove a node
19+
20+- `[%add-nodes =resource nodes=(map index node)]`
21+
22+- `[%remove-posts =resource indices=(set index)]`
23+
24+### Add and remove signatures
25+
26+- `[%add-signatures =uid =signatures]`
27+
28+- `[%remove-signatures =uid =signatures]`
29+
30+### Add and remove tags
31+
32+- `[%add-tag =term =uid]`
33+
34+- `[%remove-tag =term =uid]`
35+
36+### Archive and unarchive a graph
37+
38+- `[%archive-graph =resource]`
39+
40+- `[%unarchive-graph =resource]`
41+
42+### Manually process an update log on a resource
43+
44+- `[%run-updates =resource =update-log]`
45+
46+## Scries
47+
48+What follows is a summary of the scries available in graph-store.
49+
50+<!-- enhancement: add examples -->
51+<!-- enhancement: add refrences to relevant sections in data structures explanation -->
52+
53+
54+### Export State
55+
56+Obtain a vase of the current state of graph-store as a noun.
57+
58+* Path: `/x/export`
59+* Output Type: `network:store`
60+
61+### Fetch keys
62+
63+Fetch the resources of all graphs that graph-store is currently tracking.
64+
65+* Path: `/x/keys`
66+* Output Type: `(set resource)`
67+
68+### Fetch tag queries
69+
70+Fetch the available tag queries from graph-store.
71+
72+* Path: `/x/tag-queries`
73+* Output Type: `tag-queries`
74+
75+### Fetch tags
76+
77+Fetch all available tags from graph-store.
78+
79+* Path: `/x/tag-queries/tags`
80+* Output Type: `(list term)`
81+
82+### Fetch the update log by resource
83+
84+This returns the full update log for the graph associated with the given resource.
85+
86+* Path: `/x/update-log/[ship]/[name]`
87+* Inputs
88+ * **ship** (`ship`) - The ship of the resource.
89+ * **name** (`@tas`) - The name of the resource.
90+* Output Type: `update-log:store`
91+
92+### Fetch time of the latest log entry by resource
93+
94+Fetch the time of the latest log entry by resource, if the update-log for the given resource exists.
95+
96+* Path: `/x/update-log/[ship]/[name]/latest`
97+* Inputs
98+ * **ship** (`ship`) - The ship of the resource.
99+ * **name** (`@tas`) - The name of the resource.
100+* Output Type: `(unit time)`
101+
102+### Fetch a subset of the update log
103+
104+* Path: `/x/update-log/[ship]/[name]/subset/[start]/[end]`
105+* Inputs
106+ * **ship** (`ship`) - The ship of the resource.
107+ * **name** (`@tas`) - The name of the resource.
108+ * **start** and **end** (`@da`) - All logs after **start** and before **end** are to be included in the result.
109+* Output Type: `update-log:store`
110+
111+### Fetch a specific graph by resource
112+
113+Returns the full graph for a given resource.
114+
115+* Path: `/x/graph/[ship]/[name]`
116+* Inputs:
117+ * **ship** (`ship`) - The ship of the resource.
118+ * **name** (`@tas`) - The name of the resource.
119+* Output Type: `update:store`, `%add-graph`
120+
121+
122+### Request the mark of a graph
123+
124+Returns the mark associated a given graph, if one exists.
125+
126+* Path: `/x/graph/[ship]/[name]/mark`
127+* Inputs:
128+ * **ship** (`ship`) - The ship of the resource.
129+ * **name** (`@tas`) - The name of the resource.
130+* Output Type: `(unit mark)`
131+
132+### Request a subset of the graph
133+
134+Returns a subset of nodes from a graph, with or without descendants, optionally filtering for ones that fall between the start and end indexes.
135+
136+* Path: `/x/graph/[ship]/[name]/subset/[mode]/[start?]/[end?]`
137+* Inputs:
138+ * **ship** (`ship`) - The ship of the resource.
139+ * **name** (`@tas`) - The name of the resource.
140+ * **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude.
141+ * **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.
142+* Output Type: `update:store` `%add-nodes`
143+
144+### Check if node exists
145+
146+Returns a flag, `%.y` if the node exists and `%.n` otherwise.
147+
148+* Path: `/x/graph/[ship]/[name]/node/exists/[index+]`
149+* Inputs:
150+ * **ship** (`ship`) - The ship of the resource.
151+ * **name** (`@tas`) - The name of the resource.
152+ * **[index+]** `(list atom)`- The index of the node to check. The index should be appended to the path as a list.
153+* Output Type: `flag`
154+
155+### Request a node
156+
157+Returns an `%add-nodes` update containing the node that was requested.
158+
159+* Path: `/x/graph/[ship]/[name]/node/index/[mode]/[index+]`
160+* Inputs
161+ * **ship** (`ship`) - The ship of the resource.
162+ * **name** (`@tas`) - The name of the resource.
163+ * **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude
164+ * **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
165+* Output Type: `update:store` `%add-nodes`
166+
167+### Request a node's children
168+
169+Returns a subset of a node's children, with or without descendants, optionally filtering for ones that fall between the start and end indexes.
170+
171+
172+* Path: `/x/graph/[ship]/[name]/node/children/[mode]/[start?]/[end?]/[index+]`
173+* Inputs
174+ * **ship** (`ship`) - The ship of the resource.
175+ * **name** (`@tas`) - The name of the resource.
176+ * **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude.
177+ * **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.
178+ * **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
179+
180+* Output Type: `update:store` `%add-nodes`
181+
182+
183+### Request a node's siblings
184+
185+<!-- todo figure out behavior of %newest and %oldest -->
186+
187+* Path: `/x/graph/[ship]/[name]/node/siblings/[direction]/[mode]/[count]/[index+]`
188+* Inputs
189+ * **ship** (`ship`) - The ship of the resource.
190+ * **name** (`@tas`) - The name of the resource.
191+ * **direction** (`?(%older %newer %oldest %newest)`)-
192+ + `%newer` - Load the siblings with keys larger than the requested node.
193+ + `%older` - Load the siblings with keys smaller than the requested node.
194+ + `%newest` - Load the siblings with the largest keys.
195+ + `%oldest` - Load the siblings with the largest keys.
196+ * **mode** (`?(%kith %lone)`) - `%kith` to include descendants, `%lone` to exclude.
197+ * **count** (`atom`) - A limit to the number of nodes to return.
198+ * **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
199+* Output Type: `update:store` `%add-nodes`
200+
201+### Request a node's firstborn child
202+
203+<!-- todo explanation -->
204+
205+* Path: `/x/graph/[ship]/[name]/node/firstborn/[index+]`
206+* Inputs:
207+ * **ship** (`ship`) - The ship of the resource.
208+ * **name** (`@tas`) - The name of the resource.
209+ * **[index+]** `(list atom)`- The index of the node being requested. The index should be appended to the path as a list.
210+
211+* Output: `update:store` `%add-nodes`
212+
213+### Request nodes, depth first
214+
215+* Path: `/x/graph/[ship]/[name]/node/depth-first/[count]/[start]`
216+* Input
217+ * **ship** (`ship`) - The ship of the resource.
218+ * **name** (`@tas`) - The name of the resource.
219+ * **count** (`(unit atom)`) - A limit to the number of nodes to return.
220+ * **start** (`(unit atom)`) - The index fragment to start at.
221+
222+* Output Type: `update:store` `%add-nodes`
223+
224+
225+## Agent State
226+
227+The following is the definition of the agent state, known as `network`.
228+
229+```hoon
230++$ network
231+ $: =graphs
232+ =tag-queries
233+ =update-logs
234+ archive=graphs
235+ ~
236+ ==
237+```
238+
239+Briefly,
240+- `graphs` represents all graphs that graph store is aware of an is storing data about.
241+- `tag-queries` is how graph store implements its tagging system, and uses it to keep track of associations between tags and the respective index.
242+- `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 -->
243+- `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 -->
244+
245+For more information on these types, please take a look at the [data structure overview](/docs/userspace/graph-store/data-structure-overview).
content/docs/userspace/landscape/reference/graph-store.mddeleted−160
@@ -1,160 +0,0 @@
1−+++
2−title = "Graph Store"
3−weight = 3
4−template = "doc.html"
5−+++
6−
7−`graph-store` is a gall agent that implements of a tree with additional virtual
8−edges by allowing nodes to reference other nodes. It is most comparable to
9−modern NoSQL databases in structure, though it allows for schemas to be written
10−in the form of marks. It is used as the backend for an increasing number of
11−Landscape applications, and is considered to be best used for social data.
12−
13−## Data types
14−
15−`graphs` is a map of `resource` to `marked-graph`
16−
17−`resource` is a pair of ship and term which is where the graph is hosted and the name of the resource. Every graph is it's own resource.
18−
19−`marked-graph` is a pair of `graph` and `(unit mark)`. The semantics of a graph are defined by the mark. This is just for validating the structure of the graph.
20−
21−`graph` is a `mop`, a mold builder for order map, of an atom and a `node`.
22−
23−`node` is a pair of `post` and `children`.
24−
25−`post` is defined in `sur/post`. It contains:
26−
27−```hoon
28−+$ post
29− $: author=ship
30− =index
31− time-sent=time
32− contents=(list content)
33− hash=(unit hash)
34− =signatures
35− ==
36−```
37−
38−
39−Most of these elements are self explanatory.
40−
41−`contents` is a `list` of `content` where `content` is a tagged union of text, url, code, or reference. This is where the contents of a publish post or an entry from links would be stored.
42−
43−`hash` is a `sham` hash of `validated-portion` which includes the parent hash, author, time sent, and contents.
44−
45−`signatures` is a set of `signature` which is used to cryptographically sign graph-store messages.
46−
47−When interacting with `graph-store` you will need to create an `update`
48−
49−`update` is a tagged union that currently only has one option
50−
51−`[%0 p=time q=update-0]`
52−
53−The reason this is a union is to serve as future proofing for version changes.
54−
55−An `update-0` can either be logged in the case of adding/removing nodes or signatures, or non-logged as in the case of adding/removing a graph. This logging refers to if this action adds an entry to the update log that is used to synchronize state between ships.
56−
57−Below is an excerpt of `sur/graph-store.hoon` at the time of writing, showing the definition of `logged-update-0` and `update-0` which should now be readable.
58−
59−```hoon
60−+$ logged-update-0
61− $% [%add-nodes =resource nodes=(map index node)]
62− [%remove-nodes =resource indices=(set index)]
63− [%add-signatures =uid =signatures]
64− [%remove-signatures =uid =signatures]
65− ==
66−::
67−+$ update-0
68− $% logged-update-0
69− [%add-graph =resource =graph mark=(unit mark)]
70− [%remove-graph =resource]
71− ::
72− [%add-tag =term =resource]
73− [%remove-tag =term =resource]
74− ::
75− [%archive-graph =resource]
76− [%unarchive-graph =resource]
77− [%run-updates =resource =update-log]
78− ::
79− :: NOTE: cannot be sent as pokes
80− ::
81− [%keys =resources]
82− [%tags tags=(set term)]
83− [%tag-queries =tag-queries]
84− ==
85−```
86−
87−
88−## Pokes
89−
90−Graph Store can be poked with a `graph-update`, which can:
91− - add and remove a graph
92−
93− `[%add-graph =resource =graph mark=(unit mark)]`
94−
95− `[%remove-graph =resource]`
96−
97− - add and remove a node to a graph
98−
99− `[%add-nodes =resource nodes=(map index node)]`
100−
101− `[%remove-nodes =resource indices=(set index)]`
102−
103− - add and remove signatures
104−
105− `[%add-signatures =uid =signatures]`
106−
107− `[%remove-signatures =uid =signatures]`
108−
109− - add and remove tags
110−
111− `[%add-tag =term =resource]`
112−
113− `[%remove-tag =term =resource]`
114−
115− - archive and unarchive a graph
116−
117− `[%archive-graph =resource]`
118−
119− `[%unarchive-graph =resource]`
120−
121−## Scries
122−
123−What follows is a summary of the scrys available in graph-store
124−
125−- Fetch keys
126− `[%x %keys ~]`
127−
128−- Fetch tags
129− `[%x %tags ~]`
130−
131−- Fetch tag queries
132− `[%x %tag-queries ~]`
133−
134−- Fetch a specific graph by resource
135− `[%x %graph @ @ ~]`
136−
137−- Archive a specific graph by resource
138− `[%x %archive @ @ ~]`
139−
140−- Fetch a subset of the graph by resource and start and end indices
141− `[%x %graph-subset @ @ @ @ ~]`
142−
143−- Select a node from a graph by resource and index
144− `[%x %node @ @ @ *]`
145−
146−- Fetch a subset of the children of a node by resource, index, and start and end indices
147− `[%x %node-children-subset @ @ @ @ @ *]`
148−
149−- Fetch a subset of the update log by resource and start and end indices
150− `[%x %update-log-subset @ @ @ @ ~]`
151−
152−- Fetch the update log by resource
153− `[%x %update-log @ @ ~]`
154−
155−- Fetch the time of the last entry of the update log
156− `[%x %peek-update-log @ @ ~]`
157−
158−## Marks
159−
160−There are marks in `mar/graph/validator` that are worth reviewing. They are each short enough to read quickly. They are used to validate the shapes of various nouns to be stored in the graph-store.