Sorry I didn't notice your answer on august 6th.
See interleaved answers.

2017-08-14 20:21 GMT+02:00 Andy Seaborne <[email protected]>:

> 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/23bab3fd9fae2b36f776cee082dad0163ff902c4#diff-82d2f8cd2ba172deb83b9b0d7297704cR216


>
> 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 <[email protected]>:
>>>
>>>>
>>>>
>>>> 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