Skip to content

GH-4259: Add GeoSPARQL geometryType function - #4260

Merged
afs merged 2 commits into
apache:mainfrom
edmondchuc:feat/geosparql/geometry-type
Sep 27, 2026
Merged

afs merged 2 commits into
apache:mainfrom
edmondchuc:feat/geosparql/geometry-type

Conversation

@edmondchuc

@edmondchuc edmondchuc commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

GitHub issue resolved #4259

Add GeoSPARQL 1.1 geof:geometryType, returning the geometry subtype URI as an xsd:anyURI literal.

  • Map WKT geometries to Simple Features subtype URIs.
  • Preserve GML source subtypes such as Curve and Surface. For constructed GML geometries, derive the type from JTS without an XML round trip.
  • Cache the resolved type on GeometryWrapper, preserving it across copy constructors while ensuring derived geometries compute their own type.
  • Key the geometry-literal memory cache by datatype URI and lexical form so equal WKT and GML text cannot share a wrapper.

  • 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.

@afs

afs commented Sep 26, 2026

Copy link
Copy Markdown
Member

For the 4 open GeoSPARQL PRs, are they all good to merge now?

@edmondchuc

Copy link
Copy Markdown
Contributor Author

@afs yes, all 4 PRs are good to go! Thanks.

@afs

afs commented Sep 26, 2026

Copy link
Copy Markdown
Member

This one and #4231 have conflicts.

#4231 looks straight-forward (imports and javadoc) but overlaps with this one, and this one looks like it involves code differences.

No rush - just say on the PRs when ready.

@edmondchuc
edmondchuc force-pushed the feat/geosparql/geometry-type branch from 2f07d16 to 9c66efd Compare September 27, 2026 01:57
@edmondchuc

Copy link
Copy Markdown
Contributor Author

Thanks, merge conflicts resolved.

Preserve GML source subtypes when resolving geometry types. Cache the
resolved URI on GeometryWrapper and map constructed GML geometries
directly from JTS types to avoid an XML serialization round trip.

Add tests for GML subtypes, derived geometries, caching, and function
errors.
@edmondchuc
edmondchuc force-pushed the feat/geosparql/geometry-type branch from 4f1de76 to 2b01baa Compare September 27, 2026 08:55
Separate transformed WKT and GML wrappers when their lexical forms and target SRS are identical. Add a regression test for both cache insertion orders and the resulting datatype and subtype URIs.
@edmondchuc

Copy link
Copy Markdown
Contributor Author

Do you want me to move GeometryTransformIndexTest.java under index?

jena-geosparql/src/test/java/org/apache/jena/geosparql/implementation/index/

@afs

afs commented Sep 27, 2026

Copy link
Copy Markdown
Member

Would it be easier to merge this as-is and then do that on #4261?

#4261 is then a PR on the current state of main.

@edmondchuc

Copy link
Copy Markdown
Contributor Author

Sure thing!

@afs
afs merged commit f46dbf3 into apache:main Sep 27, 2026
1 check passed
@afs

afs commented Sep 27, 2026

Copy link
Copy Markdown
Member

Done - thank you!

@edmondchuc
edmondchuc deleted the feat/geosparql/geometry-type branch September 27, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GeoSPARQL 1.1 geof:geometryType

2 participants