Draft: draft-ietf-jsonpath-base

Commentary: Both :-) ( Let ’s do that consciously in the next PR . )  ,     work . I consider this an overall improvement ... thanks .
Paragraph (version A):
JSONPath defines a string syntax for identifying values within a
JavaScript Object Notation (JSON, RFC 8259) value.
Paragraph (version A):
Discussion of this document takes place on the JSON Path Working
Group mailing list (jsonpath@ietf.org), which is archived at
https://mailarchive.ietf.org/arch/browse/jsonpath/ [1].  Source for
this draft and an issue tracker can be found at https://github.com/
ietf-wg-jsonpath/draft-ietf-jsonpath-jsonpath [2].
Paragraph (version B):
JSONPath defines a string syntax for selecting and extracting values
within a JavaScript Object Notation (JSON, RFC 8259) value.
Paragraph (version A):
This document picks up Stefan Goessner's popular JSONPath
specification dated 2007-02-21 JSONPath-orig and provides a normative
definition for it.
Paragraph (version B):
This document picks up Stefan Goessner's popular JSONPath proposal
dated 2007-02-21 JSONPath-orig and provides a normative definition
for it.
Paragraph (version A):
A JSONPath query is a string which selects zero or more nodes of a
piece of JSON.  A valid query conforms to the ABNF syntax defined by
this document.
Paragraph (version A):
A query MUST be encoded using UTF-8.  To parse a query according to
the grammar in this document, its UTF-8 form SHOULD first be decoded
into Unicode code points as described in RFC3629.
Paragraph (version A):
The well-formedness and the validity of JSONPath queries are
independent of the value the query is applied to; no further errors
can be raised during application of the query to a value.
Paragraph (version B):
A JSONPath query is a string which selects zero or more nodes of a
piece of JSON.
Paragraph (version B):
A query MUST be encoded using UTF-8.  The grammar for queries given
in this document assumes that its UTF-8 form is first decoded into
Unicode code points as described in RFC3629; implementation
approaches that lead to an equivalent result are possible.
Paragraph (version B):
The well-formedness and the validity of JSONPath queries are
independent of the JSON value the query is applied to; no further
errors can be raised during application of the query to a value.
Paragraph (version B):
Obviously, an implementation can still fail when executing a JSONPath
query, e.g., because of resource depletion, but this is not modeled
in the present specification.  However, the implementation MUST NOT
silently malfunction.  Specifically, if a valid JSONPath query is
evaluated against a structured value whose size doesn't fit in the
range of exact values, interfering with the correct interpretation of
the query, the implementation MUST provide an indication of overflow.
Paragraph (version A):
Index selector "[<index>]", where "<index>" is either an (possibly
negative) array index or an object member name.
Paragraph (version A):
Array slice selector "[<start>:<end>:<step>]", where "<start>",
"<end>", "<step>" are integer literals.
Paragraph (version B):
Index selector "[<index>]", where "<index>" is either a (possibly
negative, see index-semantics) array index or an object member
name.
Paragraph (version B):
Array slice selector "[<start>:<end>:<step>]", where the optional
values "<start>", "<end>", and "<step>" are integer literals.
Paragraph (version A):
The "dot-selector" selects the node of the member value corresponding
to the member name from any JSON object.  It selects no nodes from
any other JSON value.
Paragraph (version B):
The "dot-selector" selects the node of the member value corresponding
to the member name from any JSON object in its input nodelist.  It
selects no nodes from any other JSON value.
Paragraph (version A):
The dot wild card selector has the form ".*".
Paragraph (version A):
A "dot-wild-selector" acts as a wild card by selecting the nodes of
all member values of an object as well as all element nodes of an
array.  Applying the "dot-wild-selector" to a primitive JSON value
(number, string, or true/false/null) selects no node.
Paragraph (version B):
A "dot-wild-selector" acts as a wild card by selecting the nodes of
all member values of an object in its input nodelist as well as all
element nodes of an array in its input nodelist.  Applying the "dot-
wild-selector" to a primitive JSON value (number, string, or
true/false/null) selects no node.
Paragraph (version A):
Applying the "index-selector" to an array, a numerical "element-
index" is required.  JSONPath allows it to be negative.
Paragraph (version A):
Notes: 1. "double-quoted" strings follow JSON in RFC8259; "single-
quoted" strings follow an analogous pattern.  2.  An "element-index"
is an integer (in base 10, as in JSON numbers).  3.  As in JSON
numbers, the syntax does not allow octal-like integers with leading
zeros such as "01" or "-01".
Paragraph (version B):
Applying the "index-selector" to an array, a numerical "element-
index" is required to select the corresponding element.  JSONPath
allows it to be negative (see index-semantics).
Paragraph (version B):
Notes: 1. "double-quoted" strings follow the JSON string syntax
(RFC8259); "single-quoted" strings follow an analogous pattern
(syntax-index).  2.  An "element-index" is an integer (in base 10, as
in JSON numbers).  3.  As in JSON numbers, the syntax does not allow
octal-like integers with leading zeros such as "01" or "-01".
Paragraph (version A):
A negative "element-index" counts from the array end.  For example,
selector "[-1]" selects the last and selector "[-2]" selects the last
but one element of an array with at least two elements.
Paragraph (version B):
A negative "element-index" counts from the array end.  For example,
selector "[-1]" selects the last and selector "[-2]" selects the
penultimate element of an array with at least two elements.  As with
non-negative indexes, it is not an error if such an element does not
exist; this simply means that no element is selected.
Paragraph (version A):
When "step" is "0", no elements are selected.  This is the one case
which differs from the behaviour of Python, which raises an error in
this case.
Paragraph (version A):
An implementation MUST raise an error if any of the slice expression
parameters does not fit in the implementation's representation of an
integer.  If a successfully parsed slice expression is evaluated
against an array whose size doesn't fit in the implementation's
representation of an integer, the implementation MUST raise an error.
Paragraph (version B):
To be valid, the slice expression parameters MUST be in the I-JSON
range of exact values, see synsem-overview.
Paragraph (version A):
The union selector is syntactically related to the "index-selector".
It contains multiple, comma separated entries.
Paragraph (version B):
The union selector is syntactically related to the "index-selector".
It contains two or more entries, separated by commas.
Paragraph (version B):
To be valid, integer values in the "element-index" and "slice-index"
components MUST be in the I-JSON range of exact values, see synsem-
overview.
Paragraph (version B):
A member or element value by itself in a Boolean context is
interpreted as "false" only if it does not exist.  Otherwise it is
interpreted as "true".  To be more specific about the actual
value, explicit comparisons are necessary.  This existence test --
as an exception to the general rule -- also works with structured
values.