Skip to content

Also use CombiMatch to improve performance of binding set translation #669

@bnouwt

Description

@bnouwt

Currently, in the reasoner, every result binding set from a reasoning rule gets merged with itself to make sure that for example transitive relations work. This merge with itself is a rather expensive operation and causes too much delay when binding sets become very big. Therefore, it would be better to replace this general merge with itself, with more targeted merge operation based on how the graph pattern match upon each other. We already use CombiMatches in the current graph pattern matcher algorithm, but this combination information is currently removed while it is required for a more targeted merge. Therefore, we should try and incorporate this combi match information into the rest of the reasoner logic by storing it in the RuleNode and using it in translating binding sets from one graph pattern to another. See a transitive example below:

Transitive rule: x p y. y p z. -> x p z

Two applications of this rule:
x = <z2>
y = <y1>
z = <z1>
->
x = <z2>
z = <z1>

x = <x2>
y = <y2>
z = <z2>
->
x = <x2>
z = <z2>

Resulting bindings from above applications:
x = <x2>
z = <z2>

x = <z2>
z = <z1>

Match of above rule upon itself:
x p z -> x p y
x p z -> y p z

Binding after merging the above two based on above match:
x = <x2>
y = <z2>
z = <z1>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions