I reverted to trying configuration by code, with 2 more tries:
https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/lucene/LuceneIndex.scala#L109
:
add to textual Dataset's Context a spatialIndex key to the spatialIndex.

and line 135 :
Use same Lucene directory for both indexes (not forgetting to spatially
index the existing textual index).
WARN  org.apache.jena.query.spatial.pfunction.SpatialOperationWithCircleBase
  - Failed to find the spatial index : tried context and as a
spatial-enabled dataset

Both fail!

My best hope is to look into Fuseki code,
but can someone confirm that Fuseki does spatial WITH textual Indexing?

I already looked into Fuseki code, but could not find calls to spatial or
textual factory in jena-fuseki1/src/main/java/org/apache/jena/fuseki/ .


Le ven. 21 déc. 2018 à 11:29, Jean-Marc Vanel <[email protected]> a
écrit :

> I'm still clueless about how to configure Jena for textual AND spatial
> indexes.
> I tried yet another assembler file:
>
> https://github.com/jmvanel/semantic_forms/blob/master/scala/jena.spatial%2Btext3.assembler.ttl
> but even less good as
>
> https://github.com/jmvanel/semantic_forms/blob/master/scala/jena.spatial%2Btext2.assembler.ttl
> reported just before.
>
> It seems that nobody uses both indexes by program;
> otherwise I'd like to know how you do; you can send me privately your
> assembler files.
>
> Fuseki claims to "incorporate Jena text query
> <https://jena.apache.org/documentation/query/text-query.html> and Jena
> spatial query
> <https://jena.apache.org/documentation/query/spatial-query.html>" in this
> documentation:
> https://jena.apache.org/documentation/fuseki2/
> So there is a way to configure Jena for textual AND spatial indexes!
> In absence of other help, I'll have to look into Fuseki code.
>
> NOTE: the error message "*tried context and as a text-enabled dataset*"
> maybe hints at a solution, but the word "context" is not clear.
>
>
>
>
>
> Le lun. 17 déc. 2018 à 14:51, Jean-Marc Vanel <[email protected]>
> a écrit :
>
>>
>>
>> Le lun. 17 déc. 2018 à 13:24, Andy Seaborne <[email protected]> a écrit :
>>
>>> ...
>>> :spatial_dataset rdf:type     spatial:SpatialDataset ;
>>>      rdf:type     text:TextDataset ;
>>> ...
>>>
>>> Not sure but I think the system will create this twice.
>>>
>>> It would be better to have two declarations, one for spatial, one for
>>> text.  I'm not sure what happen if they share the same :directory - it
>>> might work, it might not.
>>>
>>
>> So, if one want to make queries that are both textual and spatial,
>> having two declarations, one for spatial, one for text, sharing the same
>> directory, appears as the only solution .
>> I tested and report here.
>> The current assembler file:
>>
>> https://github.com/jmvanel/semantic_forms/blob/master/scala/jena.spatial%2Btext2.assembler.ttl
>> Results:
>>
>>    -  spatial query works, textual query has empty result, but no
>>    message in log, when *calling with spatial Dataset* in call
>>    to DatasetFactory.assemble()
>>    -  spatial query works, textual query has result independant of the
>>    string searched, and messages in log "Failed to find the text index" , "No
>>    text index - no text search performed : tried context and as a 
>> text-enabled
>>    dataset", when *calling with textual Dataset *in call to
>>    DatasetFactory.assemble()
>>
>> The query tested for text:
>> PREFIX text: <http://jena.apache.org/text#>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>> SELECT *
>> WHERE {
>>     ?s a <http://dbpedia.org/ontology/Garden> ;
>>     text:query (rdfs:label 'Gardens' ) ;
>> } LIMIT 11
>>
>> The spatial query tested:
>>
>> PREFIX spatial: <http://jena.apache.org/spatial#>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>> SELECT DISTINCT ?placeName ?place
>> WHERE {
>>   ?place spatial:nearby (
>>     45.750000 4.85 # Lyon
>>     1000 'km') .
>>   ?place rdfs:label ?placeName
>>   FILTER( LANG( ?placeName) = 'en' )
>> } LIMIT 111
>>
>> Data: the 2600 dboGarden in dbPedia endpoint.
>>
>>
>>
>>>      Andy
>>>
>>> On 16/12/2018 16:41, Jean-Marc Vanel wrote:
>>> > Sorry , I sent a bad link on the list, my assembler file is really
>>> this:
>>> >
>>> https://github.com/jmvanel/semantic_forms/blob/master/scala/jena.spatial%2Btext.assembler.ttl
>>> >
>>> >
>>> >
>>> >
>>> > Le dim. 16 déc. 2018 à 13:40, Marco Neumann <[email protected]>
>>> a
>>> > écrit :
>>> >
>>> >> you are missing the text index in the assembler.
>>> >>
>>> >> On Sun, Dec 16, 2018 at 12:08 PM Jean-Marc Vanel <
>>> [email protected]
>>> >>>
>>> >> wrote:
>>> >>
>>> >>> Yes indeed,
>>> >>> exactly with this assembler file:
>>> >>>
>>> >>>
>>> >>
>>> https://github.com/jmvanel/semantic_forms/blob/master/scala/jena.spatial.assembler.ttl
>>> >>>
>>> >>> And, when the Jena based application is started with this same
>>> assembler
>>> >>> file, the spatial queries work , as said above in this thread.
>>> >>>
>>> >>>
>>> >>> Le dim. 16 déc. 2018 à 12:18, Marco Neumann <[email protected]>
>>> a
>>> >>> écrit :
>>> >>>
>>> >>>> did you create the text index with jena.textindexer
>>> >>>> --desc=/<path>/config.ttl?
>>> >>>>
>>> >>>>
>>> >>>> On Sun, Dec 16, 2018 at 8:48 AM Jean-Marc Vanel <
>>> >>> [email protected]>
>>> >>>> wrote:
>>> >>>>
>>> >>>>> I fixed a stupid error in text index URI, resulting from pasting,
>>> in
>>> >>> new
>>> >>>>> file jena.spatial+text.assembler.ttl:
>>> >>>>>
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> https://github.com/jmvanel/semantic_forms/blob/master/scala/jena.spatial%2Btext.assembler.ttl
>>> >>>>>
>>> >>>>> Now, it reads:
>>> >>>>> :spatial_dataset rdf:type     spatial:SpatialDataset ;
>>> >>>>>      rdf:type     text:TextDataset ;
>>> >>>>>      spatial:dataset   <#dataset> ;
>>> >>>>>      spatial:index     <#indexLucene> ;
>>> >>>>>      text:dataset   <#dataset> ;
>>> >>>>>      text:index    * <#indexLuceneText>* ;
>>> >>>>>      .
>>> >>>>>
>>> >>>>> But still it says "Failed to find the text index" .
>>> >>>>>
>>> >>>>>
>>> >>>>> Le dim. 16 déc. 2018 à 09:34, Jean-Marc Vanel <
>>> >>> [email protected]>
>>> >>>> a
>>> >>>>> écrit :
>>> >>>>>
>>> >>>>>> So I tried a new  file jena.spatial+text.assembler.ttl with
>>> >> separate
>>> >>>>>> Lucene indices for spatial and text:
>>> >>>>>>
>>> >>>>>>
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> https://github.com/jmvanel/semantic_forms/blob/master/scala/jena.spatial%2Btext.assembler.ttl
>>> >>>>>>
>>> >>>>>> It defines a Dataset with both Dataset types and both Lucene
>>> >> indices:
>>> >>>>>>
>>> >>>>>> :spatial_dataset rdf:type     spatial:SpatialDataset ;
>>> >>>>>>      rdf:type     text:TextDataset ;
>>> >>>>>>      spatial:dataset   <#dataset> ;
>>> >>>>>>      spatial:index     <#indexLucene> ;
>>> >>>>>>      text:dataset   <#dataset> ;
>>> >>>>>>      text:index     <#indexLucene> ;
>>> >>>>>>      .
>>> >>>>>>
>>> >>>>>> Alas , when querying , it says "Failed to find the text index" :
>>> >>>>>>
>>> >>>>>> WARN  org.apache.jena.query.text.TextQueryPF - Failed to find the
>>> >>> text
>>> >>>>>> index : tried context and as a text-enabled dataset
>>> >>>>>> WARN  org.apache.jena.query.text.TextQueryPF - No text index - no
>>> >>> text
>>> >>>>>> search performed
>>> >>>>>>
>>> >>>>>> Is it because rdf:type spatial:SpatialDataset is asserted first in
>>> >>>>>> assembler file?
>>> >>>>>> So, defining a hybrid Dataset does not work anymore by TTL
>>> >>>> specification
>>> >>>>>> than by JVM code specification.
>>> >>>>>> I definitely need more experts' advice .
>>> >>>>>>
>>> >>>>>>
>>> >>>>>>
>>> >>>>>> Le sam. 15 déc. 2018 à 21:10, ajs6f <[email protected]> a écrit :
>>> >>>>>>
>>> >>>>>>>> On Dec 15, 2018, at 9:59 AM, Marco Neumann <
>>> >>> [email protected]
>>> >>>>>
>>> >>>>>>> wrote:
>>> >>>>>>>>
>>> >>>>>>>>> *Question*: does that make sense to have a unique Lucene index
>>> >>> for
>>> >>>>>>> text and
>>> >>>>>>>>> space ?
>>> >>>>>>>>> It is possible at all? If yes, is it good in terms of disk
>>> >> space
>>> >>>> and
>>> >>>>>>>>> performance?
>>> >>>>>>>>> Like this:
>>> >>>>>>>>> <#indexLucene> a text:TextIndexLucene ;
>>> >>>>>>>>>                a spatial:SpatialIndexLucene ;
>>> >>>>>>>>>                # etc ...
>>> >>>>>>>
>>> >>>>>>> I'm sure that would be ideal for many cases, but I'm not at all
>>> >> sure
>>> >>>>> that
>>> >>>>>>> the same index can answer queries of both kinds. Perhaps we can
>>> >>>> combine
>>> >>>>>>> fields from both, but are the relationships between tuple and
>>> >> index
>>> >>>>> record
>>> >>>>>>> the same in both cases?
>>> >>>>>>>
>>> >>>>>>> Otherwise, I know we had a conversation at some point in the past
>>> >> on
>>> >>>> one
>>> >>>>>>> of the lists about trying to factor out commonalities between
>>> >>>>> jena-spatial
>>> >>>>>>> and jena-text, but it didn't go very far at that time and I don't
>>> >>> know
>>> >>>>> what
>>> >>>>>>> the intervening years have done to make it more or less feasible.
>>> >>>> There
>>> >>>>>>> have been many changes to jena-text in that time and the new
>>> >> spatial
>>> >>>>> module
>>> >>>>>>> is a whole new story. I'd put a link here but searching
>>> >>>>> lists.apache.org
>>> >>>>>>> hasn't brought it up for me.
>>> >>>>>>>
>>> >>>>>>> ajs6f
>>> >>>>>>>
>>> >>>>>>>
>>> >>>>>>
>>> >>>>>> --
>>> >>>>>> Jean-Marc Vanel
>>> >>>>>>
>>> >>>>>>
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
>>> >>>>>> <
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
>>> >>>>>>
>>> >>>>>> Rule-based programming, Semantic Web
>>> >>>>>> +33 (0)6 89 16 29 52
>>> >>>>>> Twitter: @jmvanel , @jmvanel_fr ; chat: irc://
>>> >>>> irc.freenode.net#eulergui
>>> >>>>>>   Chroniques jardin
>>> >>>>>> <
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> http://semantic-forms.cc:1952/backlinks?q=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle
>>> >>>>>>
>>> >>>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> --
>>> >>>>> Jean-Marc Vanel
>>> >>>>>
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
>>> >>>>> <
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
>>> >>>>>>
>>> >>>>> Rule-based programming, Semantic Web
>>> >>>>> +33 (0)6 89 16 29 52
>>> >>>>> Twitter: @jmvanel , @jmvanel_fr ; chat: irc://
>>> >>> irc.freenode.net#eulergui
>>> >>>>>   Chroniques jardin
>>> >>>>> <
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> http://semantic-forms.cc:1952/backlinks?q=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle
>>> >>>>>>
>>> >>>>>
>>> >>>>
>>> >>>>
>>> >>>> --
>>> >>>>
>>> >>>>
>>> >>>> ---
>>> >>>> Marco Neumann
>>> >>>> KONA
>>> >>>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Jean-Marc Vanel
>>> >>>
>>> >>>
>>> >>
>>> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
>>> >>> <
>>> >>>
>>> >>
>>> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
>>> >>>>
>>> >>> Rule-based programming, Semantic Web
>>> >>> +33 (0)6 89 16 29 52
>>> >>> Twitter: @jmvanel , @jmvanel_fr ; chat: irc://
>>> irc.freenode.net#eulergui
>>> >>>   Chroniques jardin
>>> >>> <
>>> >>>
>>> >>
>>> http://semantic-forms.cc:1952/backlinks?q=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle
>>> >>>>
>>> >>>
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >>
>>> >> ---
>>> >> Marco Neumann
>>> >> KONA
>>> >>
>>> >
>>> >
>>>
>>
>>
>> --
>> Jean-Marc Vanel
>>
>> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
>> <http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
>> Rule-based programming, Semantic Web
>> +33 (0)6 89 16 29 52
>> Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui
>>  Chroniques jardin
>> <http://semantic-forms.cc:1952/backlinks?q=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle>
>>
>
>
> --
> Jean-Marc Vanel
>
> http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
> <http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
> Rule-based programming, Semantic Web
> +33 (0)6 89 16 29 52
> Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui
>  Chroniques jardin
> <http://semantic-forms.cc:1952/backlinks?q=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle>
>


-- 
Jean-Marc Vanel
http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
<http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
Rule-based programming, Semantic Web
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui
 Chroniques jardin
<http://semantic-forms.cc:1952/backlinks?q=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle>

Reply via email to