1

我使用 SPARQL 请求:

select distinct ?place ?label ?lat ?lng where {
                    GEO OBJECT 
                    SUBTYPE "http://franz.com/ns/allegrograph/3.0/geospatial/spherical/km/-180.0/180.0/-90.0/90.0/50.0"
                    HAVERSINE (POINT(105.8522, 21.0287), 1.0 KM) {
                                            ?place vtio:hasGeoPoint ?loc. 
                                            ?place rdf:type vtio:FastFood.
                                            ?place rdfs:label ?label. 
                    ?place vtio:hasLatitude ?lat.
                                            ?place vtio:hasLongtitude ?lng.
                    } where {
                    } FILTER(lang(?label)='vn')
                                          } LIMIT  5

但是当我执行它时,有一个错误:

Executing query failed:
QUERY FAILED: Geospatial subtype
"http://franz.com/ns/allegrograph/3.0/geospatial/spherical/km/-180.0/180.0/-90.0/90.0/50.0"
not found.

我使用 allegrograph 4.12.1 。所以,SUBTYPE我应该使用什么,谢谢!

4

1 回答 1

1

您必须先注册球形类型。我是通过 JENA API 做到的:

URI sphericalTypeURI=conn.registerSphericalType(50,"km");

conn当前连接在哪里(的实例AGRepositoryConnection

于 2014-01-22T13:34:12.733 回答