Please check my cleaned up and simplified version of your test case.

https://github.com/afs/jena-reports/blob/master/src/dev/TestTextIndex2_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 <[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







Reply via email to