X <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#haversineLocLoc>
( loc1 loc2 &rest rest )
Returns the haversine distance between loc1
and loc2
which must be nD encoded literals.. The nD encoding datatypes of loc1
and loc2
need not be the same, but each must have one :latitude and one :longitude type ordinate.
For example:
PREFIX ndfn: <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#>
PREFIX ex: <http://ex.com/>
SELECT ?distance {
ex:WashingtonMonument ex:location ?loc1 .
ex:LincolnMemorial ex:location ?loc2 .
bind(ndfn:haversineLocLoc(?loc1, ?loc2) as ?distance)
}
An optional third argument may be
Notes
The following namespace abbreviations are used:
- fti - <http://franz.com/ns/allegrograph/2.2/textindex/>
- geo - <http://franz.com/ns/allegrograph/3.0/geospatial/>
- geofn - <http://franz.com/ns/allegrograph/3.0/geospatial/fn/>
- nd - <http://franz.com/ns/allegrograph/5.0/geo/nd#>
- ndfn - <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#>
- sna - <http://franz.com/ns/allegrograph/4.11/sna/>
The SPARQL magic properties reference has additional information on using AllegroGraph magic properties and functions.