{"id":15985294,"url":"https://github.com/cmungall/rdf-expressionizer","last_synced_at":"2025-04-04T21:23:33.508Z","repository":{"id":219809201,"uuid":"749991455","full_name":"cmungall/rdf-expressionizer","owner":"cmungall","description":"Translates named classes to equivalent class expressions","archived":false,"fork":false,"pushed_at":"2024-01-29T19:57:40.000Z","size":195,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T06:59:56.254Z","etag":null,"topics":["bfo","obofoundry","upper-ontology"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmungall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-29T19:32:06.000Z","updated_at":"2024-08-30T03:43:55.000Z","dependencies_parsed_at":"2024-01-29T22:31:17.861Z","dependency_job_id":"5b09e323-78dc-4bb4-9bc7-a833207d80a0","html_url":"https://github.com/cmungall/rdf-expressionizer","commit_stats":null,"previous_names":["cmungall/rdf-expressionizer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmungall%2Frdf-expressionizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmungall%2Frdf-expressionizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmungall%2Frdf-expressionizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmungall%2Frdf-expressionizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmungall","download_url":"https://codeload.github.com/cmungall/rdf-expressionizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247250215,"owners_count":20908326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bfo","obofoundry","upper-ontology"],"created_at":"2024-10-08T02:20:31.686Z","updated_at":"2025-04-04T21:23:33.483Z","avatar_url":"https://github.com/cmungall.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rdf-expressionizer\n\nTranslates named classes to equivalent class expressions.\n\nThe primary use case for this is rewiring ontologies that use upper ontologies such as BFO,\npreserving semantic entailment, and hiding upper ontology classes in an orthogonal hierarchy.\n\n## Installation\n\n```bash\npipx install rdf-expressionizer\nrdf-expressionizer --help\n```\n\n## Example Workflows\n\n### Rewiring an ontology that uses BFO\n\n```bash\nrdf-expressionizer replace -m bfo_xbfo_mappings ro.owl -o ro-rewired.owl\n```\n\nNote that the semantics of axioms are preserved, but structurally rewritten.\n\nFor example, the following axiom:\n\n - [occurs in](http://purl.obolibrary.org/obo/BFO_0000066) Domain [occurrent nature](https://w3id.org/xbfo/0000003)\n\nIs rewritten to:\n\n - [occurs in](http://purl.obolibrary.org/obo/BFO_0000066) Domain [has characteristic](http://purl.obolibrary.org/obo/RO_0000053) some [occurrent nature](https://w3id.org/xbfo/0000003)\n\nTODO: decide on which ObjectProperty to use for `bfo_xbfo_mappings`\n\nNote the resulting ontology has dangling flat label-less classes. These are semantically correct, but\nto give them labels and hierarchy, merge with  [XBFO](https://w3id.org/xbfo).\n\n\n```bash\nrobot merge -i ro-rewired.owl -i src/rdf-expressionizer/xbfo.owl -o ro-rewired-pretty.owl\n```\n\n### Rewiring an ontology preserving COB subset\n\n```bash\nrdf-expressionizer replace -x COB -m bfo_xbfo_mappings ro.owl -o ro-rewired.owl\n```\n\nThis excludes (`-x` or `--exclude-subset`) the COB subset of BFO from the rewiring.\n\n### Augmenting COB with equivalence axioms\n\n```bash\nrdf-expressionizer augment  -m bfo_xbfo_mappings cob.owl -o cob-augmented.owl\n```\n\n## Testing\n\n```bash\ngit clone \u003cthis repo\u003e\npoetry install\nmake test\n```\n\nThis runs internal unit tests, and additional tests.\n\nOne of the tests does the following:\n\n- injects an invalid axiom into RO\n    - `Cell occurs-in some 'Multi-cellular organism'`\n    - this axiom is designed to cause incoherency when combined with upper level BFO disjointness axioms\n- creates a rewired version of RO\n- runs `robot explain`\n- checks the intended unsatisfiable axiom is detected\n\n* [cell](http://purl.obolibrary.org/obo/CL_0000000) SubClassOf [Nothing](http://www.w3.org/2002/07/owl#Nothing) ##\n\n  - [cell](http://purl.obolibrary.org/obo/CL_0000000) SubClassOf [anatomical structure](http://purl.obolibrary.org/obo/UBERON_0000061)\n    - [anatomical structure](http://purl.obolibrary.org/obo/UBERON_0000061) SubClassOf [material anatomical entity](http://purl.obolibrary.org/obo/UBERON_0000465)\n      - [material anatomical entity](http://purl.obolibrary.org/obo/UBERON_0000465) SubClassOf [anatomical entity](http://purl.obolibrary.org/obo/UBERON_0001062)\n        - [anatomical entity](http://purl.obolibrary.org/obo/UBERON_0001062) SubClassOf [has characteristic](http://purl.obolibrary.org/obo/RO_0000053) some [independent continuant nature](https://w3id.org/xbfo/0000004)\n          - [independent continuant nature](https://w3id.org/xbfo/0000004) SubClassOf [continuant nature](https://w3id.org/xbfo/0000002)\n  - [cell](http://purl.obolibrary.org/obo/CL_0000000) SubClassOf [occurs in](http://purl.obolibrary.org/obo/BFO_0000066) some [multicellular anatomical structure](http://purl.obolibrary.org/obo/UBERON_0010000)\n    - [occurs in](http://purl.obolibrary.org/obo/BFO_0000066) Domain [has characteristic](http://purl.obolibrary.org/obo/RO_0000053) some [occurrent nature](https://w3id.org/xbfo/0000003)\n  - [has characteristic](http://purl.obolibrary.org/obo/RO_0000053) some [continuant nature](https://w3id.org/xbfo/0000002) DisjointWith [has characteristic](http://purl.obolibrary.org/obo/RO_0000053) some [occurrent nature](https://w3id.org/xbfo/0000003)\n\n\n\n## Limitations\n\n- Ontology must be in RDF serialization\n   - TODO: add options for non RDF/XML serializations","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmungall%2Frdf-expressionizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmungall%2Frdf-expressionizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmungall%2Frdf-expressionizer/lists"}