Skip to content

GH-4204: Add four GeoSPARQL 1.1 geometry metadata functions - #4205

Open
edmondchuc wants to merge 2 commits into
apache:mainfrom
edmondchuc:feat/geosparql-geometry-metadata-functions
Open

GH-4204: Add four GeoSPARQL 1.1 geometry metadata functions#4205
edmondchuc wants to merge 2 commits into
apache:mainfrom
edmondchuc:feat/geosparql-geometry-metadata-functions

Conversation

@edmondchuc

@edmondchuc edmondchuc commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

GitHub issue resolved #4204

Adds the following GeoSPARQL 1.1 geometry metadata functions:

  • geof:geometryType
  • geof:is3D
  • geof:isMeasured
  • geof:numGeometries

The functions are registered with ARQ and implemented through reusable GeometryWrapper operations.

Geometry type handling:

geof:geometryType needs to preserve the geometry type expressed by the source serialization. This is particularly relevant for GML, where types such as Curve, Surface, MultiCurve, and MultiSurface may be represented internally by different JTS geometry classes.

The implementation therefore:

  • preserves the original GML root geometry type during parsing;
  • caches the resolved geometry type URI in GeometryWrapper;
  • delegates serialization-specific type resolution to GeometryDatatype;
  • resolves constructed GML geometry types using the same JTS-to-GML mapping used by GMLWriter;
  • avoids reparsing GML or performing XML serialization/parsing round trips during normal geometryType evaluation.

  • Tests are included.
  • Documentation change and updates are provided for the Apache Jena website
  • Commits have been squashed to remove intermediate development commit messages.
  • Key commit messages start with the issue number (GH-xxxx)

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.


See the Apache Jena "Contributing" guide.

@edmondchuc
edmondchuc force-pushed the feat/geosparql-geometry-metadata-functions branch 2 times, most recently from 9190711 to ac00eec Compare September 8, 2026 05:03
Implement geometryType, is3D, isMeasured, and numGeometries with
reusable GeometryWrapper methods and ARQ registration.

Add documentation and tests covering geometry types, Z/M layouts,
empty geometries, member counts, and SPARQL error handling.
@edmondchuc
edmondchuc force-pushed the feat/geosparql-geometry-metadata-functions branch from ac00eec to 6d6e170 Compare September 8, 2026 05:35
Preserve source GML types during parsing and resolve constructed types through a mapping shared with the GML writer. Delegate type resolution to geometry datatypes and cache the result, avoiding XML round trips while retaining source subtypes.
@edmondchuc
edmondchuc force-pushed the feat/geosparql-geometry-metadata-functions branch from a102341 to 18bfdcd Compare September 10, 2026 06:31
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.

Add GeoSPARQL 1.1 geometry metadata functions

1 participant