Rodrigo,

There have been fixes in this area since Fuseki 1.0.1 (JENA-623)

Please could you try the latest version (1.1.2)

http://jena.apache.org/download/index.html

        Andy

On 05/06/15 04:58, Rodrigo Antonialli wrote:
Hi,

I'm working with Fuseki 1.0.1, and trying to configure jena spatial...

I've followed the docs at
http://jena.apache.org/documentation/query/spatial-query.html#supported-geo-data-for-indexing-and-querying
and this is my configuration file:

----
# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0

## Example of a TDB dataset published using Fuseki: persistent storage.

@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix spatial: <http://jena.apache.org/spatial#> .

[] rdf:type fuseki:Server ;
    # Timeout - server-wide default: milliseconds.
    # Format 1: "1000" -- 1 second timeout
    # Format 2: "10000,60000" -- 10s timeout to first result, then 60s
timeout to for rest of query.
    # See java doc for ARQ.queryTimeout
    # ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;
    # ja:loadClass "your.code.Class" ;

    fuseki:services (
      #<#service_tdb_read_only>
      <#service_tdb_users_neotec>
      <#service_tdb_neotec>
      <#service_spatial_demo>
#     <#service_tdb_aula>
    ) .

# TDB
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

# Spatial
[] ja:loadClass "org.apache.jena.query.spatial.SpatialQuery" .
spatial:SpatialDataset  rdfs:subClassOf  ja:RDFDataset .
spatial:SpatialIndexLucene  rdfs:subClassOf   spatial:SpatialIndex .

## ---------------------------------------------------------------
## TDB das ontologias do sistema NEOTEC

<#service_tdb_neotec> rdf:type fuseki:Service ;
     rdfs:label                      "TDB NEOTEC (RW)" ;
     fuseki:name                     "neotec" ;
     fuseki:serviceQuery             "query" ;
     fuseki:serviceQuery             "sparql" ;
     fuseki:serviceUpdate            "update" ;
     fuseki:serviceUpload            "upload" ;
     fuseki:serviceReadWriteGraphStore      "data" ;
     # A separate read-only graph store endpoint:
     fuseki:serviceReadGraphStore       "get" ;
     fuseki:dataset           <#tdb_dataset_neotec> ;
     .

<#tdb_dataset_neotec> rdf:type      tdb:DatasetTDB ;
     tdb:location "/path-to-tdb" ;
     tdb:unionDefaultGraph true ;
     .


## ---------------------------------------------------------------
## TDB dos usuários do sistema NEOTEC

<#service_tdb_users_neotec> rdf:type fuseki:Service;
rdfs:label "TDB NEOTEC USERS (RW)" ;
fuseki:name "neotec_users" ;
fuseki:serviceQuery             "query" ;
     fuseki:serviceQuery             "sparql" ;
     fuseki:serviceUpdate            "update" ;
     fuseki:serviceUpload            "upload" ;
     fuseki:serviceReadWriteGraphStore      "data" ;
     # A separate read-only graph store endpoint:
     fuseki:serviceReadGraphStore       "get" ;
     fuseki:dataset           <#tdb_users_neotec> ;
     .

<#tdb_users_neotec> rdf:type      tdb:DatasetTDB ;
     tdb:location "/path-to-tdb" ;
     tdb:unionDefaultGraph true ;
     .

## ---------------------------------------------------------------
## TDB with SpatialIndex

<#service_spatial_demo> rdf:type fuseki:Service;
     rdfs:label                      "DEMO SPATIAL TDB (RW)" ;
     fuseki:name                     "spatial_demo" ;
     fuseki:serviceQuery             "query" ;
     fuseki:serviceQuery             "sparql" ;
     fuseki:serviceUpdate            "update" ;
     fuseki:serviceUpload            "upload" ;
     fuseki:serviceReadWriteGraphStore      "data" ;
     # A separate read-only graph store endpoint:
     fuseki:serviceReadGraphStore       "get" ;
     fuseki:dataset           :spatial_dataset ;
     .

:spatial_dataset rdf:type     spatial:SpatialDataset ;
     spatial:dataset   <#spatial_demo> ;
     spatial:index     <#indexLucene> ;
     .

<#spatial_demo> rdf:type      tdb:DatasetTDB ;
     tdb:location
"/Applications/Servidores/jena-fuseki-1.0.1/tdb_spatial_demo" ;
     tdb:unionDefaultGraph true ;
     .

<#indexLucene> a spatial:SpatialIndexLucene ;
     #spatial:directory <file:Lucene> ;
     spatial:directory "mem" ;
     spatial:definition <#definition> ;
     .

<#definition> a spatial:EntityDefinition ;
     spatial:entityField      "uri" ;
     spatial:geoField     "geo" ;
     # custom geo predicates for 1) Latitude/Longitude Format
     spatial:hasSpatialPredicatePairs (
          [ spatial:latitude :latitude_1 ; spatial:longitude :longitude_1 ]
          [ spatial:latitude :latitude_2 ; spatial:longitude :longitude_2 ]
          ) ;
     # custom geo predicates for 2) Well Known Text (WKT) Literal
     spatial:hasWKTPredicates (:wkt_1 :wkt_2) ;
     # custom SpatialContextFactory for 2) Well Known Text (WKT) Literal
     spatial:spatialContextFactory
          "com.spatial4j.core.context.jts.JtsSpatialContextFactory"
     .


---

Fuseki runs fine with this configuration, and I've loaded the geo data
examples from
https://github.com/apache/jena/blob/master/jena-spatial/src/test/resources/geoarq-data-1.ttl
to a random graph... (http://neotec.rc.unesp.br/resource/geodata)

I've tried the following query:

PREFIX spatial: <http://jena.apache.org/spatial#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?placeName
{
     ?place spatial:query (52.4539 -1.74803 10 'km') .
     ?place rdfs:label ?placeName
}

But no results are returned... even with some variations of the
coordinates..

How can I know my configuration is working??

The logs are set to DEBUG, but I cant really see a problem... What should I
look for in logs??

Cheers


Rodrigo C. Antonialli
======================================
Rio Claro - SP - Brasil
LinkedIn: http://www.linkedin.com/in/rcantonialli
Contato:  [email protected]
               Skype: rc_antonialli


Reply via email to