Skip to content

Commit

Permalink
Clarify difference from jq
Browse files Browse the repository at this point in the history
  • Loading branch information
expede committed Jul 4, 2024
1 parent ccec3c3 commit 40af005
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,6 @@ Any selection MAY begin and/or end with a single dot. Multiple dots (e.g. `..`,

The try operator is idempotent, and repeated tries (`.foo???`) MUST be treated as a single one.

[jq] is a much larger language, and includes additional features like pipes, arithmatic, regexes, assignment, recursive descent, and so on which MUST NOT be supported in the UCAN Policy language.

For example, consider the following `args` from an `Invocation`:

``` json
Expand Down Expand Up @@ -427,6 +425,12 @@ null
</tbody>
</table>

### Differences from jq

[jq] is a much larger language than UCAN's selectors. jq includes features like pipes, arithmatic, regexes, assignment, recursive descent, and so on which MUST NOT be supported in the UCAN Policy language.

jq produces streams of values, in contract to UCAN argument selectors which return an IPLD value. This introduces the primary difference between jq and UCAN argument selectors is how to treat output of the try (`?`) operator: UCAN's `try` selector operator MUST return `null` for the failure case.

## Validation

Validation involves substituting the values from the `args` field into the Policy, and evaluating the predicate. Since Policies are tree structured, selector substitution and predicate evaluation MAY proceed in any order.
Expand Down

0 comments on commit 40af005

Please sign in to comment.