jsonpath

Documents the JSONPath grammar, evaluators, and semantic divergences of the strata search subsystem.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/PrimeLab-Foundation/strata --skill jsonpath-primelab-foundation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jsonpath
Source: https://github.com/PrimeLab-Foundation/strata/tree/main/docs/jsonpath
Command: npx skills add https://github.com/PrimeLab-Foundation/strata --skill jsonpath-primelab-foundation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on strata's JSONPath subsystem without this reference risks reintroducing known defects, misusing the wrong evaluator, or violating the enforced API split between query() and search(). This Skill consolidates the supported grammar, the three live evaluators, and every known semantic divergence into one operational guide. ## Core Features & Use Cases - Grammar Reference: Details the supported RFC 9535 subset (fields, wildcards, indices, slices, recursive descent, filters) plus everything that is intentionally unsupported, such as unions, $..*, and && / || operators. - Evaluator Architecture: Explains the PyObject-native, SAX streaming, and C++ DOM evaluators, when each is selected, and the is_streamable() gating rules that route search() calls. - Divergence & Defect Tracking: Records known semantic divergences (recursive descent into matches, bool coercion in filters, integer precision limits) and defects not to reproduce, such as the RuntimeError leak on unclosed quoted strings. - Use Case: Before modifying src/strata/search/, python_jsonpath.cpp, or python/strata/jsonpath.py, load this Skill to confirm which evaluator owns the behavior, which tests pin it, and which fallback law (search(f, e) == query(load(f), e)) must hold. ## Quick Start Load the jsonpath skill before editing any file under src/strata/search/ or the Python JSONPath bindings so the grammar contract and evaluator routing rules are in context.

Frequently Asked Questions about jsonpath

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query JSON data with JSONPath in strata?

Use strata.query(data, expression) for in-memory dicts, lists, or tuples, and strata.search(path, expression) for .json, .ndjson, or .jsonl files and directories. For repeated queries, strata.compile(expression) returns a CompiledPath whose execute method runs over a cursor.

What JSONPath syntax does strata support?

Strata supports a subset of RFC 9535: the $ root, dot and bracket field access, wildcards, array indices including negatives, slices, recursive descent (..field), and filters with ==, !=, >, >=, <, <= against numeric or quoted-string values. Unions, $..*, && / ||, nested filter paths, and regex are not supported.

What is the difference between strata query and search?

query() accepts only Python dict, list, or tuple objects and raises TypeError otherwise, while search() accepts only file or directory paths. The law search(f, e) == query(load(f), e) holds by construction, with search optionally using a faster SAX streaming evaluator for plain paths.

Why does strata search fall back to full parsing for some JSONPath expressions?

The SAX streaming evaluator only handles plain paths made of Field, Wildcard, and non-negative Index steps under the default FirstWins duplicate-key policy. Recursive descent, slices, filters, negative indices, other policies, and NDJSON inputs fall back to load-then-query, which is definitionally exact.

Does strata JSONPath preserve large integers in query results?

The PyObject-native evaluator behind query() and search() preserves exact integers at any size. The C++ DOM evaluator behind CompiledPath.execute converts numbers to doubles, so integers above 2^53 lose precision on that path.

Why does a negative slice step return an empty list in strata JSONPath?

A negative slice step parses successfully but the evaluators only loop for step greater than zero, so the result is an empty list. This is a documented silent quirk of the current implementation, not a parse error.