Earlier quoted context omitted.
Isn't that what we want? I would think that solving the same problems for a less verbose format is a good thing. And looking at the examples and the library support ( http://jmespath.org/libraries.html ) I would say this solves a real problem. I can already think of several use cases for my own system. The fact that a solution is treading familiar ground does not invalidate its utility.
It's not very much less verbose, really. You still need a key and a value. The only thing you lose, really, is the end tag. For a complex text document in say TEI or Docbook, I don't see how this is much of an advantage.
JMESPath – A query language for JSON
121–130 of 131 posts
Re: JMESPath – A query language for JSON
#122Earlier quoted context omitted.
No, those are query languages akin to XPath.
What's the difference between query and transformation then? Isn't transformation a (vector) function ^f of input ^x, with n dimensions of x and m dimensions of f where f_i = f_i(x_1, ... x_n)?
Re: JMESPath – A query language for JSON
#123Earlier quoted context omitted.
> and cannot be serialized like jsonlib.encode(foo) Huh? Could have fooled me. In Cocoa, for example, serializing to JSON and serializing to an XML property list (or binary property list) is effectively the same code. https://developer.apple.com/documentation/foundation/nsjsons... https://developer.apple.com/documentation/foundation/nsprope...
Yes, but property list is a subset of XML and Cocoa’s almost internal format. It doesn’t even connect keys to values, probably losing all the xpath/xslt/etc abilities. No custom schema too?
Re: JMESPath – A query language for JSON
#124Earlier quoted context omitted.
Ideally, use a library that intelligently parses dates as part of a turing complete validator.
The point is that you can't always avoid scenarios with keeping something updated. List of countries is another example.
I wrote some example code below that shows how you can validate with list of countries in such a way that no code changes will be required when the list changes.
Re: JMESPath – A query language for JSON
#125Re: JMESPath – A query language for JSON
#126Earlier quoted context omitted.
Is this for an open source project, or anything you'll be publishing? I'd be interested to follow on with the results!
Right now it is just an effort to develop a tool to diagnose and hopefully thereafter fix random performance problems we are experiencing with one of our applications in production. Despite having a small team dedicated to investigating the problems, monitoring every click and function call with Dynatrace, having had a Microsoft SQL server expert look into it, and getting the system audited by one of the big consulti…
Re: JMESPath – A query language for JSON
#127Earlier quoted context omitted.
I love libraries like this, which is small enough to be read in one sitting. I can scan through and get a general understanding of everything that it does. The "evaluation of sub-expressions" made me curious. This line: token.func = Function('_,i,args', 'return ' + token.val); ..could be a potential security issue with user-submitted expressions?
Thanks. I doubt this could be a security issue. Typical usage like so var name = one(users, '[_.id==?].name', 123) uses parameterized queries, same idea as with SQL to eliminate injections.
Re: JMESPath – A query language for JSON
#128Earlier quoted context omitted.
The "reinvention" is not complete and will never be necessary. The difference is that XPath is necessary to query XML because it's a botched horribly overcomplicated, designed-by-committee markup language. Except for tools like jq no such language is actually required for JSON because it maps on to language structures that always exist. Neither JSON schema or XML schema are particularly popular - and for good reason.…
There's a lot of benefit to being able to state what keys may be specified in a certain location, though. Look at DSLs like Cloudformation, for instance. Having schema validation could make static analysis of this kind of code much easier to handle. E.g.: Fn::Sub may be used inside of Fn::Join, but the reverse is not true, regardless of the types "returned" by each. It's certainly possible to validate via the api, bu…
There is. I find examples - snippets of XML/JSON - to be the best way of communicating this - not schema languages.
Re: JMESPath – A query language for JSON
#129Re: JMESPath – A query language for JSON
#130https://ci.mines-stetienne.fr/sparql-generate/playground.htm...