The management of voluminous heterogeneous resources and services in the web environment is a complex task. Semantic knowledge is playing an increasing important role in order to have the heterogeneous resources well managed. In this paper, we propose a knowledge-based data model and query algebra for the next-generation web. 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. Based on the algebra operators, we define a high-level declarative query language and illustrate it with examples. Finally, a comparison with related works is made. Our work provides a generic foundation of semantic resource management for the future web.