[WIP] general definition for resources

This PR introduced some data structure to represent resources.