Found a bug in the method above when the reasoner graph contains a loop (a rule whose consequent graph pattern partially matches on its own antecedent graph pattern). This results in a stack overflow exception in the JVM.
Make sure this method supports loops, because this happens quite easily. Typically, we can add a collection in which we store nodes we've already visited and before processing a node, check whether we've processed it before. If so, skip it!
Found a bug in the method above when the reasoner graph contains a loop (a rule whose consequent graph pattern partially matches on its own antecedent graph pattern). This results in a stack overflow exception in the JVM.
Make sure this method supports loops, because this happens quite easily. Typically, we can add a collection in which we store nodes we've already visited and before processing a node, check whether we've processed it before. If so, skip it!