Coder Social home page Coder Social logo

cmungall / rdf-expressionizer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 195 KB

Translates named classes to equivalent class expressions

License: BSD 3-Clause "New" or "Revised" License

Makefile 9.69% Python 90.31%
bfo obofoundry upper-ontology

rdf-expressionizer's Introduction

rdf-expressionizer

Translates named classes to equivalent class expressions.

The primary use case for this is rewiring ontologies that use upper ontologies such as BFO, preserving semantic entailment, and hiding upper ontology classes in an orthogonal hierarchy.

Installation

pipx install rdf-expressionizer
rdf-expressionizer --help

Example Workflows

Rewiring an ontology that uses BFO

rdf-expressionizer replace -m bfo_xbfo_mappings ro.owl -o ro-rewired.owl

Note that the semantics of axioms are preserved, but structurally rewritten.

For example, the following axiom:

Is rewritten to:

TODO: decide on which ObjectProperty to use for bfo_xbfo_mappings

Note the resulting ontology has dangling flat label-less classes. These are semantically correct, but to give them labels and hierarchy, merge with XBFO.

robot merge -i ro-rewired.owl -i src/rdf-expressionizer/xbfo.owl -o ro-rewired-pretty.owl

Rewiring an ontology preserving COB subset

rdf-expressionizer replace -x COB -m bfo_xbfo_mappings ro.owl -o ro-rewired.owl

This excludes (-x or --exclude-subset) the COB subset of BFO from the rewiring.

Augmenting COB with equivalence axioms

rdf-expressionizer augment  -m bfo_xbfo_mappings cob.owl -o cob-augmented.owl

Testing

git clone <this repo>
poetry install
make test

This runs internal unit tests, and additional tests.

One of the tests does the following:

  • injects an invalid axiom into RO
    • Cell occurs-in some 'Multi-cellular organism'
    • this axiom is designed to cause incoherency when combined with upper level BFO disjointness axioms
  • creates a rewired version of RO
  • runs robot explain
  • checks the intended unsatisfiable axiom is detected

Limitations

  • Ontology must be in RDF serialization
    • TODO: add options for non RDF/XML serializations

rdf-expressionizer's People

Contributors

cmungall avatar

Watchers

 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.