The present work describes the development of a conceptual representation model of the domain of the theory of formal grammars and abstract machines through ontological modeling. The main goal is to develop an ontology capable of deriving new knowledge about the mood of an Alzheimer’s patient in the categories of wandering, nervous, depressed, disoriented or bored. The patients are from elderly care centers in Ambato Canton-Ecuador. The population consists of 147 individuals of both sexes, diagnosed with Alzheimer’s disease, with ages ranging from 75 to 89 years. The methods used are the taxonomic levels, the semantic categories and the ontological primitives. All these aspects allow the computational generation of an ontological structure, in addition to the use of the proprietary tool Pellet Reasoner as well as Apache NetBeans from Java for process completion. As a result, an ontological model is generated using its instances and Pellet Reasoner to identify the expected effect. It is noted that the ontologies come from the artificial intelligence domain. In this case, they are represented by aspects of real-world context that relate to common vocabularies for humans and applications working in a domain or area of interest.