Management of various complex resources is an important issue to be well done, in order to fulfill the potential of Grid. In this paper, we propose a formal data model and algebra for resource sharing in the Grid. In the model, domain ontology knowledge is described within knowledge schema and domain background knowledge is captured in integrity constrain rules. A query algebra is defined to manipulate the modeled resource base.