Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maven plugin to update OBO context #608

Merged
merged 4 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<modules>
<module>robot-core</module>
<module>robot-command</module>
<module>robot-maven-plugin</module>
</modules>

<profiles>
Expand Down Expand Up @@ -210,6 +211,11 @@
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.obolibrary.robot</groupId>
<artifactId>robot-maven-plugin</artifactId>
<version>1.6.0-SNAPSHOT</version>
</plugin>
</plugins>
</build>

Expand Down
117 changes: 105 additions & 12 deletions robot-core/src/main/resources/obo_context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -19,83 +19,137 @@
"cc": "http://creativecommons.org/ns#",
"schema": "http://schema.org/",

"AAO": "http://purl.obolibrary.org/obo/AAO_",
"ADW": "http://purl.obolibrary.org/obo/ADW_",
"AEO": "http://purl.obolibrary.org/obo/AEO_",
"AERO": "http://purl.obolibrary.org/obo/AERO_",
"AGRO": "http://purl.obolibrary.org/obo/AGRO_",
"APO": "http://purl.obolibrary.org/obo/APO_",
"APOLLO_SV": "http://purl.obolibrary.org/obo/APOLLO_SV_",
"ARO": "http://purl.obolibrary.org/obo/ARO_",
"ATO": "http://purl.obolibrary.org/obo/ATO_",
"BCGO": "http://purl.obolibrary.org/obo/BCGO_",
"BCO": "http://purl.obolibrary.org/obo/BCO_",
"BFO": "http://purl.obolibrary.org/obo/BFO_",
"BILA": "http://purl.obolibrary.org/obo/BILA_",
"BOOTSTREP": "http://purl.obolibrary.org/obo/BOOTSTREP_",
"BSPO": "http://purl.obolibrary.org/obo/BSPO_",
"BTO": "http://purl.obolibrary.org/obo/BTO_",
"CARO": "http://purl.obolibrary.org/obo/CARO_",
"CDAO": "http://purl.obolibrary.org/obo/CDAO_",
"CEPH": "http://purl.obolibrary.org/obo/CEPH_",
"CHEBI": "http://purl.obolibrary.org/obo/CHEBI_",
"CHEMINF": "http://purl.obolibrary.org/obo/CHEMINF_",
"CHIRO": "http://purl.obolibrary.org/obo/CHIRO_",
"CHMO": "http://purl.obolibrary.org/obo/CHMO_",
"CIO": "http://purl.obolibrary.org/obo/CIO_",
"CL": "http://purl.obolibrary.org/obo/CL_",
"CLO": "http://purl.obolibrary.org/obo/CLO_",
"CMF": "http://purl.obolibrary.org/obo/CMF_",
"CMO": "http://purl.obolibrary.org/obo/CMO_",
"CRO": "http://purl.obolibrary.org/obo/CRO_",
"CTENO": "http://purl.obolibrary.org/obo/CTENO_",
"CVDO": "http://purl.obolibrary.org/obo/CVDO_",
"DC_CL": "http://purl.obolibrary.org/obo/DC_CL_",
"DDANAT": "http://purl.obolibrary.org/obo/DDANAT_",
"DDPHENO": "http://purl.obolibrary.org/obo/DDPHENO_",
"DIDEO": "http://purl.obolibrary.org/obo/DIDEO_",
"DINTO": "http://purl.obolibrary.org/obo/DINTO_",
"DOID": "http://purl.obolibrary.org/obo/DOID_",
"DRON": "http://purl.obolibrary.org/obo/DRON_",
"DUO": "http://purl.obolibrary.org/obo/DUO_",
"ECO": "http://purl.obolibrary.org/obo/ECO_",
"ECOCORE": "http://purl.obolibrary.org/obo/ECOCORE_",
"ECTO": "http://purl.obolibrary.org/obo/ECTO_",
"EHDA": "http://purl.obolibrary.org/obo/EHDA_",
"EHDAA": "http://purl.obolibrary.org/obo/EHDAA_",
"EHDAA2": "http://purl.obolibrary.org/obo/EHDAA2_",
"EMAP": "http://purl.obolibrary.org/obo/EMAP_",
"EMAPA": "http://purl.obolibrary.org/obo/EMAPA_",
"ENVO": "http://purl.obolibrary.org/obo/ENVO_",
"EO": "http://purl.obolibrary.org/obo/EO_",
"EPO": "http://purl.obolibrary.org/obo/EPO_",
"ERO": "http://purl.obolibrary.org/obo/ERO_",
"ExO": "http://purl.obolibrary.org/obo/ExO_",
"EUPATH": "http://purl.obolibrary.org/obo/EUPATH_",
"EV": "http://purl.obolibrary.org/obo/EV_",
"EXO": "http://purl.obolibrary.org/obo/EXO_",
"FAO": "http://purl.obolibrary.org/obo/FAO_",
"FBSP": "http://purl.obolibrary.org/obo/FBSP_",
"FBbi": "http://purl.obolibrary.org/obo/FBbi_",
"FBbt": "http://purl.obolibrary.org/obo/FBbt_",
"FBcv": "http://purl.obolibrary.org/obo/FBcv_",
"FBdv": "http://purl.obolibrary.org/obo/FBdv_",
"FBsp": "http://purl.obolibrary.org/obo/FBsp_",
"FIX": "http://purl.obolibrary.org/obo/FIX_",
"FLOPO": "http://purl.obolibrary.org/obo/FLOPO_",
"FLU": "http://purl.obolibrary.org/obo/FLU_",
"FMA": "http://purl.obolibrary.org/obo/FMA_",
"FOBI": "http://purl.obolibrary.org/obo/FOBI_",
"FOODON": "http://purl.obolibrary.org/obo/FOODON_",
"FYPO": "http://purl.obolibrary.org/obo/FYPO_",
"GAZ": "http://purl.obolibrary.org/obo/GAZ_",
"GENEPIO": "http://purl.obolibrary.org/obo/GENEPIO_",
"GENO": "http://purl.obolibrary.org/obo/GENO_",
"GEO": "http://purl.obolibrary.org/obo/GEO_",
"GNO": "http://purl.obolibrary.org/obo/GNO_",
"GO": "http://purl.obolibrary.org/obo/GO_",
"GRO": "http://purl.obolibrary.org/obo/GRO_",
"HABRONATTUS": "http://purl.obolibrary.org/obo/HABRONATTUS_",
"HANCESTRO": "http://purl.obolibrary.org/obo/HANCESTRO_",
"HAO": "http://purl.obolibrary.org/obo/HAO_",
"HOM": "http://purl.obolibrary.org/obo/HOM_",
"HP": "http://purl.obolibrary.org/obo/HP_",
"HSAPDV": "http://purl.obolibrary.org/obo/HSAPDV_",
"HTN": "http://purl.obolibrary.org/obo/HTN_",
"IAO": "http://purl.obolibrary.org/obo/IAO_",
"ICEO": "http://purl.obolibrary.org/obo/ICEO_",
"ICO": "http://purl.obolibrary.org/obo/ICO_",
"IDO": "http://purl.obolibrary.org/obo/IDO_",
"IDOMAL": "http://purl.obolibrary.org/obo/IDOMAL_",
"IEV": "http://purl.obolibrary.org/obo/IEV_",
"IMR": "http://purl.obolibrary.org/obo/IMR_",
"INO": "http://purl.obolibrary.org/obo/INO_",
"IPR": "http://purl.obolibrary.org/obo/IPR_",
"KISAO": "http://purl.obolibrary.org/obo/KISAO_",
"LiPrO": "http://purl.obolibrary.org/obo/LiPrO_",
"LABO": "http://purl.obolibrary.org/obo/LABO_",
"LIPRO": "http://purl.obolibrary.org/obo/LIPRO_",
"LOGGERHEAD": "http://purl.obolibrary.org/obo/LOGGERHEAD_",
"MA": "http://purl.obolibrary.org/obo/MA_",
"MAMO": "http://purl.obolibrary.org/obo/MAMO_",
"MAO": "http://purl.obolibrary.org/obo/MAO_",
"MAT": "http://purl.obolibrary.org/obo/MAT_",
"MCO": "http://purl.obolibrary.org/obo/MCO_",
"MF": "http://purl.obolibrary.org/obo/MF_",
"MFMO": "http://purl.obolibrary.org/obo/MFMO_",
"MFO": "http://purl.obolibrary.org/obo/MFO_",
"MFOEM": "http://purl.obolibrary.org/obo/MFOEM_",
"MFOMD": "http://purl.obolibrary.org/obo/MFOMD_",
"MI": "http://purl.obolibrary.org/obo/MI_",
"MIAPA": "http://purl.obolibrary.org/obo/MIAPA_",
"miRNAO": "http://purl.obolibrary.org/obo/miRNAO_",
"MICRO": "http://purl.obolibrary.org/obo/MICRO_",
"MIRNAO": "http://purl.obolibrary.org/obo/MIRNAO_",
"MIRO": "http://purl.obolibrary.org/obo/MIRO_",
"MMO": "http://purl.obolibrary.org/obo/MMO_",
"MMUSDV": "http://purl.obolibrary.org/obo/MMUSDV_",
"MO": "http://purl.obolibrary.org/obo/MO_",
"MOD": "http://purl.obolibrary.org/obo/MOD_",
"MONDO": "http://purl.obolibrary.org/obo/MONDO_",
"MOP": "http://purl.obolibrary.org/obo/MOP_",
"MP": "http://purl.obolibrary.org/obo/MP_",
"MPATH": "http://purl.obolibrary.org/obo/MPATH_",
"MPIO": "http://purl.obolibrary.org/obo/MPIO_",
"MRO": "http://purl.obolibrary.org/obo/MRO_",
"MS": "http://purl.obolibrary.org/obo/MS_",
"NBO": "http://purl.obolibrary.org/obo/NBO_",
"NCBITaxon": "http://purl.obolibrary.org/obo/NCBITaxon_",
"ncithesaurus": "http://purl.obolibrary.org/obo/ncithesaurus_",
"NIF_Cell": "http://purl.obolibrary.org/obo/NIF_Cell_",
"NIF_Dysfunction": "http://purl.obolibrary.org/obo/NIF_Dysfunction_",
"NCIT": "http://purl.obolibrary.org/obo/NCIT_",
"NCRO": "http://purl.obolibrary.org/obo/NCRO_",
"NIF_CELL": "http://purl.obolibrary.org/obo/NIF_CELL_",
"NIF_DYSFUNCTION": "http://purl.obolibrary.org/obo/NIF_DYSFUNCTION_",
"NIF_GROSSANATOMY": "http://purl.obolibrary.org/obo/NIF_GROSSANATOMY_",
"NMR": "http://purl.obolibrary.org/obo/NMR_",
"NOMEN": "http://purl.obolibrary.org/obo/NOMEN_",
"OAE": "http://purl.obolibrary.org/obo/OAE_",
"OARCS": "http://purl.obolibrary.org/obo/OARCS_",
"OBA": "http://purl.obolibrary.org/obo/OBA_",
"OBCS": "http://purl.obolibrary.org/obo/OBCS_",
"OBI": "http://purl.obolibrary.org/obo/OBI_",
Expand All @@ -105,49 +159,88 @@
"OGI": "http://purl.obolibrary.org/obo/OGI_",
"OGMS": "http://purl.obolibrary.org/obo/OGMS_",
"OGSF": "http://purl.obolibrary.org/obo/OGSF_",
"OHD": "http://purl.obolibrary.org/obo/OHD_",
"OHMI": "http://purl.obolibrary.org/obo/OHMI_",
"OHPI": "http://purl.obolibrary.org/obo/OHPI_",
"OLATDV": "http://purl.obolibrary.org/obo/OLATDV_",
"OMIABIS": "http://purl.obolibrary.org/obo/OMIABIS_",
"OMIT": "http://purl.obolibrary.org/obo/OMIT_",
"OMP": "http://purl.obolibrary.org/obo/OMP_",
"OMRSE": "http://purl.obolibrary.org/obo/OMRSE_",
"ONTONEO": "http://purl.obolibrary.org/obo/ONTONEO_",
"OOSTT": "http://purl.obolibrary.org/obo/OOSTT_",
"OPL": "http://purl.obolibrary.org/obo/OPL_",
"OPMI": "http://purl.obolibrary.org/obo/OPMI_",
"ORNASEQ": "http://purl.obolibrary.org/obo/ORNASEQ_",
"OVAE": "http://purl.obolibrary.org/obo/OVAE_",
"PAO": "http://purl.obolibrary.org/obo/PAO_",
"PATO": "http://purl.obolibrary.org/obo/PATO_",
"PCO": "http://purl.obolibrary.org/obo/PCO_",
"PDRO": "http://purl.obolibrary.org/obo/PDRO_",
"PDUMDV": "http://purl.obolibrary.org/obo/PDUMDV_",
"PD_ST": "http://purl.obolibrary.org/obo/PD_ST_",
"PECO": "http://purl.obolibrary.org/obo/PECO_",
"PGDSO": "http://purl.obolibrary.org/obo/PGDSO_",
"PHIPO": "http://purl.obolibrary.org/obo/PHIPO_",
"PLANA": "http://purl.obolibrary.org/obo/PLANA_",
"PLANP": "http://purl.obolibrary.org/obo/PLANP_",
"PLO": "http://purl.obolibrary.org/obo/PLO_",
"PO": "http://purl.obolibrary.org/obo/PO_",
"PORO": "http://purl.obolibrary.org/obo/PORO_",
"PPO": "http://purl.obolibrary.org/obo/PPO_",
"PR": "http://purl.obolibrary.org/obo/PR_",
"PROPREO": "http://purl.obolibrary.org/obo/PROPREO_",
"PSDO": "http://purl.obolibrary.org/obo/PSDO_",
"PW": "http://purl.obolibrary.org/obo/PW_",
"RESID": "http://purl.obolibrary.org/obo/RESID_",
"REX": "http://purl.obolibrary.org/obo/REX_",
"RNAO": "http://purl.obolibrary.org/obo/RNAO_",
"RO": "http://purl.obolibrary.org/obo/RO_",
"RS": "http://purl.obolibrary.org/obo/RS_",
"RXNO": "http://purl.obolibrary.org/obo/RXNO_",
"SAO": "http://purl.obolibrary.org/obo/SAO_",
"SBO": "http://purl.obolibrary.org/obo/SBO_",
"SEP": "http://purl.obolibrary.org/obo/SEP_",
"SEPIO": "http://purl.obolibrary.org/obo/SEPIO_",
"SIBO": "http://purl.obolibrary.org/obo/SIBO_",
"SO": "http://purl.obolibrary.org/obo/SO_",
"SOPHARM": "http://purl.obolibrary.org/obo/SOPHARM_",
"SPD": "http://purl.obolibrary.org/obo/SPD_",
"STATO": "http://purl.obolibrary.org/obo/STATO_",
"SWO": "http://purl.obolibrary.org/obo/SWO_",
"SYMP": "http://purl.obolibrary.org/obo/SYMP_",
"TADS": "http://purl.obolibrary.org/obo/TADS_",
"TAHE": "http://purl.obolibrary.org/obo/TAHE_",
"TAHH": "http://purl.obolibrary.org/obo/TAHH_",
"TAO": "http://purl.obolibrary.org/obo/TAO_",
"TAXRANK": "http://purl.obolibrary.org/obo/TAXRANK_",
"TGMA": "http://purl.obolibrary.org/obo/TGMA_",
"TO": "http://purl.obolibrary.org/obo/TO_",
"TRANS": "http://purl.obolibrary.org/obo/TRANS_",
"TTO": "http://purl.obolibrary.org/obo/TTO_",
"TXPO": "http://purl.obolibrary.org/obo/TXPO_",
"UBERON": "http://purl.obolibrary.org/obo/UBERON_",
"uberon-basic": "http://purl.obolibrary.org/obo/uberon-basic_",
"UO": "http://purl.obolibrary.org/obo/UO_",
"VariO": "http://purl.obolibrary.org/obo/VariO_",
"vHOG": "http://purl.obolibrary.org/obo/vHOG_",
"UPA": "http://purl.obolibrary.org/obo/UPA_",
"UPHENO": "http://purl.obolibrary.org/obo/UPHENO_",
"VARIO": "http://purl.obolibrary.org/obo/VARIO_",
"VHOG": "http://purl.obolibrary.org/obo/VHOG_",
"VO": "http://purl.obolibrary.org/obo/VO_",
"VSAO": "http://purl.obolibrary.org/obo/VSAO_",
"VT": "http://purl.obolibrary.org/obo/VT_",
"VTO": "http://purl.obolibrary.org/obo/VTO_",
"WBbt": "http://purl.obolibrary.org/obo/WBbt_",
"WBls": "http://purl.obolibrary.org/obo/WBls_",
"WBPhenotype": "http://purl.obolibrary.org/obo/WBPhenotype_",
"WBbt": "http://purl.obolibrary.org/obo/WBbt_",
"XAO": "http://purl.obolibrary.org/obo/XAO_",
"XCO": "http://purl.obolibrary.org/obo/XCO_",
"XLMOD": "http://purl.obolibrary.org/obo/XLMOD_",
"XPO": "http://purl.obolibrary.org/obo/XPO_",
"YPO": "http://purl.obolibrary.org/obo/YPO_",
"ZEA": "http://purl.obolibrary.org/obo/ZEA_",
"ZECO": "http://purl.obolibrary.org/obo/ZECO_",
"ZFA": "http://purl.obolibrary.org/obo/ZFA_",
"ZFS": "http://purl.obolibrary.org/obo/ZFS_"
"ZFS": "http://purl.obolibrary.org/obo/ZFS_",
"ZP": "http://purl.obolibrary.org/obo/ZP_"
}
}
51 changes: 51 additions & 0 deletions robot-maven-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ROBOT Maven Plugins

This directory contains additional `mvn` plugins specific to ROBOT.

Before using these plugins, you must install the JAR:
```
mvn install
```

## ROBOT Plugins

### Update Context

This plugin updates the [`obo_context.jsonld`](https://raw.githubusercontent.com/ontodev/robot/master/robot-core/src/main/resources/obo_context.jsonld) file with the most current prefixes from the [OBO Foundry context file](https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/registry/obo_context.jsonld). You must be connected to the internet to run this plugin.

This can be run from either this directory, or the root `robot` directory:
```
mvn robot:UpdateContext -N
```

The `-N` flag is recommended so that the plugin does not run multiple times for each child module.

---

## Creating New Plugins

Add new plugins `src/main/java/org.obolibrary.robot` directory following this filename convention: `{plugin-name}Mojo.java`.

These new Java classes must extend the `AbstractMojo` class and have an `execute()` method. A `@Mojo` annotation is also required to specify the name of the plugin.
```
@Mojo(name = "MyNewPlugin")
public class MyNewPluginMojo extends AbstractMojo {

public void execute() {
// Do stuff
}
}
```

For more information on plugin development, [see here](https://maven.apache.org/guides/plugin/guide-java-plugin-development.html).

Then, install the new JAR for this module:
```
mvn install
```

Now you can run your plugin from the command line anywhere within this repo:
```
mvn robot:MyNewPlugin -N
```

63 changes: 63 additions & 0 deletions robot-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.obolibrary.robot</groupId>
<artifactId>robot</artifactId>
<version>1.6.0-SNAPSHOT</version>
</parent>

<artifactId>robot-maven-plugin</artifactId>
<version>1.6.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>robot-maven-plugin</name>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.3</version>
</plugin>

<!-- Enforce Google Java Style -->
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.obolibrary.robot</groupId>
<artifactId>robot-maven-plugin</artifactId>
<version>1.6.0-SNAPSHOT</version>
</plugin>
</plugins>
</build>

</project>
Loading