Block infinite loop by checking that class in range does not point to initial core concept
When testing SPO
schema, there was an issue leading to an infinite loop when extracting the supporting concepts, i.e. when checking if the concepts are invoked by other concepts or not. For example:
spo#AllogeneicTransplantation --> spo#hasCancerTreatmentComplex [spo:CancerTreatmentComplex] --> spo#hasMedicalProcedure [sphn:MedicalProcedure] --> spo#AllogeneicTransplantation --> ...
spo#AllogeneicTransplantation
is a child of sphn:MedicalProcedure
, therefore when spo#hasMedicalProcedure
it points back to the source concepts where we started the check. To avoid it we would need to stop the processing if at any level the source core concept is invoked.
In the core we pass along the starting concept and in case the class in range of a property is matching that source concept, then we return False
, because the concept is currently being checked.
Let me know what you think. This implies no changed for the SPHN only generated files.