Top
Best
New

Posted by wofo 10/27/2025

Show HN: JSON Query(jsonquerylang.org)
I'm working on a tool that will probably involve querying JSON documents and I'm asking myself how to expose that functionality to my users.

I like the power of `jq` and the fact that LLMs are proficient at it, but I find it right out impossible to come up with the right `jq` incantations myself. Has anyone here been in a similar situation? Which tool / language did you end up exposing to your users?

154 points | 70 commentspage 2
ccvannorman 10/27/2025|
I can't help myself and surely someone else has already done the same. But the query

  obj.friends.filter(x=>{ return x.city=='New York'})
  .sort((a, b) => a.age - b.age)
  .map(item => ({ name: item.name, age: item.age }));
does exactly the same without any plugin.

am I missing something?

joshribakoff 10/27/2025|
The verbosity.

To your point abstractions often multiply and then hide the complexity, and create a facade of simplicity.

eknkc 10/27/2025||
Most alternatives being talked about are working on query strings (like `$.phoneNumbers[:1].type`) which is fine but can not be easily modeled / modified by code.

Things like https://jsonlogic.com/ works better if you wish to expose a rest api with a defined query schema or something like that. Instead of accepting a query `string`. This seems better as in you have a string format and a concrete JSON format. Also APIs to convert between them.

Also, if you are building a filter interface, having a structured representation helps:

https://react-querybuilder.js.org/demo?outputMode=export&exp...

throwaway091025 10/27/2025|
JSON logic is nice, but for example, the Python bindings were last updated 8 years ago
hyperhello 10/27/2025||
.friends | filter(.city == "New York") | sort(.age) | pick(.name, .age)

mapValues(mapKeys(substring(get(), 0, 10)))

This is all too cute. Why not just use JavaScript syntax? You can limit it to the exact amount of functionality you want for whatever reason it is you want to limit it.

kunley 10/28/2025||
Lot of people focus on a similarity to jq et al, I guess the author had his reasons to craft own stuff.

Kudos for all the work, it's a nice language. I find writing parsers a very mind-expanding activity.

memelang 10/27/2025||
I've been working on an ultra-token-efficient LLM-friendly query language. https://memelang.net/09/
gnarlouse 10/27/2025|
Cool idea! Although without looking closer I can't tell if "meme" is in reference to the technical or the colloquial meaning of meme.

Admittedly I don't know that much about LLM optimization/configuration, so apologies if I'm asking dumb questions. Isn't the value of needing to copy/paste that prompt in front of your queries a huge bog on net token efficiency? Like wouldn't you need to do some hundred/thousand query translations just to break even? Maybe I don't understand what you've built.

Cool idea either way!

memelang 10/27/2025||
Thank you. That script prompt is just for development and exploration. A production model needs to be trained/fine-tuned on Memelang first. We're working on this now. The math says we can deliver a model 1/2 the size of an equivalent model for SQL.
peterohler 10/27/2025||
If you prefer JSONPath as a query language, oj from https://github.com/ohler55/ojg provides that functionality. It can also be installed with brew. (disclaimer, I'm the author of OjG)
tyre 10/27/2025|
JSONPath is also supported by Postgres!

Helpful when querying JSON API responses that are parsed and persisted for normal, relational uses. Sometimes you want to query data that you weren’t initially parsing or that matches a fix to reprocess.

Eric_WVGG 10/27/2025||
speaking of classic databases: can anyone explain to me, a dummy, why any syntax like this or even GraphQL is preferable to "select a.name, a.age from friends a where a.city = 'New York' order by a.age asc"?
lenkite 10/27/2025||
There are a ridiculous number of JSON query/path languages. Wish all the authors got together and harmonized on a standard.
thayne 10/27/2025||
There is a standard in RFC 9535 (JSONPath)[1]. But as far as I can tell, it isn't very widely used, and it has more limited functionality than some of the alternatives.

[1]: https://datatracker.ietf.org/doc/html/rfc9535

lelandbatey 10/27/2025|||
Don't forget the also standardized way of referring to a single value in JSON, "JSON Pointer": datatracker.ietf.org/doc/html/rfc6901
phpnode 10/27/2025||||
the issue with JSONPath is that it took 17 years for it to become a properly fleshed-out standard. The original idea came from a 2007 blog post [0], which was then extended and implemented subtly differently dozens of times, with the result that almost every JSON Path implementation out there is incompatible with the others.

[0] https://goessner.net/articles/JsonPath/

NewJazz 10/27/2025|||
Postgresql supports jsonpath, right?
Groxx 10/27/2025||
SQLite might too, though I'm struggling to find anything explicit about the syntax: https://sqlite.org/json1.html#jptr

it might just be a very limited subset?

NewJazz 10/27/2025||
Looks like "JSON Pointer": datatracker.ietf.org/doc/html/rfc6901
thayne 10/28/2025||
JSON pointer uses very different syntax. Sqlite looks like it uses something that is very similar to, but not quite compatible with, JSONPath.
cmckn 10/27/2025|||
The AWS CLI supports JMESPath (https://jmespath.org) for the `--query` flag. I don't think I've run into anything else that uses it. Pretty similar to JSONPath IIRC.
gegtik 10/27/2025||
azure tools also support JMESPath
nartho 10/27/2025|||
Plus, I feel like most, if not all, higher level languages already come with everything you need to do that easily. Well except for go that requires you to create your own filter function.
voidfunc 10/27/2025|||
The standard is called jq, any new standard is just going to be a committee circle jerk that doesn't move the ball forward in any meaningful way.
lenkite 10/27/2025||
jq is good but its syntax is strangely unmemorizable. Have used it for a decade and always need to look at the manual or at examples to refresh my knowledge.
miohtama 10/27/2025||
Xkcd.gif
ksclarke 10/28/2025||
https://www.jsoniq.org -- jq is ubiquitous, but I still prefer the jsoniq syntax.
ivanjermakov 10/27/2025||
jq is amazing (not only for querying json), I recommend going though the docs, it's fairly small.

I implemented one day of advent of code in jq to learn it: https://github.com/ivanjermakov/adventofcode/blob/master/aoc...

hk1337 10/27/2025|
What do your users know? If they’re quite familiar with SQL for querying, I would look at duckdb.
More comments...