Skip to content

Commit

Permalink
Merge branch 'master' into 886-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hkir-dev committed Feb 5, 2024
2 parents 5cab7aa + 19bab7f commit e9ac663
Show file tree
Hide file tree
Showing 49 changed files with 1,851 additions and 376 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.project
.settings
.idea
.vscode
*.iml
Gemfile*
bin/original-robot.jar
Expand Down
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- '--annotate-with-source true' does not work with extract --method subset [#1160]
- Fix how Template adds entities to the QuotedEntityChecker [#1104]
- [`merge`] and 'annotate' operations '--annotate-defined-by' excludes reserved OWL 2 vocabularies [#1171]
- Handle IRIs that are not entities in export [#1168]

## [1.9.5] - 2023-09-20

### Added
- Updated ELK from 0.4.3 to 0.5.0. [#999]. This is an important change as ELK 0.5.0 is more complete than 0.4.3, which means that it will potentially uncover inferences, in particular unsatisfiable classes, which were not recognised by ELK 0.4.3.
- Add support for pluggable commands [#1119]
- Add `--drop-axiom-annotations` option to drop axiom annotations in [`remove`] and [`filter`] [#1023]

### Changed
- Migrate to OWL API 4.5.26 to deal with [broken turtle serialiser](https://github.com/ontodev/robot/issues/1129). [#1135]
- Improvements to `export` and `report` for XLSX format [#1148]

## [1.9.4] - 2023-05-23

### Changed
- Speed up unsatisfiable object-property check on certain reasoners including HermiT [#1100]
- Update HermiT from 1.3.8.413 to 1.4.5.456 [#1073]

### Fixed
- Preserve prefixes across ontology load and save [#1101]

## [1.9.3] - 2023-02-16

### Added
Expand Down Expand Up @@ -311,7 +334,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

First official release of ROBOT!

[Unreleased]: https://github.com/ontodev/robot/compare/v1.9.3...HEAD
[Unreleased]: https://github.com/ontodev/robot/compare/v1.9.5...HEAD
[1.9.5]: https://github.com/ontodev/robot/compare/v1.9.4...v1.9.5
[1.9.4]: https://github.com/ontodev/robot/compare/v1.9.3...v1.9.4
[1.9.3]: https://github.com/ontodev/robot/compare/v1.9.2...v1.9.3
[1.9.2]: https://github.com/ontodev/robot/compare/v1.9.1...v1.9.2
[1.9.1]: https://github.com/ontodev/robot/compare/v1.9.0...v1.9.1
Expand Down Expand Up @@ -359,11 +384,20 @@ First official release of ROBOT!
[`validate`]: http://robot.obolibrary.org/validate

[#1023]: https://github.com/ontodev/robot/pull/1023
[#1171]: https://github.com/ontodev/robot/pull/1171
[#1168]: https://github.com/ontodev/robot/pull/1168
[#1160]: https://github.com/ontodev/robot/pull/1160
[#1148]: https://github.com/ontodev/robot/pull/1148
[#1135]: https://github.com/ontodev/robot/pull/1135
[#1119]: https://github.com/ontodev/robot/pull/1119
[#1104]: https://github.com/ontodev/robot/pull/1104
[#1100]: https://github.com/ontodev/robot/pull/1100
[#1091]: https://github.com/ontodev/robot/issues/1091
[#1089]: https://github.com/ontodev/robot/issues/1089
[#1088]: https://github.com/ontodev/robot/issues/1088
[#1086]: https://github.com/ontodev/robot/pull/1086
[#1084]: https://github.com/ontodev/robot/issues/1084
[#1073]: https://github.com/ontodev/robot/pull/1073
[#1071]: https://github.com/ontodev/robot/pull/1071
[#1061]: https://github.com/ontodev/robot/issues/1061
[#1030]: https://github.com/ontodev/robot/issues/1030
Expand All @@ -372,6 +406,7 @@ First official release of ROBOT!
[#1016]: https://github.com/ontodev/robot/issues/1016
[#1009]: https://github.com/ontodev/robot/issues/1009
[#1000]: https://github.com/ontodev/robot/pull/1000
[#999]: https://github.com/ontodev/robot/pull/999
[#979]: https://github.com/ontodev/robot/pull/979
[#978]: https://github.com/ontodev/robot/pull/978
[#977]: https://github.com/ontodev/robot/pull/977
Expand Down
1 change: 1 addition & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<a href="/chaining">chaining commands</a><br>
<a href="/global">global options</a><br>
<a href="/make">makefile</a><br>
<a href="/plugins">plugins</a><br>
- - - - - - - - - -<br>
<a href="/annotate">annotate</a><br>
<a href="/collapse">collapse</a><br>
Expand Down
2 changes: 1 addition & 1 deletion docs/annotate.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ General annotations can be added one-by-one with `--annotation`, and the IRIs ca
--annotation rdfs:comment "Comment" \
--annotation rdfs:label "Label" \
--annotation-file annotations.ttl \
--output results/edit-annotated.owl
--output results/edi-annotated.owl

Or all at once from a turtle (.ttl) file with `--annotation-file`:
<!-- DO NOT TEST -->
Expand Down
File renamed without changes.
62 changes: 0 additions & 62 deletions docs/examples/example2_defined_by.owl
Original file line number Diff line number Diff line change
Expand Up @@ -78,62 +78,12 @@



<!-- http://www.w3.org/2000/01/rdf-schema#comment -->

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#comment">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



<!-- http://www.w3.org/2000/01/rdf-schema#isDefinedBy -->

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#isDefinedBy">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



<!-- http://www.w3.org/2000/01/rdf-schema#label -->

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#label">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



<!-- http://www.w3.org/ns/prov#wasDerivedFrom -->

<owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#wasDerivedFrom">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</owl:AnnotationProperty>



<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Datatypes
//
///////////////////////////////////////////////////////////////////////////////////////
-->




<!-- http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral -->

<rdf:Description rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



<!-- http://www.w3.org/2001/XMLSchema#string -->

<rdf:Description rdf:about="http://www.w3.org/2001/XMLSchema#string">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



Expand Down Expand Up @@ -284,18 +234,6 @@
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
<rdfs:label>dummy individal 5</rdfs:label>
</owl:NamedIndividual>



<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Annotations
//
///////////////////////////////////////////////////////////////////////////////////////
-->

<rdf:Description rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral"/>
</rdf:RDF>


Expand Down
42 changes: 0 additions & 42 deletions docs/examples/merged_defined_by.owl
Original file line number Diff line number Diff line change
Expand Up @@ -78,54 +78,12 @@



<!-- http://www.w3.org/2000/01/rdf-schema#comment -->

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#comment">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



<!-- http://www.w3.org/2000/01/rdf-schema#isDefinedBy -->

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#isDefinedBy">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



<!-- http://www.w3.org/2000/01/rdf-schema#label -->

<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#label">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



<!-- http://www.w3.org/ns/prov#wasDerivedFrom -->

<owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#wasDerivedFrom">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</owl:AnnotationProperty>



<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Datatypes
//
///////////////////////////////////////////////////////////////////////////////////////
-->




<!-- http://www.w3.org/2001/XMLSchema#string -->

<rdf:Description rdf:about="http://www.w3.org/2001/XMLSchema#string">
<rdfs:isDefinedBy rdf:resource="https://github.com/ontodev/robot/examples/edit.owl"/>
</rdf:Description>



Expand Down
25 changes: 14 additions & 11 deletions docs/examples/subset_result.owl
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,31 @@
<!-- http://www.geneontology.org/formats/oboInOwl#hasDbXref -->

<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#hasDbXref">
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">database_cross_reference</rdfs:label>
<rdfs:label>database_cross_reference</rdfs:label>
</owl:AnnotationProperty>



<!-- http://www.geneontology.org/formats/oboInOwl#id -->

<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#id"/>
<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#id">
<rdfs:label>id</rdfs:label>
</owl:AnnotationProperty>



<!-- http://www.geneontology.org/formats/oboInOwl#inSubset -->

<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#inSubset">
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">in_subset</rdfs:label>
<rdfs:label>in_subset</rdfs:label>
</owl:AnnotationProperty>



<!-- http://www.geneontology.org/formats/oboInOwl#shorthand -->

<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#shorthand">
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">shorthand</rdfs:label>
<rdfs:label>shorthand</rdfs:label>
</owl:AnnotationProperty>


Expand All @@ -66,10 +68,10 @@
<!-- http://purl.obolibrary.org/obo/BFO_0000050 -->

<owl:ObjectProperty rdf:about="http://purl.obolibrary.org/obo/BFO_0000050">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
<oboInOwl:hasDbXref rdf:datatype="http://www.w3.org/2001/XMLSchema#string">BFO:0000050</oboInOwl:hasDbXref>
<oboInOwl:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">part_of</oboInOwl:id>
<oboInOwl:shorthand rdf:datatype="http://www.w3.org/2001/XMLSchema#string">part_of</oboInOwl:shorthand>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
<oboInOwl:hasDbXref>BFO:0000050</oboInOwl:hasDbXref>
<oboInOwl:id>part_of</oboInOwl:id>
<oboInOwl:shorthand>part_of</oboInOwl:shorthand>
</owl:ObjectProperty>


Expand All @@ -88,7 +90,7 @@
<!-- http://purl.obolibrary.org/obo/ONT_1 -->

<owl:Class rdf:about="http://purl.obolibrary.org/obo/ONT_1">
<oboInOwl:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">ONT:1</oboInOwl:id>
<oboInOwl:id>ONT:1</oboInOwl:id>
<oboInOwl:inSubset rdf:resource="http://purl.obolibrary.org/obo/test#foo"/>
</owl:Class>

Expand All @@ -103,11 +105,12 @@
<owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/ONT_1"/>
</owl:Restriction>
</rdfs:subClassOf>
<oboInOwl:id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">ONT:5</oboInOwl:id>
<oboInOwl:id>ONT:5</oboInOwl:id>
<oboInOwl:inSubset rdf:resource="http://purl.obolibrary.org/obo/test#foo"/>
</owl:Class>
</rdf:RDF>



<!-- Generated by the OWL API (version 4.5.9) https://github.com/owlcs/owlapi -->
<!-- Generated by the OWL API (version 4.5.26) https://github.com/owlcs/owlapi -->

14 changes: 8 additions & 6 deletions docs/extract.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ For more details see the [MIREOT paper](http://dx.doi.org/10.3233/AO-2011-0087).

The subset method extracts a sub-ontology that contains only the seed terms (that you specify with `--term` and `--term-file` options) and the relations between them. This method uses the [relation-graph](https://github.com/balhoff/relation-graph) to materialize the existential relations among the seed terms. Procedurally, the subset method materializes the input ontology and adds the inferred axioms to the input ontology. Then filters the ontology with the given seed terms. Finally, it reduces the filtered ontology to remove redundant subClassOf axioms.

robot extract --method subset \
--input subset.obo \
--term "obo:ONT_1" \
--term "obo:ONT_5" \
--term "BFO:0000050" \
--output results/subset_result.owl
```
robot extract --method subset \
--input subset.obo \
--term "obo:ONT_1" \
--term "obo:ONT_5" \
--term "BFO:0000050" \
--output results/subset_result.owl
```
ROBOT expects any `--term` or IRI in the `--term-file` to exist in the input ontology. If none of the input terms exist, the command will fail with an [empty terms error](errors#empty-terms-error). This can be overridden by including `--force true`.

Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ The command-line tool is packaged a Java JAR file and can be run via the `robot`
1. Download the `robot.jar` file from the [latest release](https://github.com/ontodev/robot/releases/latest).
2. Save the [ROBOT batch script](https://github.com/ontodev/robot/raw/master/bin/robot.bat).
- Make sure this is saved as `.bat` and not `.bat.txt`
- OR enter `"java %ROBOT_JAVA_ARGS% -jar %~dr0robot.jar %*" | out-file robot.bat -encoding utf8` in the same directory as `robot.jar` to create the batch script.
- OR in [PowerShell](https://learn.microsoft.com/powershell/), run `"java %ROBOT_JAVA_ARGS% -jar %~dp0robot.jar %*" | out-file robot.bat -encoding utf8` in the same directory as `robot.jar` to create the batch script.
- Note that the above command requires PowerShell version 6 or later: previous versions will write a Unicode byte order mark (BOM) to the file, which breaks the command.
3. Put both files on your [system PATH](https://en.wikipedia.org/wiki/PATH_(variable)) in the same directory.
- this could be `C:\Windows\`
- OR [update your PATH](https://docs.oracle.com/javase/tutorial/essential/environment/paths.html) to include the new directory.
Expand Down
2 changes: 2 additions & 0 deletions docs/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ It’s also possible to annotate the imported or merged ontology axioms with the
robot merge --input example2.owl --input merge.owl \
--annotate-defined-by true \
--output results/merged_defined_by.owl

`--annotate-defined-by` excludes entities from the reserved OWL 2 vocabularies (RDF, RDFS, XSD and OWL).
36 changes: 36 additions & 0 deletions docs/plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Plugins

The set of ROBOT commands can be extended locally with plugins. A ROBOT plugin is a Java archive file (`.jar`) providing one or more supplementary commands (hereafter called "pluggable commands").

## Using plugins

ROBOT searches for plugins in the following locations:

* the `.robot/plugins` directory in the current user's home directory;
* the directory specified by the Java system property `robot.pluginsdir`, if such a property is set;
* the directory specified by the environment variable `ROBOT_PLUGINS_DIRECTORY`, if such a variable is set in the environment.

Installing a plugin is therefore simply a matter of either

* placing the Jar file into your `~/.robot/plugins` directory, or
* placing the Jar file into any directory and making sure ROBOT knows to search that directory, by setting the `robot.pluginsdir` system property or the `ROBOT_PLUGINS_DIRECTORY` environment variable accordingly.

Importantly, the basename of the Jar file (without the `.jar` extension) within the directory will become part of the name of any pluggable command provided by the plugin. For example, if the file is named `myplugin.jar` and it provides a command called `mycommand`, that command will be available under the name `myplugin:mycommand`. Because of that:

* the name of the Jar file **must** be in lowercase only;
* the name **should** be kept short and simple.

Once the plugin is installed, any pluggable command it provides is immediately available to ROBOT. You can check by calling `robot` without any argument to get it to print the full list of available commands, which will include the commands provided by installed plugins, if any.

## Creating plugins

A pluggable command, just like any other ROBOT command, is a Java class that implements the `org.obolibrary.robot.Command` interface. A plugin is Java archive file that contains at least:

* the compiled Java code ("bytecode") for at least one class implementing the `org.obolibrary.robot.Command` interface, and
* a `META-INF/services/org.obolibrary.robot.Command` file that list all implementations of that interface available in the archive (one per line).

For example, if the command `mycommand` is implemented in a class named `MyCommand` in the package `org.example.myplugin`, the `META-INF/services/org.obolibrary.robot.Command` file must contain a single line `org.example.myplugin.MyCommand`.

In addition to the class implementing the command itself, the archive must also provide any additional classes that may be required for the command to work. This must include classes from any external dependency, unless that dependency also happens to be a dependency of ROBOT itself (for example, there is no need for the archive to contain a copy of the classes of the OWL API, since they are already present in the standard distribution of ROBOT).

A more detailed walkthrough of how to create a plugin is available [here](https://incenp.org/notes/2023/writing-robot-plugins.html).
Loading

0 comments on commit e9ac663

Please sign in to comment.