-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Pr 98 (selectors reworked) #99
Conversation
@cabo/@goessner can you rename the PR to better reflect what it's trying to do, please? Also a summary of changes would be kind. |
I understood that multiple small PR's are preferrable, which was not so
easy with the complete rewrite of selectors. I can do that from now on.
Am 11.06.2021 um 05:42 schrieb Greg Dennis:
…
@goessner <https://github.com/goessner> can you rename the PR to
better reflect what it's trying to do, please? Also a summary of
changes would be kind.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFM6WUCDKLUZXFSHFSYTHTTSGA2JANCNFSM46PBITVQ>.
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
Virenfrei. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
|
@goessner Do you mean you will now break this PR into multiple small PRs? (That would be great!) |
Notes: | ||
|
||
* Parenthesis can be used with `boolean-expr` for grouping. So filter selection syntax in the original proposal `'[?(<expr)]'` is naturally contained in the current lean syntax `'[?<expr]'` as a special case. | ||
* Comparisons are restricted to primitive values `number`, `string`, `true`, `false`, `null`. Comparisons with complex values will fail, i.e. no selection occurs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than fail silently, another option would be to avoid this situation in the syntax. Then failures will produce a syntax error, which is much clearer to the user. Have you checked for consensus of current implementations? This issue comment is relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually like to be able to say @.foo == [1,2]
. I think this is a valid use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it appears we need a new issue.
- Comparison with structured values
- Should comparison with structured values (e.g.,
@.foo == [1, 2]
) be supported? - If it is not supported, should this silently fail or the attempt cause a syntax error (in Updated Pr 98 (selectors reworked) #99, it causes a syntax error, but then the text says something else).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few initial impressions.
@@ -97,6 +97,13 @@ informative: | |||
seriesinfo: | |||
ISO/IEC 22537:2006 | |||
date: 2006 | |||
E4X-overview: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this -- this seems to be a remnant from an older revision.
There are several such remnants, which make it hard to review this PR.
It also selects all the elements of any array node. | ||
It selects no nodes from | ||
number, string, or literal nodes. | ||
The Argument — the root JSON value – is anonymous by nature. By getting assigned the universal name `'$'` it becomes the root node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing the actual characters instead of HTML entity references is preferred.
The same dashes should be used at the start and at the end of an interjection.
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" | ||
; case insensitive hex digit | ||
~~~~ abnf | ||
quoted-member-name = %x22 *double-quoted %x22 / ; "string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a separate set of definitions for literals. This is particular important because JSONPath literals have a more permissive syntax than that of JSON. (Should they?)
Literals should never be confused with the data themselves (i.e., we never should say "string" when we mean "string literal").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literals should never be confused with the data themselves (i.e., we never should say "string" when we mean "string literal").
What? When was this discussed? Do we now have to say "boolean literal" or "numeric literal?" Where does JSON Path ever use strings that AREN'T a string literal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literals should never be confused with the data themselves (i.e., we never should say "string" when we mean "string literal").
What? When was this discussed?
I wasn't there. Must have been before 1972, but I'm pretty sure after 1960.
Do we now have to say "boolean literal" or "numeric literal?"
If we mean the literal, yes. If we mean the value, no.
The important part is to make the distinction.
Where does JSON Path ever use strings that AREN'T a string literal?
The strings in the argument are no longer literals at the time we get them.
Also, as soon as a string literal in the query is parsed, it is the resulting value that is then used; different literals for the same value are not distinguishable for the purposes of the language.
Of course, all this can be done differently, but that is the way it has been done in language design for approximately half a century.
------------------------------------------------------------------------
In draft-ietf-jsonpath-base.md
<#99 (comment)>:
> @@ -97,6 +97,13 @@ informative:
seriesinfo:
ISO/IEC 22537:2006
date: 2006
+ E4X-overview:
I don't think we need this -- this seems to be a remnant from an older
revision.
There are several such remnants, which make it hard to review this PR.
oops ... should have been ES4 overview
http://archives.ecma-international.org/2007/misc/overview.pdf
Here array slice is documented the first time (pg.34) ... that's all.
We can leave it out.
>
#### Semantics
{: numbered="false" toc="exclude"}
-A dot child name which is not a single asterisk (`*`) is considered to
-have a member name.
-It selects the value corresponding to the name from any object node.
-It selects
-no nodes from a node which is not a object.
-
-The member name of a dot child name is the sequence of Unicode characters contained
-in that name.
-
-A dot child name consisting of a single asterisk is a wild card. It selects
-all the values of any object node.
-It also selects all the elements of any array node.
-It selects no nodes from
-number, string, or literal nodes.
+The Argument — the root JSON value – is anonymous by nature. By getting assigned the universal name `'$'` it becomes the root node.
Writing the actual characters instead of HTML entity references is
preferred.
– is not accessible per keyboard.
The same dashes should be used at the start and at the end of an
interjection.
yes .. typo ..
|
yes .. we need a new issue here .. let's discuss.
Am 11.06.2021 um 10:12 schrieb cabo:
…
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In draft-ietf-jsonpath-base.md
<#99 (comment)>:
> +in-op = " in " ; in operator
+comparable = number / quoted-string / ; primitive ...
+ true / false / null / ; values only
+ rel-path-val / ; descendant value
+ calc_val / ; calculated value
+ json-path ; any value
+
+rel-path-val = "@" *(dot-selector / index-selector)
+calc_val = func "(" [rel-path-val / json-path] ")"
+func = "index"
+~~~~
+
+Notes:
+
+* Parenthesis can be used with `boolean-expr` for grouping. So filter selection syntax in the original proposal `'[?(<expr)]'` is naturally contained in the current lean syntax `'[?<expr]'` as a special case.
+* Comparisons are restricted to primitive values `number`, `string`, `true`, `false`, `null`. Comparisons with complex values will fail, i.e. no selection occurs.
So it appears we need a new issue.
* Comparison with structured values
* Should comparison with structured values (e.g., ***@***.*** == [1, 2]|)
be supported?
* If it is not supported, should this silently fail or the attempt
cause a syntax error (in #99
<#99>,
it causes a syntax error, but then the text says something else).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFM6WUPIASBBK4FBC2V2EDTSHAQNANCNFSM46PBITVQ>.
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
Virenfrei. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
|
> + E4X-overview:
oops ... should have been ES4 overview
http://archives.ecma-international.org/2007/misc/overview.pdf
Here array slice is documented the first time (pg.34) ... that's all.
We can leave it out.
I don’t have a strong opinion here, but I think we are better off referencing the current state in ES2020 (also applies to {{SLICE}}).
(The bibliography entry `E4X-overview` turned up in my quick glance at the PR because it is not currently being used. So we need to add a citation or remove the entry. This is all housekeeping… Let’s try to extract the technical discussion points first.)
Grüße, Carsten
|
It sure is. If you are using Windows: |
ahh ... learning something new .. only*alt+0151 *on numeric keyboard
works for me.**
Am 14.06.2021 um 10:07 schrieb cabo:
…
– is not accessible per keyboard.
It sure is.
This probably should be an |—|, however.
If you are using Windows:
https://softwareaccountant.com/em-dash-in-word/
<https://softwareaccountant.com/em-dash-in-word/>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFM6WX7H6MN745JDHKUEKTTSW2DBANCNFSM46PBITVQ>.
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
Virenfrei. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
|
On 2021-06-14, at 10:28, Stefan Goessner ***@***.***> wrote:
ahh ... learning something new .. only*alt+0151 *on numeric keyboard
works for me.**
… and I think this is even easier to type than — …
(Shift-Option-minus on the Mac.
On the iPad or iPhone, long-press the minus and swipe to the character you want.)
Grüße, Carsten
|
@cabo please rebase |
Covered by #102 now. |
mit Fix für den YAML-nit