<http://franz.com/ns/allegrograph/5.0/geo/nd/fn#haversineLatLonLoc>
( lat lon loc &rest rest )

Returns the haversine distance between <lat, lon> and the location specified by the nD encoded literal loc. lat and lon must be bound to numeric values, and the datatype encoding of loc 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/>
PREFIX : <http://franz.com/ns/keyword#>
SELECT ?distance {
ex:WashingtonMonument ex:location ?loc .
bind(ndfn:haversineLatLonLoc(38.889, -77.035, ?loc, :miles) as ?distance)
}

An optional fourth 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.