Previous topic  Top  Next topic  Print this Topic
 

MagicSet

 

The MagicSet method (we use the so-called "generalized supplementary magic sets") tries to improve the performance of the BottomUp evaluation by propagating bindings top-down. For that purpose additional rules are generated which simulate the top-down propagation. For example, if you have the rules

RULE r1:  p(?X,?Y) :- q(?X,?Y) AND r(?X,?Y).

QUERY q1: ?- p(a,Y).m_p_bf(a).

RULE r1:  pbf(?X,?Y) :- m_pbf(?X) AND q(?X,?Y) AND r(?X,?Y).

QUERY q1: ?- p_bf(a,Y).

This strange-looking program optimizes the original program by propagating the "a" to then the MagicSet transformation transforms this rule into something like the rule "r1". This means rule "r1" will only create tuples which already have an "a" at the first position. This program is then evaluated with a bottom up evaluator. So MagicSet additionally requires you to choose an appropriate bottom up evaluation method (see below). In order to start OntoBroker with this evaluation method set

EvaluationMethod=MagicSet

in OntoConfig.prp