Export IsValidRelation function.

The function needs to be exported to be used in core.