Skip to main content

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

Release files for rdf-expressionizer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rdf-expressionizer 0.1.0
File Size Uploaded
rdf_expressionizer-0.1.0.tar.gz 131.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rdf-expressionizer 0.1.0
File Interpreter ABI Platform
rdf_expressionizer-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 268.1 kB

Release files / rdf_expressionizer-0.1.0.tar.gz

Download URL rdf_expressionizer-0.1.0.tar.gz
Size 131.5 kB
Tags Source
SHA-256 checksum
How to use checksums
76281c0377476aacd75048d2fd4c038bb9ac0d2dde57a8006ec2fbe19528922f
BLAKE2b-256 checksum
How to use checksums
61658d0fdd4196c0b59fc7b6fef9dc23a2647fba50c32ea47d625fd6f3974931
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / rdf_expressionizer-0.1.0-py3-none-any.whl

Download URL rdf_expressionizer-0.1.0-py3-none-any.whl
Size 136.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
276921f9f5a55d9164adae7416f1c00f8f99d79306753d88fb8652663df5522d
BLAKE2b-256 checksum
How to use checksums
98048f16faccec119e0f50a86026fa535529827182d26d033403116f8d52fe42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page