And get lots of results. All of the prefixes are defined. The datatype of the ?lat and ?long variables is xsd:decimal.
However, if I remove the comment in front of geof:nearby, then I get an error:
WARN 2020-06-08 13:20:49,765 [stardog-user-8] com.complexible.stardog.protocols.http.server.StardogUndertowErrorHandler:accept(64): Unexpected exception was handled by the server
java.text.ParseException: Expected a number
at org.locationtech.spatial4j.io.WKTReader$State.nextDouble(WKTReader.java:507) ~[spatial4j-0.7.jar:?]
at org.locationtech.spatial4j.io.WKTReader.point(WKTReader.java:401) ~[spatial4j-0.7.jar:?]
at org.locationtech.spatial4j.io.WKTReader.parsePointShape(WKTReader.java:213) ~[spatial4j-0.7.jar:?]
at org.locationtech.spatial4j.io.WKTReader.parseShapeByType(WKTReader.java:156) ~[spatial4j-0.7.jar:?]
at org.locationtech.spatial4j.io.WKTReader.parseIfSupported(WKTReader.java:110) ~[spatial4j-0.7.jar:?]
at org.locationtech.spatial4j.io.WKTReader.parse(WKTReader.java:81) ~[spatial4j-0.7.jar:?]
at org.locationtech.spatial4j.context.SpatialContext.readShapeFromWkt(SpatialContext.java:258) ~[spatial4j-0.7.jar:?]
at com.complexible.stardog.spatial.db.query.NearbyPropertyFunction$NearbyOperator.getLocation(NearbyPropertyFunction.java:366) ~[stardog-spatial-core-7.3.1-SNAPSHOT-20200527.jar:?]
...
geof:nearby is expecting either a Geometry or a latitude as the first argument. So in this case it's finding a Literal and therefore expecting a number.
To get the results you're looking for, try geof:nearby (9.933333 53.550000 1000 unit:Kilometer) ;
WKT is fun to deal with, because Point actually accepts (LONG LAT) instead of the way we generally think about it. If you switch the 2 numbers do you see results then?
Hang on ... The query is wrong for the test data. It should have been geof:nearby (64.15 -21.93 1000 unit:Kilometer) ;
I got it to work with the test data. But the difference is that I had reasoning on to get the wgs:lat/long in the first case (from :lat ?lat and :long ?long), but hard-coded it into my data in the sample.
You very well might need wgs:lat and wgs:long explicitly in the database in order to get the Geometry into the spatial index. In fact, I think you do...