Skip to content

Commit

Permalink
Initial stable release: 1.0.0
Browse files Browse the repository at this point in the history
- Update: Upgraded oaklib (OAK). This was a necessary, requisite upgrade, and now owl-on-fhir should be functional.
- Bugfix: Removed some Obographs JSON patching that I believe was necessary prior. I think what changed is that now OAK is handling something that was causing an error before, but now that it is handling it, the patching I'm doing is causing an OAK error. See: ontodev/robot#1082
- Bugfix: Fixed outdir if it started with ~ (tilde; 'home' shortcut character')
- Bugfix: If --retain-intermediaries is present, will now save contents in --out-dir location, rather than cache/
- Update: .gitignore: Added some missing things
  • Loading branch information
joeflack4 committed Apr 15, 2023
1 parent fae696a commit 5edde5d
Show file tree
Hide file tree
Showing 14 changed files with 798 additions and 86 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Boilerplate
/*.json
/*.owl
/env/*
!/env/.env.example
/.idea/
/.run/
/venv/
*/cache/*
!*/cache/.keep
cache/*
__pycache__/
_archive/
_dev/
Expand Down
3 changes: 3 additions & 0 deletions owl-on-fhir-1.0.0/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include README.md
include owl_on_fhir/robot.jar
include owl_on_fhir/convert_owl_ncbo2owl.pl
60 changes: 60 additions & 0 deletions owl-on-fhir-1.0.0/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Metadata-Version: 2.1
Name: owl-on-fhir
Version: 1.0.0
Summary: Python-based non-minimalistic OWL to FHIR converter.
Home-page: https://github.com/HOT-Ecosystem/owl-on-fhir/
Author: Joe Flack
Author-email: [email protected]
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.9.0
Description-Content-Type: text/markdown


# OWL-on-FHIR
![owl-on-fhir logo](https://github.com/hot-ecosystem/owl-on-fhir/blob/master/docs/owl-on-fhir%20logo%20v2.png?raw=true "OWL on FHIR")

A Python-based non-minimalistic OWL to FHIR converter.

## Installation
`pip install owl-on-fhir`

## Usage
### Syntax
`owl-on-fhir --input-path-or-url FILENAME --code-system-id ID --native-uri-stems "URL_1,...,URL_N" --code-system-url URL [NON_REQUIRED_OPTIONS]`

### Examples
`owl-on-fhir --input-path-or-url comploinc.owl --code-system-id comploinc --native-uri-stems "https://loinc.org/" --code-system-url https://github.com/loinc/comp-loinc/releases/latest/download/merged_reasoned_loinc.owl`

### CLI options
| Short Flag | Long Flag | Required | Description |
|:-----------|:----------|:------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -h | --help | | Show this help message and exit. |
| -i | --input-path-or-url | True | URL or path to OWL file to convert. |
| -s | --code-system-id | True | For `fhirjson` only. The code system ID to use for identification on the server uploaded to. See: https://hl7.org/fhir/resource-definitions.html#Resource.id |
| -S | --code-system-url | True | For `fhirjson` only. Canonical URL for the code system. See: https://hl7.org/fhir/codesystem-definitions.html#CodeSystem.url |
| -u | --native-uri-stems | True | A comma-separated list of URI stems that will be used to determine whether a concept is native to the CodeSystem. For example, for OMIM, the following URI stems are native: https://omim.org/entry/,https://omim.org/phenotypicSeries/PS". As of 2023-01-15, there is still a bug in the Obographs spec and/or `robot` where certain nodes are not being converted. This converter adds back the nodes, but to know which ones belong to the CodeSystem itself and are not foreign concepts, this parameter is necessary. OAK also makes use of this parameter. See also: https://github.com/geneontology/obographs/issues/90 |
| -o | --out-dir | False | The directory where results should be saved. |
| -n | --out-filename | False | Filename for the primary file converted, e.g. CodeSystem. |
| -p | --include-only-critical-predicates | False | If present, includes only critical predicates (is_a/parent) rather than all predicates in CodeSystem.property and CodeSystem.concept.property. |
| -t | --intermediary-type | False | Which type of intermediary to use? First, we convert OWL to that intermediary format, and then we convert that to FHIR. |
| -c | --use-cached-intermediaries | False | Use cached intermediaries if they exist? |
| -r | --retain-intermediaries | False | Retain intermediary files created during conversion process (e.g. Obograph JSON)? |
| -I | --convert-intermediaries-only | False | Convert intermediaries only? |
| -d | --dev-oak-path | False | If you want to use a local development version of OAK, specify the path to the OAK directory here. Must be used with --dev-oak-interpreter-path. |
| -D | --dev-oak-interpreter-path | False | If you want to use a local development version of OAK, specify the path to the Python interpreter where its dependencies are installed (i.e. its virtual environment). Must be used with --dev-oak-path. |

## More
### Alternative OWL to FHIR converters
### FHIR-OWL
https://github.com/aehrc/fhir-owl
Takes a minimalistic approach. Can convert top-level CodeSystem properties, concepts, and also supports some predicates, such as synonyms. Uses Java `owl-api`.

### Ontology Access Kit (OAK)
https://github.com/INCATools/ontology-access-kit/
OWL-on-FHIR is largely a wrapper around [Ontology Access Kit](https://github.com/INCATools/ontology-access-kit/) (OAK)'s FHIR converter. It adds some extra automation such as an intermediary conversion to Obographs JSON, which is currently a required input for OAK for most ontologies, given the current state of development.
Loading

0 comments on commit 5edde5d

Please sign in to comment.