Do you want all curves that are connected a given curves or do you want to retrieve like a chain of connected curves, the given curve is part of?
You could compare the start and end points of your curves to check if they are connected.
Check this out:
Or you create a section based on the given curve. Creating the section you can specify a chain rule and if needed that you are only looking for curves that are connected tangent.
In this exmaple, a section is created: