Discussion:
ReorderFixed term-term-term pattern
Dimitrianos Savva
2016-12-11 22:02:59 UTC
Permalink
Hi all,

I try to build a new type of dataset which will be very similar to the “in memory” dataset.

I am new to Jena and trying to understand how the query engine evaluates a query and what optimizations are performed.
While looking at ReorderFixed class (org.apache.jena.sparql.engine.optimizer.reorder.ReorderFixed), I noticed that there are some predefined patterns to decide the weight of a given triple pattern and then do some reordering according to the weights.

At line 89 I noticed the following line of code which seems wrong. (see init() function)

matcher.addPattern(new Pattern(2, TERM, TERM, TERM)) ; // S?O

I was expecting TERM, VAR, TERM instead of TERM, TERM, TERM because it’s the only generic pattern that is missing there
Moreover the comment // S?O is a hint that the pattern should be “variable as the predicate of a triple pattern”.

Is that correct?

Regards,
Dimis
Andy Seaborne
2016-12-12 08:50:19 UTC
Permalink
Hi Dimis,

Thank you for catching that. You are quite correct that it should be
TERM, VAR, TERM. It has now been fixed in git.

There has been discussions about making implementing dataset easier -
these have been happening on the dev@ list.

If you have any thoughts about any improvements, please do let us know.


Andy
Post by Dimitrianos Savva
Hi all,
I try to build a new type of dataset which will be very similar to
the “in memory” dataset.
I am new to Jena and trying to understand how the query engine
evaluates a query and what optimizations are performed. While looking
at ReorderFixed class
(org.apache.jena.sparql.engine.optimizer.reorder.ReorderFixed), I
noticed that there are some predefined patterns to decide the weight
of a given triple pattern and then do some reordering according to
the weights.
At line 89 I noticed the following line of code which seems wrong. (see init() function)
matcher.addPattern(new Pattern(2, TERM, TERM, TERM)) ;
// S?O
I was expecting TERM, VAR, TERM instead of TERM, TERM, TERM because
it’s the only generic pattern that is missing there Moreover the
comment // S?O is a hint that the pattern should be “variable as the
predicate of a triple pattern”.
Is that correct?
Regards, Dimis
Loading...