I have some triples that represent the locations of several cities. I want to be able to fire off a Prolog query like
(select (?x ?y ?dist)
(q- ?x !exns:geolocation ?locx)
(q- ?y !exns:geolocation ?locy)
(geo-distance ?locx ?locy ?dist))
but I get this error:
Server returned 400: attempt to call '#:geo-distance/3' which is an undefined function.
I'd like to understand how to use the geospatial reasoning methods like geo-distance
(I assumed it was built-in because they use it here. Is this not true though?) in a Prolog query, because this is currently a mystery to me and I haven't found any good examples for doing this.
I am using the Python API, BTW, and in the Python API tutorial they use the getStatements
method to retrieve triples within a circle of some radius. I want to be able to do this kind of thing in a Prolog query, and from the Python API, not from AllegroCL--I'd like to build web apps and I don't know how to do that in AllegroCL, but I do know how in Python.
It's not possible to make geospatial Prolog queries from the Python API. You have to use the Allegro Common Lisp IDE to do this.
EDIT: Not So!
With AllegroGraph 4.6 you can do this! The problem was that I was using AllegroGraph 3.3, so I'm an idiot.
Here's a Prolog rule that works from the Python API using AllegroGraph 4.6:
Special thanks to the folks at Franz Allegro support for helping me!