The paper tackles the issue of mapping logic axioms formalised in the Ontology Web Language (OWL) within the Object-Oriented Programming (OOP) paradigm. The issues of mapping OWL axioms hierarchies and OOP objects hierarchies are due to OWL-based reasoning algorithms, which might change an OWL hierarchy at runtime; instead, OOP hierarchies are usually defined as static structures. Although programming paradigms based on reflection allow changing the OOP hierarchies at runtime and mapping OWL axioms dynamically, there are no currently available mechanisms that do not limit the reasoning algorithms. Thus, the factory-based paradigm is typically used since it decouples the OWL and OOP hierarchies. However, the factory inhibits OOP polymorphism and introduces a paradigm shift with respect to widely accepted OOP paradigms. We present the OWLOOP API, which exploits the factory to not limit reasoning algorithms, and it provides novel OOP interfaces concerning the axioms in an ontology. OWLOOP is designed to limit the paradigm shift required for using ontologies while improving, through OOP-like polymorphism, the modularity of software architectures that exploit logic reasoning. The paper details our OWL to OOP mapping mechanism, and it shows the benefits and limitations of OWLOOP through examples concerning a robot in a smart environment.
翻译:本文探讨了在面向对象编程(OOP)范式中,映射以网络本体语言(OWL)形式化的逻辑公理的问题。OWL公理层次结构与OOP对象层次结构之间的映射难题源于基于OWL的推理算法,这些算法可能在运行时改变OWL层次结构;而OOP层次结构通常被定义为静态结构。尽管基于反射的编程范式允许在运行时动态修改OOP层次结构并映射OWL公理,但目前尚无机制能够不限制推理算法。因此,工厂模式被广泛采用,因为它解耦了OWL与OOP层次结构。然而,工厂模式抑制了OOP的多态性,并引入了与广泛接受的OOP范式相悖的范式转换。我们提出了OWLOOP API,它利用工厂模式来避免限制推理算法,并针对本体中的公理提供了新颖的OOP接口。OWLOOP旨在限制使用本体所需的范式转换,同时通过类似OOP的多态性,提升利用逻辑推理的软件架构的模块化程度。本文详细阐述了从OWL到OOP的映射机制,并通过智能环境中的机器人实例展示了OWLOOP的优势与局限性。