Building hierarchy data profiling scripts