News for hackers. Stuff that matters.
Re:Jtc – CLI tool to extract, manipulate and transform sourc... by techie128 on Tuesday October 08, 2019 @07:26PM (#21198399)
It probably should not invent its own language or if it does, it should take inspiration from XPath/JSONPath which is arguably simpler.
Re:Jtc – CLI tool to extract, manipulate and transform sourc... by Rotareti on Tuesday October 08, 2019 @09:38PM (#21199153)
I agree. Modern SQL supports JSONPath. Postgresql 12 has support for it. A lot of people are/will be familiar with it.
Re:Jtc – CLI tool to extract, manipulate and transform sourc... by chrismorgan on Tuesday October 08, 2019 @11:19PM (#21199694)
Be careful with terminology: the thing defined in SQL:2016 is called the SQL/JSON path language, and although it’s similar to the older JSONPath, it’s not the same.

PostgreSQL also calls the SQL/JSON path language “JSON Path”, and the data type is called `JSONPATH`.

Re:Jtc – CLI tool to extract, manipulate and transform sourc... by Rotareti on Wednesday October 09, 2019 @08:13AM (#21202400)
Thanks for the clarification! I guess it would make a lot of sense for a tool such as jtc to use SQL/JSON path language then. I'm sure it'll be the most common JSON query language soon.
Re:Jtc – CLI tool to extract, manipulate and transform sourc... by hyperpallium on Thursday October 10, 2019 @03:28AM (#21211846)
> JsonPath has some drawbacks, such as a lack of operators for reaching parent or sibling nodes, -- https://www.baeldung.com/guide-to-jayway-jsonpath

Unfortunately, ".." just doesn't fit nicely with the "." operator of C-style languages.

I'm almost inclined to go full-XPath, and use "/", so I can use "..".