Code Monkey home page Code Monkey logo

owl2oas's Introduction

The OWL2OAS Converter

Author: Karl Hammar

This is a converter for translating OWL ontologies into OpenAPI Specification documents. OWL is a formal language for expressing concepts and their relations on the web, based on description logic. OpenAPI Specification is a standard for describing REST endpoints and operations. This tool generates REST endpoints for the classes (i.e., concepts) declared in an ontology, and generates JSON-LD schemas for those classes based on the object and data properties that they are linked to in the ontology (either via rdfs:domain/rdfs:range, or via property restrictions).

Usage

The generated OAS document is printed to stdout.

To translate a local file, use the -foption, as follows:

./OWL2OAS -f /path/to/ontology.rdf

To translate a remote file, use the -u option, as follows:

./OWL2OAS -u http://example.com/path/to/ontology.rdf

Options

  -c, --ClassInclusionPolicy       (Default: DefaultInclude) Whether to include
                                   all classes by default (overridden by
                                   o2o:included annotation). Valid options:
                                   DefaultInclude or DefaultExclude.

  -p, --PropertyInclusionPolicy    (Default: DefaultInclude) Whether to include
                                   all properties by default (overridden by
                                   o2o:included annotation). Valid options:
                                   DefaultInclude or DefaultExclude.

  -n, --no-imports                 Sets program to not follow owl:Imports
                                   declarations.

  -s, --server                     (Default: http://localhost:8080/) The server
                                   URL (where presumably an API implementation
                                   is running).

  -f, --file-path                  Required. The path to the on-disk root
                                   ontology file to translate.

  -u, --uri-path                   Required. The URI of the root ontology file
                                   to translate.

  --help                           Display this help screen.

  --version                        Display version information.

Entity inclusion policy

By default we include all classes and properties found in the parsed ontologies. If you want to specifically exclude some entity from the generated output, apply the https://karlhammar.com/owl2oas/o2o.owl#included annotation property on it, with the boolean value false. If you want to reverse this inclusion policy, for classes or properties, use the command line options --ClassInclusionPolicy or --PropertyInclusionPolicy with the value DefaultExclude; then, only the entities of that kind which have been tagged with https://karlhammar.com/owl2oas/o2o.owl#included and the value true will be included.

OWL Entity Equivalence

We do not support equivalence between classes or between properties. Strange things will probably happen if you run this tool over ontologies that depend on equivalence axioms. Feel free to try it out though!

Examples

See the examples directory.

owl2oas's People

Contributors

hammar 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.