Hacker News new | ask | show | jobs
by jeremiahbuckley 776 days ago
1. Create a mock json document that has the structure you are trying to query.

2. Ask [newest LLM] to write the proper json path to get to the element you want to reach.

1 comments

Seems easier to create a program where you can click the element and it shows the jsonpath itself
There’s nothing thing wrong with that approach if you’re working with jsonpaths on the regular. It’s all about time management, I guess. With json, and xml, and probably yaml, there is this recurring long-term pattern of:

1. Creat tree-structure document format that is flexible enough to handle all use cases.

2. Write a ton of content in this format.

3. Have to figure out a query pattern to accurately retrieve good info out of these structures.

Generally, I feel we’ve become good at querying normalized table data. But—-and maybe it’s just me being stupid—-wending through tree-structured data is still tricky. And I recently discovered LLMs are great at solving for it, if you ask clearly.

The thing about querying tree-structured data being currently humanly harder than tabular data rings true to me, I always struggle with some very simple tree-sitter queries.