-
Notifications
You must be signed in to change notification settings - Fork 7
Description
One of the graph pattern matching scenario's that is currently still very slow is having several Answer KIs with the same sizable graph pattern and a single Ask KI with that graph pattern. Since the graph pattern matching algorithm only looks at the graph pattern (and not the actual data in a binding set), to be logically complete it needs to combine the triple patterns from the different Answer KIs to fulfil the Ask KI's graph pattern.
Assume there are 5 Answer KIs that have the same graph pattern as the 1 Ask KI. Let's number each triple pattern of these graph patterns 1-5 and name the 5 Answer KIs with a character A-E. So, 4C
means the 4
th triple pattern of Answer KI named C
. The triple patterns of the Ask KI are just referred to by their number 1-5.
Now, below you can see the 1-5 triple patterns of the Ask KI and behind that you can see different combinations of the triple patterns of the Answer KIs to fulfil the graph pattern of the Ask KI.
1 | 1A 1A 1A 1A 1A 1A 1A ... 1E
2 | 2A 2A 2A 2A 2A 2A 2A ... 2E
3 | 3A 3A 3A 3A 3A 3A 3A ... 3E
4 | 4A 4A 4A 4A 4A 4B 4C ... 4E
5 | 5A 5B 5C 5D 5E 5A 5A ... 5E
As you can see, having 5 triple patterns and 5 compatible Answer KI, gives you already 55 (= possible 3.125 possible combinations). Now imagine the graph pattern being twice as large (or having a few more Answer KIs) and you can see the combinatory explosion happening.
Now, to prevent this we can introduce a match flag called something like ONLY_NEW_RULE_WHEN_NECESSARY
, which will not allow a new rule to be introduced in a CombiMatch to fulfil a triple pattern if that triple pattern can also be fulfilled with an existing rule in that CombiMatch. In the above scenario, this will prevent the triple pattern from the various Answer KIs to be combined in all possible ways to fulfil the Ask KI graph pattern and thus limit the number of combi matches considerably. The disadvantage of this is (of course) that it limits the interoperability. When triples coming from these different Answer KIs could be combined because they are facts about the same resources, the matching process prevents these combinations from happening. This means that facts that are logically implied by the virtual knowledge graph will not be inferred by the knowledge engine.