<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 (default) or to specify the units of the result.

Notes

The following namespace abbreviations are used:

The SPARQL magic properties reference has additional information on using AllegroGraph magic properties and functions.