A generalized framework for modelling ordinal data