Waypoint class. We want to create a request getting the list of Waypoints and their latitude and longitude.SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("wpt"); request.addSelect("lat"); request.addSelect("lon"); request.addType("wpt", "Waypoint"); request.addGeometry("wpt", "lat", "lon", true); String query = request.getSPARQL();We will generate the following query:
SELECT ?wpt lat ?lon WHERE { ?wpt rdf:type sitac:Waypoint . ?wpt sitac:hasExactGeometry ?auto_1 . ?auto_1 sitac:asWKT ?auto_2 . BIND (xs:decimal(replace( str(?auto_2), "^[^0-9\\.-]*([-]?[0-9\\.]+) .*$", "$1" )) as ?lon) BIND (xs:decimal(replace( str(?auto_2), "^.* ([-]?[0-9\\.]+)[^0-9\\.]*$", "$1" )) as ?lat) }
Aircraft individual, and we want to get the distance between each Waypoint and our Aircraft.SparqlRequest request = new SparqlRequest("sitac"); request.addSelect("wpt"); request.addSelect("dist"); request.addType("wpt", "Waypoint"); request.addAdditionalVariable("ac"); request.addType("ac", "Aircraft"); request.addPropertyValue("ac", "Label", "MyAircraft"); request.addDistance("wpt", "ac", "dist", SparqlRequest.DISTANCE_M, true); String query = request.getSPARQL();
SELECT ?wpt ?dist WHERE { ?wpt rdf:type sitac:Waypoint . ?wpt sitac:hasExactGeometry ?auto_1 . ?auto_1 sitac:asWKT ?auto_2 . ?ac rdf:type sitac:Aircraft . ?ac sitac:Label "MyAircraft" . ?ac sitac:hasExactGeometry ?auto_3 . ?auto_3 sitac:asWKT ?auto_4 . BIND (geof:distance(?auto_2, ?auto_4, <http://www.opengis.net/def/uom/OGC/1.0/meter>) as ?dist) }
Copyright 2025 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence