From 67205f49b3d7947dae19f597b746d24df656536c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 3 Sep 2026 10:21:24 +0200 Subject: [PATCH] Give the json path the class its own type carries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `JsonPath` is a MeosType — `T_JSONPATH`, named `jsonpath` in MEOS_TYPE_NAMES — declared in the umbrella `meos_json.h` with the `in`/`out`/`copy` trio every other value type has, and reached through a pointer. So it belongs in `Value` beside `Jsonb`, and its absence leaves the nine signatures naming it untypable: `jsonb_path_exists`, `jsonb_path_match`, `jsonb_path_query_all`, `jsonb_path_query_array`, `jsonb_path_query_first` and their temporal twins say nothing to a binding that has no class for the path they take. No membership predicate admits the type, so nothing derives it and the model states it, exactly as it states `Nsegment` and `Raquet`. The coverage gate says which three those are, so the set cannot grow unnoticed. --- docs/object-model.md | 7 ++++--- meta/object-model.json | 10 ++++++++++ tests/test_object_model.py | 3 ++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/object-model.md b/docs/object-model.md index 1dd0809..a452dc1 100644 --- a/docs/object-model.md +++ b/docs/object-model.md @@ -113,7 +113,7 @@ hierarchies — `Box` (`TBox`, `STBox`, `TPCBox`), `Collection` tstz/geo/… leaves) and `Value` — and `objectModel.algebra` records which companion a temporal family yields. -`Value` holds the base values themselves: `Text`, `Jsonb`, `Geo` over +`Value` holds the base values themselves: `Text`, `Jsonb`, `JsonPath`, `Geo` over `Geometry` and `Geography` (both a `GSERIALIZED`, parented exactly as `TGeo` parents `TGeometry` and `TGeography`), `Cbuffer`, `Npoint`, `Nsegment`, `Pose`, `PoseChain`, `Pcpoint`, `Pcpatch` and `Raquet`. A @@ -123,8 +123,9 @@ a `uint64`, need no class and the ten by-reference base types do. `DriftGate::test_every_byreference_base_type_has_a_value_class` derives that set from the two predicates and fails until each has a class, so a base type MEOS adds reaches the model with no edit to the file. -`Nsegment` and `Raquet` are the two MeosTypes no membership predicate -admits; the model states them, and the same gate states that it does. +`Nsegment`, `Raquet` and `JsonPath` are the MeosTypes no membership +predicate admits; the model states them, and the same gate states that it +does. `Box` is covered the same way, from the `type_bboxtype` column of `MEOS_RELTYPE_CATALOG`: it names the box each type stores, so its diff --git a/meta/object-model.json b/meta/object-model.json index c472f66..955cd2e 100644 --- a/meta/object-model.json +++ b/meta/object-model.json @@ -593,6 +593,16 @@ "conditional": "JSON", "doc": "PostgreSQL jsonb, the base type of TJsonb and JsonbSet." }, + "JsonPath": { + "kind": "leaf", + "parent": "Value", + "prefixes": [ + "jsonpath" + ], + "temptype": "T_JSONPATH", + "conditional": "JSON", + "doc": "A path into a jsonb value. A MeosType no membership predicate admits, as Nsegment and Raquet are; the nine signatures naming it are what need it." + }, "Geo": { "kind": "abstract", "parent": "Value", diff --git a/tests/test_object_model.py b/tests/test_object_model.py index ae44175..f9537df 100644 --- a/tests/test_object_model.py +++ b/tests/test_object_model.py @@ -599,7 +599,8 @@ def test_every_byreference_base_type_has_a_value_class(self): self.assertEqual(needed - set(seen), set(), "a base type MEOS passes by reference has no Value " "class, so every method naming it stays untypable") - self.assertEqual(set(seen) - needed, {"T_NSEGMENT", "T_RAQUET"}, + self.assertEqual(set(seen) - needed, + {"T_NSEGMENT", "T_RAQUET", "T_JSONPATH"}, "the Value classes MEOS admits without making them " "base types moved; each is a MeosType a signature " "names, and this states which")