Abstract:NKI (The National Knowledge Infrastructure) is a large-scale knowledge base, which uses frames to represent concepts in ontologies, and uses Horn logic programs as the automated reasoning. The formalizations of ontologies, frames and logical theories in NKI, and the transformations between the formalizations are given, and proved to be functors between ontologies, frames and logical theories if they are taken as categories in the theory of category. The result proved in this paper guarantees that in NKI, the inference based on the Horn logic programs is correct with respect to the knowledge base represented by ontologies and frames.