Hi Rob. That worked a treat, thanks.
One more question. Is there a similar thing for the Spatial index ?
I've tried adding:
spatial:uidField "uid" ;
to the spatial config file, but that doesn't seem to work. (attached)
Mark
Technology Lead, Iotic Labs
+44 7973 674404
[email protected]
https://www.iotic-labs.com
On 10/03/16 14:44, Rob Vesse wrote:
> Mark
>
> 1 & 2)
>
> Yes this is the default behaviour
>
> 3)
>
> You can configure your index to support deletions as detailed at:
>
> https://jena.apache.org/documentation/query/text-query.html#deletion-of-ind
> exed-entities
>
> Specifically you need to add a text:uidField entry to your entity map
> configuration
>
> If your existing index does not yet have this (which based on your config
> it does not) then you will need to rebuild the index in order for it to
> support deletions going forward
>
> Rob
>
> On 10/03/2016 14:11, "Mark Wharton" <[email protected]> wrote:
>
>> Hi
>>
>> Deleting triples still leaves them in the Lucene text search index.
>> This leads to some questions
>>
>> 1) Is this expected behaviour?
>> 2) If it's not, what did I do wrong?
>> 3) If it is, do I have to re-run jena.textindexer again to keep it
>> up-to-date? This is a pain, because I have to stop fuseki in order to
>> do it.
>>
>> Steps to replicate
>>
>> I'm running:
>> Fuseki 2.3.0 2015-07-25T17:11:28+0000
>> Attached is my config to set up the spatial index
>>
>> 1a) Insert a triple into an empty database
>>
>> INSERT DATA {
>> <urn:uuid:abc> rdfs:label "abc"@en
>> }
>>
>> 1b) Query for it with the text label
>>
>> SELECT ?s
>> { ?s text:query "abc" .
>> }
>>
>> returns
>> ------------------
>> | s |
>> ==================
>> | <urn:uuid:abc> |
>> ------------------
>>
>> 1c) ASK if there are any triples with subject <urn:uuid:abc>
>> ASK
>> {
>> ?s ?p ?o . filter(?s = <urn:uuid:abc>)
>> }
>>
>> Returns "yes"
>>
>> 2a) Then delete it:
>> DELETE {?s rdfs:label ?label}
>> WHERE
>> {
>> ?s rdfs:label ?label . filter(?s = <urn:uuid:abc>)
>> }
>>
>> 3a) And run the ASK again, returns "no"
>>
>> 3b) Run the text query again returns
>> ------------------
>> | s |
>> ==================
>> | <urn:uuid:abc> |
>> ------------------
>>
>>
>>
>> --
>> Technology Lead, Iotic Labs
>> +44 7973 674404
>> [email protected]
>> https://www.iotic-labs.com
>
>
>
>
## Example of a TDB dataset and text index published using Fuseki @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 text: <http://jena.apache.org/text#> . @prefix spatial: <http://jena.apache.org/spatial#> . @prefix geosparql: <http://www.opengis.net/ont/geosparql#> . # TDB [] ja:loadClass "org.apache.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 . ## --------------------------------------------------------------- <#dataset> rdf:type tdb:DatasetTDB ; tdb:location "/home/fuseki/run/databases/graphs" . ## --------------------------------------------------------------- <#service_spatial_tdb> rdf:type fuseki:Service ; rdfs:label "TDB/spatial service" ; fuseki:name "spatial" ; fuseki:serviceQuery "query" ; fuseki:serviceQuery "sparql" ; fuseki:serviceUpdate "update" ; fuseki:serviceUpload "upload" ; fuseki:serviceReadGraphStore "get" ; fuseki:serviceReadWriteGraphStore "data" ; fuseki:dataset <#spatial_dataset> ; . ## --------------------------------------------------------------- <#spatial_dataset> rdf:type spatial:SpatialDataset ; spatial:dataset <#dataset> ; spatial:index <#indexSpatialLucene> ; . <#indexSpatialLucene> a spatial:SpatialIndexLucene ; spatial:directory <file:graphs_spatial_index> ; spatial:definition <#definition> ; . <#definition> a spatial:EntityDefinition ; spatial:entityField "uri" ; spatial:uidField "uid" ; spatial:geoField "geo" ; .
signature.asc
Description: OpenPGP digital signature
