Happy with the fix !

Waiting for release 3.5.0 :) .


2017-08-19 16:03 GMT+02:00 Andy Seaborne <a...@apache.org>:

>  https://issues.apache.org/jira/browse/JENA-1381
>
>
> On 18/08/17 10:55, Andy Seaborne wrote:
>
>>  > How can I help solving this issue ?
>>
>> The test case at the moment is quite long and complex.  Reducing to a
>> simpler one would be helpful.
>>
>> - does it need both graph and multiple predicate on the same field to
>> cause a problem?  What about no entMap.set calls now we have resolved the
>> EntityDefinition problem?
>>
>> - Are there test cases on the test suite that are similar?
>>
>>      Andy
>>
>> On 18/08/17 08:42, Jean-Marc Vanel wrote:
>>
>>> I agree (of course) with the observation.
>>>
>>> I would add that it's suspect that for Lucene search '*:* ,'
>>> there are 3 Score Docs,
>>> and for search 'test1' (added by me),
>>> there are 2 Score Docs for URI x:/thing .
>>>
>>> DEBUGGING:
>>>
>>> I put a breakpoint in class TextQueryPF in method
>>>      private ListMultimap<String,TextHit> query(Node property, String
>>> queryString, String lang, int limit, ExecutionContext execCxt) {
>>>
>>> at line 257.
>>>
>>> It is called for evering graph in the TDB,
>>> and the passed ExecutionContext is are respectively:
>>> activeGraph     GraphNonTxnTDB  (id=73)
>>>   {x:/thing @http://www.w3.org/2000/01/rdf-schema#label "test1";
>>> x:/thing @
>>> http://xmlns.com/foaf/0.1/givenName "test1"}
>>>
>>> and
>>>   {x:/thing @http://www.w3.org/2000/01/rdf-schema#label "extra-data"}
>>>
>>> Is it normal that the activeGraph is a non transactional GraphNonTxnTDB ?
>>>
>>> How can I help solving this issue ?
>>>
>>>
>>>
>>> 2017-08-17 21:12 GMT+02:00 Andy Seaborne <a...@apache.org>:
>>>
>>> Please check my cleaned up and simplified version of your test case.
>>>>
>>>> https://github.com/afs/jena-reports/blob/master/src/dev/Test
>>>> TextIndex2_v3.java
>>>>
>>>> As as as I can see, both order of input data are wrong: either 0 returns
>>>> or 6, and note there are 3 quads so the 6 is 2*3.
>>>>
>>>> But not the right answers either way round.
>>>>
>>>>      Andy
>>>>
>>>>
>>>>
>>>> On 15/08/17 16:46, Jean-Marc Vanel wrote:
>>>>
>>>> Sorry I didn't notice your answer on august 6th.
>>>>> See interleaved answers.
>>>>>
>>>>> 2017-08-14 20:21 GMT+02:00 Andy Seaborne <a...@apache.org>:
>>>>>
>>>>> Hi Jean-Marc - did changing the EntityDefinition help?
>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> Alas NO !
>>>>> I commited the changed test with EntityDefinition changed as suggested:
>>>>> https://github.com/jmvanel/semantic_forms/commit/23bab3fd9fa
>>>>> e2b36f776cee082dad0163ff902c4#diff-82d2f8cd2ba172deb83b9b0d7
>>>>> 297704cR216
>>>>>
>>>>>
>>>>>
>>>>> On 06/08/17 18:08, Andy Seaborne wrote:
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>>
>>>>>>> Part of the problem is this:
>>>>>>>
>>>>>>> EntityDefinition entMap =
>>>>>>>       new EntityDefinition("uri", "text", rdfs + "label");
>>>>>>>
>>>>>>> The third argument as a string is the graph field. You wnat to use a
>>>>>>> Node
>>>>>>> here of the 4 argument form:
>>>>>>>
>>>>>>> Node pred = makeUri(rdfs + "label");
>>>>>>> EntityDefinition entMap = new EntityDefinition("uri", "text",
>>>>>>> "graph",
>>>>>>> pred);
>>>>>>>
>>>>>>> Sorry , and the API was clear about that .
>>>>>>>
>>>>>>>
>>>>>>
>>>>> then I'm not sure that multiple use of the "text" field for different
>>>>>
>>>>>> predicates works.  The code has
>>>>>>>
>>>>>>> public void set(String field, Node predicate) {
>>>>>>>            predicateToField.put(predicate, field) ;
>>>>>>>            // Add uniquely.
>>>>>>>            Collection<Node> c = fieldToPredicate.get(field) ;
>>>>>>>            if (c == null || !c.contains(predicate))
>>>>>>>                fieldToPredicate.put(field, predicate) ;
>>>>>>>        }
>>>>>>>
>>>>>>> so if field has been used, fieldToPredicate is not changed.
>>>>>>>
>>>>>>>
>>>>>>> And, regarding the code of the set() method,
>>>>>>
>>>>> I would paraphase it like this:
>>>>> "when the multimap "fieldToPredicate" does not contain given predicate,
>>>>> then add it with put(),
>>>>> whose implementation allows duplicate key-value pairs, and put() always
>>>>> adds a new key-value pair and increases the multimap size by 1.
>>>>> I debugged this part, and followed the calls to method put() in
>>>>> abstract class AbstractMapBasedMultimap<K, V> extends
>>>>> AbstractMultimap<K,
>>>>> V>
>>>>> in jena-shaded-guava-3.3.0
>>>>> where indeed a key has multiple values.
>>>>>
>>>>> Anyway commenting out all the calls to set() does not remove the issue.
>>>>>
>>>>> HOWEVER, *interchanging the creation of both named graphs* makes for a
>>>>> correct result, that is interchanging calls to
>>>>> populateExtraGraph();
>>>>> populateRelevantGraph();
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>        Andy
>>>>>>>
>>>>>>>
>>>>>>> On 05/08/17 21:27, Jean-Marc Vanel wrote:
>>>>>>>
>>>>>>> This is done !
>>>>>>>
>>>>>>>>
>>>>>>>> Here:
>>>>>>>> https://github.com/jmvanel/semantic_forms/blob/master/scala/
>>>>>>>> jena_only/src/main/java/TestTextIndex2.java
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2017-08-04 19:38 UTC+02:00, Andy Seaborne <a...@apache.org>:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> On 30/07/17 11:05, Jean-Marc Vanel wrote:
>>>>>>>>>
>>>>>>>>> I can help you with compile and run the test in Scala, or even
>>>>>>>>>
>>>>>>>>>> translate
>>>>>>>>>> it
>>>>>>>>>> in Java,
>>>>>>>>>> or any other help :) .
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> java would help - I've had to remove my scala/eclipse environment.
>>>>>>>>>
>>>>>>>>>         Andy
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>
>>>>>
>>>
>>>


-- 
Jean-Marc Vanel
http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
Déductions SARL - Consulting, services, training,
Rule-based programming, Semantic Web
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui

Reply via email to