2014-01-07 27 views
1

我用SPARQL來請求:亞型在地理空間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,謝謝!

回答

1

您必須先註冊spherial類型。我做到了通過JENA API:

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

其中conn是當前連接(的AGRepositoryConnection實例)