Skip to content

Name each reader and writer of the object layer by its portable format - #65

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:io/type-support-portable-names
Nov 12, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:io/type-support-portable-names

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The object layer gives no method the role name In or Out: a reader or
writer the object model calls by its role (ooName in or out) is emitted
under the portable name of the format the catalog's typeEncodings says it
reads or writes, .From static and As instance, or
leaves the object layer when typeEncodings names it for no format, its
function staying in the flat Meos layer. tools/objectgen.py reads both
facts from the catalog in #portable_format and #take_portable_names,
which mirror the routines of the same name in GoMEOS's tools/objectgen.py:
tgeompoint_in is TGeomPoint.FromText, set_out Set.AsText, temporal_out
Temporal.AsText and stbox_out STBox.AsEWKT. The method keeps its body, so
the portable reader or writer that forwarded to it is not emitted beside
it, and a portable name the class already declares with the same
parameters would leave the method out as its duplicate. ToString calls
AsText, and for Text, whose text_out serves no format, Meos.TextOut.

Why. A binding reads and writes a type through From and
As alone (rules 1 and 2 of the bindings in the I/O plan,
MobilityDB #3353, row IO-B19), so no reader or writer is named by its
role beside the portable one it duplicates. Each class carried both:
FloatSpan.In beside FloatSpan.FromText, which called it, and Span.Out
beside the AsText of every span.

Witness. Against the catalog of MobilityDB master c5174b8af1 and MEOS-API
master cf4d124e6f, 88 methods were named In or Out. 74 take their portable
name: FromText for the 61 readers of the sets, spans, span sets, temporal
types, boxes, CBuffer, NPoint, NSegment, PoseChain, H3Index, Quadbin,
S2Cell, Jsonb, JsonPath and Numeric; AsText for the 11 writers set_out,
span_out, spanset_out, temporal_out, tbox_out, h3index_out, quadbin_out,
s2cell_out, jsonb_out, jsonpath_out and numeric_out; AsEWKT for stbox_out
and tpcbox_out. 14 leave the object layer, typeEncodings naming them for
no format: cbuffer_out, npoint_out, nsegment_out, pose_in, pose_out,
posechain_out, trgeometry_out, raquet_in, raquet_out, geo_out, geom_in,
geog_in, text_in and text_out. None is a duplicate: Jsonb.FromText(string)
over jsonb_in stands beside Jsonb.FromText(Text, bool) over
jsonb_from_text. The object layer goes from 5262 to 5158 methods over 155
classes, the 14 left out and 90 forwarding readers and writers, and two
runs of the generator write the same tree. Against the libmeos of that
master with every family, dotnet build passes with 0 warnings and dotnet
test passes 106 of 106 with none skipped, 3 of them reading sets, spans,
span sets, temporal values, boxes, Jsonb, JsonPath and Numeric with
FromText and writing them back with AsText or AsEWKT; the test floor of
the CI goes from 103 to 106.

MEOS.NET has no active committer: this needs another committer of the ecosystem to review and merge it.

The object layer gives no method the role name In or Out: a reader or
writer the object model calls by its role (ooName in or out) is emitted
under the portable name of the format the catalog's typeEncodings says it
reads or writes, <Class>.From<Format> static and As<Format> instance, or
leaves the object layer when typeEncodings names it for no format, its
function staying in the flat Meos layer. tools/objectgen.py reads both
facts from the catalog in #portable_format and #take_portable_names,
which mirror the routines of the same name in GoMEOS's tools/objectgen.py:
tgeompoint_in is TGeomPoint.FromText, set_out Set.AsText, temporal_out
Temporal.AsText and stbox_out STBox.AsEWKT. The method keeps its body, so
the portable reader or writer that forwarded to it is not emitted beside
it, and a portable name the class already declares with the same
parameters would leave the method out as its duplicate. ToString calls
AsText, and for Text, whose text_out serves no format, Meos.TextOut.

Why. A binding reads and writes a type through From<Format> and
As<Format> alone (rules 1 and 2 of the bindings in the I/O plan,
MobilityDB #3353, row IO-B19), so no reader or writer is named by its
role beside the portable one it duplicates. Each class carried both:
FloatSpan.In beside FloatSpan.FromText, which called it, and Span.Out
beside the AsText of every span.

Witness. Against the catalog of MobilityDB master c5174b8af1 and MEOS-API
master cf4d124e6f, 88 methods were named In or Out. 74 take their portable
name: FromText for the 61 readers of the sets, spans, span sets, temporal
types, boxes, CBuffer, NPoint, NSegment, PoseChain, H3Index, Quadbin,
S2Cell, Jsonb, JsonPath and Numeric; AsText for the 11 writers set_out,
span_out, spanset_out, temporal_out, tbox_out, h3index_out, quadbin_out,
s2cell_out, jsonb_out, jsonpath_out and numeric_out; AsEWKT for stbox_out
and tpcbox_out. 14 leave the object layer, typeEncodings naming them for
no format: cbuffer_out, npoint_out, nsegment_out, pose_in, pose_out,
posechain_out, trgeometry_out, raquet_in, raquet_out, geo_out, geom_in,
geog_in, text_in and text_out. None is a duplicate: Jsonb.FromText(string)
over jsonb_in stands beside Jsonb.FromText(Text, bool) over
jsonb_from_text. The object layer goes from 5262 to 5158 methods over 155
classes, the 14 left out and 90 forwarding readers and writers, and two
runs of the generator write the same tree. Against the libmeos of that
master with every family, dotnet build passes with 0 warnings and dotnet
test passes 106 of 106 with none skipped, 3 of them reading sets, spans,
span sets, temporal values, boxes, Jsonb, JsonPath and Numeric with
FromText and writing them back with AsText or AsEWKT; the test floor of
the CI goes from 103 to 106.

MEOS.NET has no active committer: this needs another committer of the ecosystem to review and merge it.
@estebanzimanyi
estebanzimanyi merged commit da2f5cf into MobilityDB:main Nov 12, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the io/type-support-portable-names branch November 12, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant