Code Monkey home page Code Monkey logo

owldlcall's Introduction

OWL DLcall

$\text{OWL~DL}^{\text{call}}$ is an extension of OWL DL enabling calls to external functions returning unique datatype values during inference. It was developped in particular to enable combining description logic-based reasoning with symbolic computation and is illustrated on a simple example showing how an equation can be classified as being a second degree polynomial equation (or quadratic equation) through the interplay of the description logic reasoner (Hermit) and python code using the SimPy library.

The $\text{OWL~DL}^{\text{call}}$ code was originally contributed by @stlnb and is maintained by the K Team at the Loria laboratory in Nancy, France.

Requirements

$\text{OWL~DL}^{\text{call}}$ is developped using the OWLready2 library to handle OWL DL ontologies and description logic reasoning. In addition, it requires Python 3.9+. To ensure that the relevant dependencies are installed, please run.

pip install -r requirements.txt

Usage

infer.py is the main entry point to the inference engine. It takes two parameters :

  • The directory in which OWL files are localted, including the call.owl file as well as any OWL file involved in the reasoning task to be carried out.
  • The IRI of the main ontology to use. The file for this ontology must be located in the directory provided, and might import other ontologies (including call.owl).

It produces on stdout the triples (in NTriples format) that are generated from calls to external functions.

Example

The samples repository contains an ontology (equations.owl), using the call ontology (call.owl), that describes classes of equations (polynomial equations, quadratic equations, etc.) and three examples of equations to be classified. It includes two definitions of calls to functions written in python to recognise whether an equation is polynomial and to compute the degree of a polynomial equation.

To run the example, apply the command line:

python infer.py samples/ 'https://k.loria.fr/ontologies/examples/equations'

This should produce the following output: <https://k.loria.fr/ontologies/examples/equations#eq2> <https://k.loria.fr/ontologies/examples/equations#degree> "2" . <https://k.loria.fr/ontologies/examples/equations#eq3> <https://k.loria.fr/ontologies/examples/equations#isAPolynomialEquation> "True" . <https://k.loria.fr/ontologies/examples/equations#eq1> <https://k.loria.fr/ontologies/examples/equations#isAPolynomialEquation> "True" . <https://k.loria.fr/ontologies/examples/equations#eq2> <https://k.loria.fr/ontologies/examples/equations#isAPolynomialEquation> "True" . <https://k.loria.fr/ontologies/examples/equations#eq1> <https://k.loria.fr/ontologies/examples/equations#degree> "2" . <https://k.loria.fr/ontologies/examples/equations#eq3> <https://k.loria.fr/ontologies/examples/equations#degree> "1" .

Therefore indicating that all three equations are polynomial, that eq1 and eq2 are of degree 2 and that eq3 is of degree 1. Adding those triples to the ontology would therefore enable classifying eq1 and eq2 as quadratic equations.

owldlcall's People

Contributors

mdaquin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.