Skip to content

Commit

Permalink
add robot release script
Browse files Browse the repository at this point in the history
  • Loading branch information
wdduncan committed Jul 6, 2018
1 parent 98191e1 commit 6e12181
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 799 deletions.
176 changes: 175 additions & 1 deletion ontology/data-source-ontology.owl

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions ontology/dev/build/RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## REALEASE PROCESS:
The release process uses the ROBOT tool produce the ontology release file `data-source-ontology.owl`.

Information about downloading and installing ROBOT is found at:
- http://robot.obolibrary.org/
- https://github.com/ontodev/robot

Since the robot.jar file is in the directory, calls to robot are made using the `java -jar ./robot.jar` command.
Alternatively, if your system is configured properly, you can edit the script to call robot directly.
For example, if the path to robot is in your `PATH` environment variable, you can replace `java -jar ./robot.jar` with `robot`.

## MERGE ERRORS AND THE CATALOG-V001.XML FILE
As you create new import files for the ontology, robot may throw an error saying it cannot locate the import ontology.
This error is most likely fixed by editing the catalog-v001.xml file in the build directory to include the new import.
For example, suppose the catalog-v001.xml only references the `ontology_annotations_import.owl` like so:
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="http://purl.roswellpark.org/ontology_annotations_import.owl" uri="ontology_annotations_import.owl"/>
</catalog>
```

You then create a file named `foo.owl` in the imports directory.
In order for the robot merge operation to execute, you need to modify the catalog file to reference `foo.owl`:
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="http://purl.roswellpark.org/ontology_annotations_import.owl" uri="ontology_annotations_import.owl"/>
<uri name="http://purl.roswellpark.org/foo.owl" uri="foo.owl"/>
</catalog>
```

## RUNNING THE RELEASE SCRIPT
To release a version of `data-source-ontology.owl`, run the `robot_release.sh` command

This will copy the `data-source-ontology-dev.owl` file and the imports into build directory, and produce the temp files:

- `data-source-ontology-merged.owl`
- `data-source-ontology-annotated.owl`
- `data-source-ontology.owl`

The `data-source-ontology.owl` is the **release file**. Open this file and check that the ontology IRI was produced correctly and that are not any errors.
The `data-source-ontology-merged.owl` and `data-source-ontology-annotated.owl` are intermediary files produced in the release process.
They are deleted after the build process completes, but they can be helpful in tracking down errors.
To prevent them from being deleted, comment out the following lines in the build script:
```
rm data-source-ontology-merged.owl
rm data-source-ontology-annotated.owl
```

Finally, when you are satisfied with the ontology generated by the release script:

- copy the build `data-source-ontology.owl` file to the ontology directory
- commit and push your changes:
```
git commit -am "create release ontology $(date '+%Y-%m-%dT%H:%M:%S')"
git push
```
- tag the repo with the date and time and push the tag:
```
git tag data_source_ontology_release_$(date '+%Y-%m-%dT%H_%M_%S') -m "ONTOLOGY REALEASE $(date '+%Y-%m-%d %H:%M:%S')"
git push origin --tags
```
4 changes: 4 additions & 0 deletions ontology/dev/build/catalog-v001.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="http://purl.roswellpark.org/ontology_annotations_import.owl" uri="ontology_annotations_import.owl"/>
</catalog>
Binary file added ontology/dev/build/robot.jar
Binary file not shown.
43 changes: 43 additions & 0 deletions ontology/dev/build/robot_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# remove any existing owl files in the directory
rm *.owl

# copy dev ontology and imports into directory
cp ../data-source-ontology-dev.owl .
cp ../imports/*import.owl .

# since the robot.jar file is in the directory, calls to robot are made using the java -jar ./robot.jar command
# alternatively, you can call robot directly if your system is configured properly
# for example, if the path to robot is in your PATH environment variable
# you can perform merge by simple executing robot merge

# merge owl files
# you can also call robot merge ...; but I have placed the jar file in the directory
java -jar ./robot.jar merge \
--inputs "*.owl" \
--include-annotations true \
--collapse-import-closure true \
--output data-source-ontology-merged.owl

# # add date to IRI version; e.g.: http://purl.obolibrary.org/obo/2018-06-05/data-source-ontology.owl
java -jar ./robot.jar annotate \
--input data-source-ontology-merged.owl \
--ontology-iri "http://purl.data-source-translation.org/data-source-translation.owl" \
--version-iri "http://purl.data-source-translation.org/`date '+%Y-%m-%d'`/data-source-translation.owl" \
--output data-source-ontology-annotated.owl

# run reasoner on the ontology and add inferred axioms to final output
java -jar ./robot.jar reason \
--input data-source-ontology-annotated.owl \
--reasoner HermiT \
--annotate-inferred-axioms true \
--output data-source-ontology.owl

# clean up
# remove imports
rm *import.owl

# remove dev, merge, annotated temp ontologies
# comment out these lines if you wish to examine them
rm data-source-ontology-dev.owl
rm data-source-ontology-merged.owl
rm data-source-ontology-annotated.owl
3 changes: 2 additions & 1 deletion ontology/dev/catalog-v001.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<group id="imports" prefer="public" xml:base="">
<uri name="http://purl.roswellpark.org/ontology-annotations.owl" uri="imports/ontology-annotations.owl"/>
<uri name="http://purl.data-source-translation.org/data-source-translation.owl" uri="data-source-translation.owl"/>
<uri name="http://purl.roswellpark.org/ontology_annotations_import.owl" uri="imports/ontology_annotations_import.owl"/>
</group>
</catalog>
8 changes: 4 additions & 4 deletions ontology/dev/data-source-ontology-dev.owl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<rdf:RDF xmlns="http://purl.data-source-translation.org/dev/data-source-translation.owl#"
xml:base="http://purl.data-source-translation.org/dev/data-source-translation.owl"
<rdf:RDF xmlns="http://purl.data-source-translation.org/data-source-translation.owl/"
xml:base="http://purl.data-source-translation.org/data-source-translation.owl/"
xmlns:annotation="http://purl.data-source-translation.org/annotation/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
Expand All @@ -14,8 +14,8 @@
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:obo="http://purl.obolibrary.org/obo/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<owl:Ontology rdf:about="http://purl.data-source-translation.org/dev/data-source-translation.owl">
<owl:imports rdf:resource="http://purl.roswellpark.org/ontology-annotations.owl"/>
<owl:Ontology rdf:about="http://purl.data-source-translation.org/data-source-translation.owl">
<owl:imports rdf:resource="http://purl.roswellpark.org/ontology_annotations_import.owl"/>
</owl:Ontology>


Expand Down
2 changes: 1 addition & 1 deletion ontology/dev/imports/catalog-v001.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<group id="Folder Repository, directory=, recursive=true, Auto-Update=true, version=2" prefer="public" xml:base="">
<uri id="Automatically generated entry, Timestamp=1527625362484" name="http://purl.roswellpark.org/ontology-annotations.owl/" uri="ontology-annotations.owl"/>
<uri id="Automatically generated entry, Timestamp=1530912005722" name="http://purl.roswellpark.org/ontology_annotations_import.owl/" uri="ontology_annotations_import.owl"/>
</group>
</catalog>
Loading

0 comments on commit 6e12181

Please sign in to comment.