How to define a custom hierarchy for terms?

How to define a custom hierarchy for terms?