Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[rdf4j-dev] #220 lucene maches

Hi,

I have tried to understand how TupleFunction implemetations works internally and created a MockFunction with suittests (commit fda04 in my branch issues/#220-lucene-matches). It seems that the syntax currently supported by the whole evaluation machinery is different than syntax of the lucene searching.

I have tried to find differences between simple and complex requests and found that
 simple case works:

?pred <urn:mockfunction/request> ("Foo" "Testmessage")

But complex request doesn't:

 ?pred <urn:mockfunction/request> ([ <urn:mockfunction/value> "test" ] "Testmessage")


The complex case was parsed into:

Projection
   ProjectionElemList
      ProjectionElem "pred"
   Join
      Join
         Join
            Join
               Join
                  StatementPattern
                     Var (name=_anon_bd318df4_a0e6_4893_9b6e_fe6aebb3b63c, anonymous)
                     Var (name=_const_2e12292d_uri, value=urn:mockfunction/value, anonymous)
                     Var (name=_const_364492_lit_e2eec718_0, value="test"^^<http://www.w3.org/2001/XMLSchema#string>, anonymous)
                  StatementPattern
                     Var (name=_anon_21882642_2409_40da_9a31_00011ddf0883, anonymous)
                     Var (name=_const_c5f92d90_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#first, anonymous)
                     Var (name=_anon_bd318df4_a0e6_4893_9b6e_fe6aebb3b63c, anonymous)
               StatementPattern
                  Var (name=_anon_21882642_2409_40da_9a31_00011ddf0883, anonymous)
                  Var (name=_const_f5e424f4_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#rest, anonymous)
                  Var (name=_anon_f0492b9f_91b9_46a1_83e6_715ac8bd40a8, anonymous)
            StatementPattern
               Var (name=_anon_f0492b9f_91b9_46a1_83e6_715ac8bd40a8, anonymous)
               Var (name=_const_c5f92d90_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#first, anonymous)
               Var (name=_const_21b57b15_lit_e2eec718_0, value="Testmessage"^^<http://www.w3.org/2001/XMLSchema#string>, anonymous)
         StatementPattern
            Var (name=_anon_f0492b9f_91b9_46a1_83e6_715ac8bd40a8, anonymous)
            Var (name=_const_f5e424f4_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#rest, anonymous)
            Var (name=_const_62c53cf1_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#nil, anonymous)
      StatementPattern
         Var (name=pred)
         Var (name=_const_25ad8b4b_uri, value=urn:mockfunction/request, anonymous)
         Var (name=_anon_21882642_2409_40da_9a31_00011ddf0883, anonymous)



So it does not loose information about the complexity. My question are:

1. Why the evaluators chain is trying to solve the request on theirs own way rather than give everything to <urn:mockfunction/request>? Is it because the Value argument which is expected by the TupleFunction interface and some of the evaluator is trying to get the value what is not possible?
2. If that is the way let us take the TupleFunction as a special case of more generic interface which would accept Statements, eg:

public CloseableIteration<? extends List<? extends Statement>, QueryEvaluationException> evaluate(ValueFactory valueFactory, Statement... args)

3. What for is TupleEvaluatioStrategy and when it is used in the evaluation chain?


Thanks a lot,
Jacek


Back to the top