GH-4230: Add GeoSPARQL 1.1 geometryN function - #4231
Merged
Merged
Conversation
edmondchuc
force-pushed
the
feat/geosparql/geometry-n-function
branch
4 times, most recently
from
September 17, 2026 10:52
37b5b05 to
4a6c59c
Compare
Member
|
I see changes to the GML and WKT readers and writers. Is existing the test suite coverage (org/apache/jena/geosparql/implementation/parsers/) sufficient? |
edmondchuc
force-pushed
the
feat/geosparql/geometry-n-function
branch
from
September 26, 2026 02:33
dfebf60 to
1553c96
Compare
Contributor
Author
|
I’ve updated the tests so that the WKT and GML reader/writer changes are now in their existing parser test classes. |
Member
|
Do you want to keep as 2 commits or can we squash-and-merge this PR? |
Contributor
Author
|
Fine to squash merge, thanks. |
4 tasks
Add one-based member selection through geof:geometryN, retaining the selected member's datatype, SRS and layout. Accept only xsd:integer indexes, including integer-derived types such as xsd:short. Round-trip empty members in homogeneous WKT Multi geometries, including empty aggregates whose Z/M/ZM marker differs from the enclosing collection, and empty GML polygons whose CRS is 3D.
Put WKT and GML regression tests in their reader and writer test classes, and move dimension and geometry selection tests into their existing test classes. Preserve the coordinate layout of all-empty GML Surface patches.
edmondchuc
force-pushed
the
feat/geosparql/geometry-n-function
branch
from
September 27, 2026 01:51
1553c96 to
92a34e2
Compare
Contributor
Author
|
@afs merge conflicts resolved. |
afs
approved these changes
Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub issue resolved #4230
Adds GeoSPARQL 1.1
geof:geometryNandGeometryWrapper.getGeometryN(int)to select a direct member of a geometry.The result preserves the member’s datatype, SRS, and coordinate layout, including when that member is empty.
For example,
geof:geometryN("MULTIPOINT ((1 2), (3 4))"^^geo:wktLiteral, 2)returnsPOINT (3 4)as a WKT literal.xsd:integeror an integer-derived type. Invalid indices and geometry arguments raise SPARQL expression errors. An empty collection has no selectable member.The parser and writer changes are needed because selecting a member must produce a literal that can be serialized and read again without losing its structure or dimensions.
The tests cover selection and errors through SPARQL, plus direct WKT/GML round trips and dimension handling in the existing reader, writer, and geometry test classes.
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.