Skip to main content

rdf-expressionizer

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rdf_expressionizer-0.1.0.tar.gz (131.5 kB view hashes)

Uploaded Source

Built Distribution

rdf_expressionizer-0.1.0-py3-none-any.whl (136.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page