The building of models of documentary and factographic retrieval is discussed in the context of digital libraries working with documents of a fairly arbitrary structure. An overview is given of a technology for extracting factographic information from scientific documents of a fairly arbitrary structure. A model is proposed for the classification of documents in a digital library. The model is based on the use of the tolerance relationship and takes into account the possible lack of a priori given classifiers. In creating factographic systems, it is suggested that the concept of a fact should be understood as a totality of relationships, as contained in the text and document metadata, between the entities described in the information system ontology. A simple model is proposed to describe the ontology of a factographic system.