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,该API利用工厂模式以避免限制推理算法,同时针对本体中的公理提供了新颖的OOP接口。OWLOOP旨在减少使用本体所需的范式转换,并通过类似OOP的多态性提升利用逻辑推理的软件架构的模块化程度。本文详细阐述了从OWL到OOP的映射机制,并通过智能环境中的机器人应用实例展示了OWLOOP的优势与局限性。