Add getters to retrieve constants from api::Term (#5677)