Geospatial Sparql错误中的子类型

时间:2014-01-07 06:00:03

标签: geospatial sparql allegrograph

我使用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.

我使用的是allelecograph 4.12.1。那么,SUBTYPE我应该使用什么,谢谢!

1 个答案:

答案 0 :(得分:1)

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

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

其中conn是当前连接(AGRepositoryConnection的实例)