On 19/08/14 14:50, Luigi Selmi wrote:
Hi all,
I am still trying to make spatial searches in Jena but it seems Jena doesn't
find my spatial index. I use an assembler file to configure a TDB dataset and a
spatial index, load the data into TDB, start the indexing and then start Fuseki
but when I make a SPARQL query Fuseki retuns an empty result and logs the
following message
WARN Failed to find the spatial index : tried context and as a
spatial-enabled dataset
In the dataset only geo:lat and geo:long properties are used (no WKT) to make
things simple. The assembler file is available at the url
http://www.sharesemantics.com/test/jena/jena-spatial-assembler.ttl
while the dataset (24 triples) is available at
http://www.sharesemantics.com/test/jena/spatial-data-latlong.ttl
I upload the dataset into TDB using the command
$tdbloader --desc jena-spatial-assembler.ttl spatial-data-latlong.ttl
In the assembler file the directory of the spatial index is set as a local
folder and I can see that the files in the folder are updated when I run the
indexer with the command
$java jena.spatialindexer --desc=jena-spatial-assembler.ttl
The indexer writes the following message when it's done
$INFO 24 (24 per second) properties indexed
So everything seems to work fine till this point then I start Fuseki using the
same assembler file
java -Xmx8G -jar fuseki-server.jar --port=2020
--desc=/home/luigi/jena/apache-jena-2.11.1/jena-spatial-assembler.ttl
/fusepoolp3
and try to make a simple query (suggested by Andy in a previous email)
PREFIX spatial: <http://jena.apache.org/spatial#>SELECT * { ?place
spatial:nearby (51.38 -2.7 10 'km') .}
but it doesn't return any triple even if the Bristol International Airport is
close to the location given in the query and Fuseky writes the following message
WARN Failed to find the spatial index : tried context and as a spatial-enabled
datasetWARN No text index - no text search performed
I didn't configure a text index as it should not be necessary as far as I know.
My questions are the following:
1) why Fuseki can't find the spatial index 2) which is the purpose of the following
definition that must be written in the assembler file ( as stated in Jena Spatial
documentation )<#definition> a spatial:EntityDefinition ;
spatial:entityField "uri" ;
spatial:geoField "geo" ;
Thanks to anyone who can solve this issue
Luigi
> 1) why Fuseki can't find the spatial index
spatial:SpatialtDataset rdfs:subClassOf ja:RDFDataset .
^^^
**** spelt wrong (extra 't')
spatial:SpatialIndexLucene rdfs:subClassOf spatial:SpatialIndex .
:spatial_dataset rdf:type spatial:SpatialDataset ;
> 2) which is the purpose of the following definition that must be
written in the assembler file ( as stated in Jena Spatial documentation
)<#definition> a spatial:EntityDefinition ;
> spatial:entityField "uri" ;
> spatial:geoField "geo" ;
It defines the way Lucene is used. One field is URI stored, the other is
the geoloaction field to search spatially.
Andy