Aklakan commented on code in PR #3480:
URL: https://github.com/apache/jena/pull/3480#discussion_r2403904966


##########
jena-geosparql/src/main/java/org/apache/jena/geosparql/geo/topological/GenericPropertyFunction.java:
##########
@@ -189,18 +183,7 @@ private QueryIterator findAll(Graph graph, Node boundNode, 
Node unboundNode, Bin
     }
 
     private static ExtendedIterator<Triple> findSpatialTriples(Graph graph) {
-        ExtendedIterator<Triple> spatialTriples;
-        if (graph.contains(null, RDF.type.asNode(), Geo.SPATIAL_OBJECT_NODE)) {
-            spatialTriples = graph.find(null, RDF.type.asNode(), 
Geo.SPATIAL_OBJECT_NODE);
-        } else if (graph.contains(null, RDF.type.asNode(), Geo.FEATURE_NODE) 
|| graph.contains(null, RDF.type.asNode(), Geo.GEOMETRY_NODE)) {
-            ExtendedIterator<Triple> featureTriples = graph.find(null, 
RDF.type.asNode(), Geo.FEATURE_NODE);
-            ExtendedIterator<Triple> geometryTriples = graph.find(null, 
RDF.type.asNode(), Geo.GEOMETRY_NODE);
-            spatialTriples = featureTriples.andThen(geometryTriples);
-        } else {
-            //Check for Geo Predicate Features in the Graph if no 
GeometryLiterals found.
-            spatialTriples = graph.find(null, SpatialExtension.GEO_LAT_NODE, 
null);
-        }
-        return spatialTriples;
+        return SpatialObjectAccess.findSpatialTriplesByProperties(graph, null);
     }

Review Comment:
   Configurable lookup strategies are overkill at this point. This pr already 
consolidates all graph access in one place so future enhancements in that area 
should be easy to add if needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to