An Object Oriented Programming (OOP) interface for Ontology Web language (OWL) ontologies.

Overview

code GPLv3 license release

Enabling a developer to use Ontology Web Language (OWL) along with its reasoning capabilities in an Object Oriented Programming (OOP) paradigm, by providing an easy to use API, i.e., OWLOOP.

Although OWL and OOP paradigms have similar structure, there are some key differences between them; see this W3C publication for more details about the differences. Nonetheless, it is possible to use OWL along with its reasoning capabilities within applications developed in an OOP paradigm, by using the classic OWL-API. But, the usage of the classic OWL-API leaves your project with lots of boilerplate code. Therefore, the OWLOOP-API (built on top of OWL-API), reduces boilerplate code by enabling interaction with 'OWL entities' (i.e, Concept (also known as Class), Individual, Object property and Data property) as objects within the OOP paradigm. These objects are termed as Descriptors (i.e., ClassDescriptor, IndividualDescriptor, ObjectPropertyDescriptor and DataPropertyDescriptor). By using descriptor(s), OWLOOP synchronizes axioms (OWL2-DL axioms) between the OOP paradigm (your application's code) and the OWL paradigm (OWL ontology XML/RDF file(s)).

Example of a real-world system that used OWLOOP API:

This video (link) shows a smart home system recognising human activities. The system uses a network of multiple ontologies to recognise specific activities. The network of multiple ontologies was developed using OWLOOP API.

Table of Contents

  1. Reference to the publication
  2. Getting Started with OWLOOP
  3. Overview of important Java-classes (in OWLOOP) and their methods
  4. Wiki documentation
  5. Some details about OWLOOP dependencies
  6. Developers' message
  7. License

1. Reference to the Publication

OWLOOP API is a peer reviewed software published by Elsevier in its journal SoftwareX. The publication presents in detail the motivation for developing OWLOOP. Furthermore, it describes the design of the API and presents the API's usage with illustrative examples.

Please, cite this work as:

@article{OWLOOP-2021,
  title = {{OWLOOP}: {A} Modular {API} to Describe {OWL} Axioms in {OOP} Objects Hierarchies},
  author = {Luca Buoncompagni and Syed Yusha Kareem and Fulvio Mastrogiovanni},
  journal = {SoftwareX},
  volume = {17},
  pages = {100952},
  year = {2022},
  issn = {2352-7110},
  doi = {https://doi.org/10.1016/j.softx.2021.100952},
  url = {https://www.sciencedirect.com/science/article/pii/S2352711021001801}
}

2. Getting Started with OWLOOP

2.1. Prerequisites for your Operating System

2.2. Add OWLOOP dependencies to your project

First Step: Create a new project with Java as the programming language and Gradle as the build tool.

Second Step: Create a directory called lib and place the OWLOOP related jar files in it.

Third Step: Modify your build.gradle file, as follows:

  • Add flatDir { dirs 'lib' } within the repositories{} section, as shown below:
repositories {
    mavenCentral()

    flatDir {
        dirs 'lib'
    }
}
  • Add the required dependencies (i.e., owloop, amor and pellet), as shown below 👇
dependencies {
    // testCompile group: 'junit', name: 'junit', version: '4.12'

    implementation 'it.emarolab.amor:amor:2.2'
    implementation 'it.emarolab.owloop:owloop:2.1'
    implementation group: 'com.github.galigator.openllet', name: 'openllet-owlapi', version: '2.5.1'
}

It is normal that a warning like SLF4J: Class path contains multiple SLF4J bindings occurs.

Final Step: You are now ready to create/use OWL ontologies in your project/application 🔥 , by using OWLOOP descriptors in your code!.

2.3. Use OWLOOP in your project

  • This is an example code that shows how to create an OWL file and add axioms to it.
import it.emarolab.amor.owlInterface.OWLReferences;
import it.emarolab.owloop.core.Axiom;
import it.emarolab.owloop.descriptor.utility.classDescriptor.FullClassDesc;
import it.emarolab.owloop.descriptor.utility.individualDescriptor.FullIndividualDesc;
import it.emarolab.owloop.descriptor.utility.objectPropertyDescriptor.FullObjectPropertyDesc;

public class someClassInMyProject {

    public static void main(String[] args) {

        // Disabling 'internal logs' (so that our console is clean)
        Axiom.Descriptor.OntologyReference.activateAMORlogging(false);

        // Creating an object that is 'a reference to an ontology'
        OWLReferences ontoRef = Axiom.Descriptor.OntologyReference.newOWLReferencesCreatedWithPellet(
                "robotAtHomeOntology",
                "src/main/resources/robotAtHomeOntology.owl",
                "http://www.semanticweb.org/robotAtHomeOntology",
                true
        );

        // Creating some 'classes in the ontology'
        FullClassDesc location = new FullClassDesc("LOCATION", ontoRef);
        location.addSubClass("CORRIDOR");
        location.addSubClass("ROOM");
        location.writeAxioms();
        FullClassDesc robot = new FullClassDesc("ROBOT", ontoRef);
        robot.addDisjointClass("LOCATION");
        robot.writeAxioms();

        // Creating some 'object properties in the ontology'
        FullObjectPropertyDesc isIn = new FullObjectPropertyDesc("isIn", ontoRef);
        isIn.addDomainClassRestriction("ROBOT");
        isIn.addRangeClassRestriction("LOCATION");
        isIn.writeAxioms();
        FullObjectPropertyDesc isLinkedTo = new FullObjectPropertyDesc("isLinkedTo", ontoRef);
        isLinkedTo.addDomainClassRestriction("CORRIDOR");
        isLinkedTo.addRangeClassRestriction("ROOM");
        isLinkedTo.writeAxioms();

        // Creating some 'individuals in the ontology'
        FullIndividualDesc corridor1 = new FullIndividualDesc("Corridor1", ontoRef);
        corridor1.addObject("isLinkedTo", "Room1");
        corridor1.addObject("isLinkedTo", "Room2");
        corridor1.writeAxioms();
        FullIndividualDesc robot1 = new FullIndividualDesc("Robot1", ontoRef);
        robot1.addObject("isIn", "Room1");
        robot1.writeAxioms();
        
        // Saving axioms from in-memory ontology to the the OWL file located in 'src/main/resources'
        ontoRef.saveOntology();
    }
}
  • After running the above code, the OWL file robotAtHomeOntology gets saved in src/main/resources. We can open the OWL file in Protege and view the ontology.

3. Overview of important Java-classes (in OWLOOP) and their methods

Java-classes methods
Path: OWLOOP/src/.../owloop/core/

This path contains, all core Java-classes. Among them, one in particular is immediately useful, i.e., OntologyReference. It allows to create/load/save an OWL ontology file.
The following method allows to enable/disable display of internal logging:

activateAMORlogging()
The following methods allow to instantiate an object of the Java-class OWLReferences:

newOWLReferencesCreatedWithPellet()
newOWLReferencesFromFileWithPellet()
newOWLReferencesFromWebWithPellet()
The object of Java-class OWLReferences, offers the following methods:

#0000FFsaveOntology()
#0000FFsynchronizeReasoner()
#0000FFload() // is hidden and used internally
Path: OWLOOP/src/.../owloop/descriptor/utility/

This path contains the directories that contain all Java-classes that are (as we call them) descriptors. The directories are the following:
/classDescriptor
/dataPropertyDescriptor
/objectPropertyDescriptor
/individualDescriptor.
The object of a Descriptor, offers the following methods:

#f03c15add...()
#f03c15remove...()
#f03c15build...()
#f03c15get...()
#f03c15query...()
#f03c15writeAxioms()
#f03c15readAxioms()
#f03c15reason()
#f03c15saveOntology()

4. Wiki documentation

The OWLOOP API's core aspects are described in this repository's wiki:

  • Structure of the OWLOOP API project.

  • JavaDoc of the OWLOOP API project.

  • What is a Descriptor in OWLOOP?

  • Code examples that show how to:

    • Construct a type of descriptor.

    • Add axioms to an ontology by using descriptors.

    • Infer some knowledge (i.e., axioms) from the axioms already present within an ontology by using descriptors. This example also highlights the use of the build() method.

    • Remove axioms from an ontology by using descriptors.

5. Some details about OWLOOP dependencies

Please use Gradle as the build tool for your project, and include the following dependencies in your project's build.gradle file:

  • aMOR (latest release is amor-2.2): a Multi-Ontology Reference library is based on OWL-API and it provides helper functions to OWLOOP.
    • OWL-API: a Java API for creating, manipulating and serialising OWL Ontologies. We have included owlapi-distribution-5.0.5 within amor-2.2.
  • OWLOOP (latest release is owloop-2.2): an API that enables easy manipulation of OWL (Ontology Web Language) ontologies from within an OOP (Object Oriented Programming) paradigm.
    • Pellet: an open source OWL 2 DL reasoner. We have included openllet-owlapi-2.5.1 within owloop-2.2.

6. Developers' message

Feel free to contribute to OWLOOP by sharing your thoughts and ideas, raising issues (if found) and providing bug-fixes. For any information or support, please do not hesitate to contact us through this Github repository or by email.

Developed by [email protected] and [email protected] under the supervision of [email protected].

7. License

OWLOOP is under the license: GNU General Public License v3.0

You might also like...
Implemented fully documented Particle Swarm Optimization algorithm (basic model with few advanced features) using Python programming language
Implemented fully documented Particle Swarm Optimization algorithm (basic model with few advanced features) using Python programming language

Implemented fully documented Particle Swarm Optimization (PSO) algorithm in Python which includes a basic model along with few advanced features such as updating inertia weight, cognitive, social learning coefficients and maximum velocity of the particle.

A programming language written with python
A programming language written with python

Kaoft A programming language written with python How to use A simple Hello World: c="Hello World" c Output: "Hello World" Operators: a=12

A general-purpose programming language, focused on simplicity, safety and stability.
A general-purpose programming language, focused on simplicity, safety and stability.

The Rivet programming language A general-purpose programming language, focused on simplicity, safety and stability. Rivet's goal is to be a very power

Web-interface + rest API for classification and regression (https://jeff1evesque.github.io/machine-learning.docs)
Web-interface + rest API for classification and regression (https://jeff1evesque.github.io/machine-learning.docs)

Machine Learning This project provides a web-interface, as well as a programmatic-api for various machine learning algorithms. Supported algorithms: S

Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)
Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)

Karate Club is an unsupervised machine learning extension library for NetworkX. Please look at the Documentation, relevant Paper, Promo Video, and Ext

MazeRL is an application oriented Deep Reinforcement Learning (RL) framework
MazeRL is an application oriented Deep Reinforcement Learning (RL) framework

MazeRL is an application oriented Deep Reinforcement Learning (RL) framework, addressing real-world decision problems. Our vision is to cover the complete development life cycle of RL applications ranging from simulation engineering up to agent development, training and deployment.

A Research-oriented Federated Learning Library and Benchmark Platform for Graph Neural Networks. Accepted to ICLR'2021 - DPML and MLSys'21 - GNNSys workshops.

FedGraphNN: A Federated Learning System and Benchmark for Graph Neural Networks A Research-oriented Federated Learning Library and Benchmark Platform

Data & Code for ACCENTOR Adding Chit-Chat to Enhance Task-Oriented Dialogues

ACCENTOR: Adding Chit-Chat to Enhance Task-Oriented Dialogues Overview ACCENTOR consists of the human-annotated chit-chat additions to the 23.8K dialo

Official repository for
Official repository for "Action-Based Conversations Dataset: A Corpus for Building More In-Depth Task-Oriented Dialogue Systems"

Action-Based Conversations Dataset (ABCD) This respository contains the code and data for ABCD (Chen et al., 2021) Introduction Whereas existing goal-

Releases(2.1)
Owner
TheEngineRoom-UniGe
Human Robot Interaction and Artificial Intelligence Lab in Genoa, Italy.
TheEngineRoom-UniGe
This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Information Maximization for Multimodal Sentiment Analysis, accepted at EMNLP 2021.

MultiModal-InfoMax This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Informa

Deep Cognition and Language Research (DeCLaRe) Lab 89 Dec 26, 2022
Code and data of the EMNLP 2021 paper "Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style Transfer"

StyleAttack Code and data of the EMNLP 2021 paper "Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style Transfer" Prepare Pois

THUNLP 19 Nov 20, 2022
Official PyTorch implementation of "Contrastive Learning from Extremely Augmented Skeleton Sequences for Self-supervised Action Recognition" in AAAI2022.

AimCLR This is an official PyTorch implementation of "Contrastive Learning from Extremely Augmented Skeleton Sequences for Self-supervised Action Reco

Gty 44 Dec 17, 2022
[NeurIPS 2021] Introspective Distillation for Robust Question Answering

Introspective Distillation (IntroD) This repository is the Pytorch implementation of our paper "Introspective Distillation for Robust Question Answeri

Yulei Niu 13 Jul 26, 2022
Provide partial dates and retain the date precision through processing

Prefix date parser This is a helper class to parse dates with varied degrees of precision. For example, a data source might state a date as 2001, 2001

Friedrich Lindenberg 13 Dec 14, 2022
particle tracking model, works with the ROMS output file(qck.nc, his.nc)

particle-tracking-model-for-ROMS particle tracking model, works with the ROMS output file(qck.nc, his.nc) description this is a 2-dimensional particle

xusheng 1 Jan 11, 2022
Histocartography is a framework bringing together AI and Digital Pathology

Documentation | Paper Welcome to the histocartography repository! histocartography is a python-based library designed to facilitate the development of

155 Nov 23, 2022
A synthetic texture-invariant dataset for object detection of UAVs

A synthetic dataset for object detection of UAVs This repository contains a synthetic datasets accompanying the paper Sim2Air - Synthetic aerial datas

LARICS Lab 10 Aug 13, 2022
PyTorch implementation of ShapeConv: Shape-aware Convolutional Layer for RGB-D Indoor Semantic Segmentation.

Shape-aware Convolutional Layer (ShapeConv) PyTorch implementation of ShapeConv: Shape-aware Convolutional Layer for RGB-D Indoor Semantic Segmentatio

Hanchao Leng 82 Dec 29, 2022
Simple and understandable swin-transformer OCR project

swin-transformer-ocr ocr with swin-transformer Overview Simple and understandable swin-transformer OCR project. The model in this repository heavily r

Ha YongWook 67 Dec 31, 2022
Code for paper "A Critical Assessment of State-of-the-Art in Entity Alignment" (https://arxiv.org/abs/2010.16314)

A Critical Assessment of State-of-the-Art in Entity Alignment This repository contains the source code for the paper A Critical Assessment of State-of

Max Berrendorf 16 Oct 14, 2022
Normalization Calibration (NorCal) for Long-Tailed Object Detection and Instance Segmentation

NorCal Normalization Calibration (NorCal) for Long-Tailed Object Detection and Instance Segmentation On Model Calibration for Long-Tailed Object Detec

Tai-Yu (Daniel) Pan 24 Dec 25, 2022
Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving

GSAN Introduction Code for paper GSAN: Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving, wh

YE Luyao 6 Oct 27, 2022
Official implementation of the paper ``Unifying Nonlocal Blocks for Neural Networks'' (ICCV'21)

Spectral Nonlocal Block Overview Official implementation of the paper: Unifying Nonlocal Blocks for Neural Networks (ICCV'21) Spectral View of Nonloca

91 Dec 14, 2022
All the code and files related to the MI-Lab of UE19CS305 course in sem 5

Machine-Intelligence-Lab-CS305 The compilation of all the code an drelated files from MI-Lab UE19CS305 (of batch 2019-2023) offered by PES University

Arvind Krishna 3 Nov 10, 2022
Lightwood is Legos for Machine Learning.

Lightwood is like Legos for Machine Learning. A Pytorch based framework that breaks down machine learning problems into smaller blocks that can be glu

MindsDB Inc 312 Jan 08, 2023
Anonymize BLM Protest Images

Anonymize BLM Protest Images This repository automates @BLMPrivacyBot, a Twitter bot that shows the anonymized images to help keep protesters safe. Us

Stanford Machine Learning Group 40 Oct 13, 2022
[NeurIPS'20] Multiscale Deep Equilibrium Models

Multiscale Deep Equilibrium Models 💥 💥 💥 💥 This repo is deprecated and we will soon stop actively maintaining it, as a more up-to-date (and simple

CMU Locus Lab 221 Dec 26, 2022
Simulation code and tutorial for BBHnet training data

Simulation Dataset for BBHnet NOTE: OLD README, UPDATE IN PROGRESS We generate simulation dataset to train BBHnet, our deep learning framework for det

0 May 31, 2022