-
Notifications
You must be signed in to change notification settings - Fork 108
Add more examples to Selector specs #327
Comments
A couple of misc things I'd like to see added along with those fixtures:
|
Quick draft on explainer of This fixture file contains a list of fixture objects. Each fixture object matches the IPLD Schema:
(Note: the schema is used here only for documentation! You don't need to implement IPLD Schemas in order to implement Selectors; in fact, these fixtures were developed without schemas, and I'm applying them retroactively as an explainer tool.) To make this concrete, let's look at some JSON that matches this:
Now let's look at
In schema form:
The |
ipld -> data in Json format being selected on
This is just testing the selector progression as it applies on the ipld. This is just testing the explore functionality when I was comparing against the go implementation (ie: https://github.com/ipld/go-ipld-prime/blob/08171d6bef3662ed7839e2c541f2c727d04e1c36/traversal/selector/exploreIndex.go#L23 but for each selector)
These tests were more tailored to what I wanted to ensure worked for our client. Each item in that array is cbor encoded and put in a blockstore (and those are the links that are populated when traversing). Made most sense to me because this is the use case for most Yeah sorry this isn't well documented, was on a time crunch, but hopefully the tests setup to be run by other implementations helps :) I just wanted to be able to ensure interoperability through setting this up Explore runner is simple but the walking runner is here: https://github.com/ChainSafe/forest/blob/main/ipld/tests/walk_tests.rs |
As @chafey has pointed out lately, the selectors specs could use more examples to make them easier to understand, and also give implementer more fixtures to work with.
We have some examples already: https://github.com/ipld/specs/blob/109d2f82f62787fef3754675764290a1b027b467/selectors/example-selectors.md
... however, they're very narrative (fine, but means it was high cost for us to write) and there's relatively few of them, and they cover only quite basic cases. We need more!
@austinabell has already written some very excellent fixtures, in other repo. https://github.com/ChainSafe/ipld-traversal-vectors/blob/master/selector_walk.json has been very excellent reference material.
We should consider integrating that fixture data into our specs repo, or, at least linking to it.
The text was updated successfully, but these errors were encountered: