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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file rdf_expressionizer-0.1.0.tar.gz.

File metadata

  • Download URL: rdf_expressionizer-0.1.0.tar.gz
  • Upload date:
  • Size: 131.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for rdf_expressionizer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76281c0377476aacd75048d2fd4c038bb9ac0d2dde57a8006ec2fbe19528922f
MD5 4bfe68de81f86bdb34aac5fd1bd9a801
BLAKE2b-256 61658d0fdd4196c0b59fc7b6fef9dc23a2647fba50c32ea47d625fd6f3974931

See more details on using hashes here.

Provenance

File details

Details for the file rdf_expressionizer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rdf_expressionizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 276921f9f5a55d9164adae7416f1c00f8f99d79306753d88fb8652663df5522d
MD5 ca18d1363165065400f3805a074e787a
BLAKE2b-256 98048f16faccec119e0f50a86026fa535529827182d26d033403116f8d52fe42

See more details on using hashes here.

Provenance

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