This paper introduces the mathematical method for translation into sign language based on ontologies. The modification of affix context-free grammar (AGFL) that adds semantical attribute and a new form of production called the “template production” is discussed. This new form helps to represent ontology-based productions in a short and computationally inexpensive way. The mathematical method utilizes dictionaries, ontology database, weighted affix context-free grammar (WACFG) parser, algorithm for transformation of constituency tree into dependency tree, and an algorithm for synthesis of Ukrainian sign language glosses. The algorithm for selection and convertion of grammatically augmented ontology (GAO) expressions into the set of WACFG productions is suggested. The major increase in percentage of correctly parsed sentences was achieved for Ukrainian sign language (UKL) and Ukrainian spoken language (USpL). All algorithms are components of the translation system for Ukrainian sign language. Simple video sequencing is utilized for sign language synthesis, however any other sign animation tool can be used. Tasks that require further research are defined.