Skip to content

Commit

Permalink
Optimize imports and reformat everything with IntelliJ defaults. (#458)
Browse files Browse the repository at this point in the history
* Optimize imports and reformat everything with IntelliJ defaults.

* Fix test to use correct root type for complexes.

* Fix lookup test for new protein complex classification.
  • Loading branch information
balhoff authored Feb 23, 2022
1 parent 592dca6 commit 11b6ec8
Show file tree
Hide file tree
Showing 167 changed files with 26,409 additions and 27,400 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- master
- dev
pull_request:
branches:
branches:
- master
- dev

Expand All @@ -19,11 +19,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn test
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn test
73 changes: 41 additions & 32 deletions INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<!-- MarkdownTOC -->

- [About this document](#about-this-document)
- [Building the server](#building-the-server)
- [Prerequisites to build the code](#prerequisites-to-build-the-code)
- [Building the Minerva Server](#building-the-minerva-server)
- [Running the Minerva Server](#running-the-minerva-server)
- [Prerequisites](#prerequisites)
- [Start the MolecularModelManager server from the command line](#start-the-molecularmodelmanager-server-from-the-command-line)
- [Start Server via Eclipse:](#start-server-via-eclipse)
- [Running Tests](#running-tests)
- [Failing Tests](#failing-tests)
- [Quick Test via `curl`](#quick-test-via-curl)
- [Sonarqube](#Sonarqube)
- [Obtaining `owl-models` and `go-lego.owl`](#obtaining-owl-models-and-go-legoowl)
- [Useful source files for learning](#useful-source-files-for-learning)
- [Using the Blazegraph model store](#using-the-blazegraph-model-store)
- [Create a new Blazegraph journal from a directory of existing model files](#create-a-new-blazegraph-journal-from-a-directory-of-existing-model-files)
- [Dump model files from a Blazegraph journal that is not in use](#dump-model-files-from-a-blazegraph-journal-that-is-not-in-use)
- [Start the Minerva Server with configuration for Blazegraph journal and model dump folder](#start-the-minerva-server-with-configuration-for-blazegraph-journal-and-model-dump-folder)
- [Request an OWL dump of all models from a running Minerva Server](#request-an-owl-dump-of-all-models-from-a-running-minerva-server)
- [Building the server](#building-the-server)
- [Prerequisites to build the code](#prerequisites-to-build-the-code)
- [Building the Minerva Server](#building-the-minerva-server)
- [Running the Minerva Server](#running-the-minerva-server)
- [Prerequisites](#prerequisites)
- [Start the MolecularModelManager server from the command line](#start-the-molecularmodelmanager-server-from-the-command-line)
- [Start Server via Eclipse:](#start-server-via-eclipse)
- [Running Tests](#running-tests)
- [Failing Tests](#failing-tests)
- [Quick Test via `curl`](#quick-test-via-curl)
- [Sonarqube](#Sonarqube)
- [Obtaining `owl-models` and `go-lego.owl`](#obtaining-owl-models-and-go-legoowl)
- [Useful source files for learning](#useful-source-files-for-learning)
- [Using the Blazegraph model store](#using-the-blazegraph-model-store)
- [Create a new Blazegraph journal from a directory of existing model files](#create-a-new-blazegraph-journal-from-a-directory-of-existing-model-files)
- [Dump model files from a Blazegraph journal that is not in use](#dump-model-files-from-a-blazegraph-journal-that-is-not-in-use)
- [Start the Minerva Server with configuration for Blazegraph journal and model dump folder](#start-the-minerva-server-with-configuration-for-blazegraph-journal-and-model-dump-folder)
- [Request an OWL dump of all models from a running Minerva Server](#request-an-owl-dump-of-all-models-from-a-running-minerva-server)

<!-- /MarkdownTOC -->

Expand All @@ -30,8 +30,8 @@ This is a quick overview on how to setup a Java server for the MolecularModelMan

### Prerequisites to build the code

* Java (JDK 1.8 or later) as compiler
* Maven (3.0.x) Build-Tool
* Java (JDK 1.8 or later) as compiler
* Maven (3.0.x) Build-Tool

### Building the Minerva Server

Expand Down Expand Up @@ -79,8 +79,8 @@ start-m3-server.sh -c go-trunk/ontology/extensions/catalog-v001.xml \

### Automatically create a catalog file pointing to local copies of the imported ontologies

If you have [ROBOT](http://robot.obolibrary.org) installed, you can easily create a local mirror of an OWL imports chain, so that large
imported ontologies don't need to be repeatedly downloaded while you are developing locally:
If you have [ROBOT](http://robot.obolibrary.org) installed, you can easily create a local mirror of an OWL imports
chain, so that large imported ontologies don't need to be repeatedly downloaded while you are developing locally:

`robot mirror --input my-ontology.owl --directory my-cache --output my-catalog.xml`

Expand All @@ -102,7 +102,6 @@ https://raw.githubusercontent.com/evidenceontology/evidenceontology/master/gaf-e

[Maven CLI](http://maven.apache.org/ref/3.3.9/maven-embedder/cli.html)


### Quick Test via `curl`

This assumes you are in the `minerva/` directory, which is the parent of `minerva-server/`.
Expand All @@ -113,7 +112,8 @@ curl localhost:6800/`cat minerva-server/src/test/resources/server-test/long-get.

### Sonarqube

Run sonarqube server locally using docker and ensure it is up and running by visiting [http://localhost:9000](http://localhost:9000)
Run sonarqube server locally using docker and ensure it is up and running by
visiting [http://localhost:9000](http://localhost:9000)

```
docker run -d --rm --name sonarqube -p 9000:9000 sonarqube:7.9.6-community
Expand All @@ -131,15 +131,17 @@ For static analysis and code coverage:
mvn clean package sonar:sonar
```

Stopping sonarqube docker container. This would automatically remove the container since the <i>--rm</i> option was used above.
Stopping sonarqube docker container. This would automatically remove the container since the <i>--rm</i> option was used
above.

```
docker stop sonarqube
```

## Obtaining `owl-models` and `go-lego.owl`

See [Monarch Ontology](https://github.com/monarch-initiative/monarch-ontology) and use the instructions there to generate a `catalog-v001.xml`.
See [Monarch Ontology](https://github.com/monarch-initiative/monarch-ontology) and use the instructions there to
generate a `catalog-v001.xml`.

- ftp://ftp.geneontology.org/pub/go//experimental/lego/server/owl-models
- ftp://ftp.geneontology.org/pub/go//ontology/extensions/go-lego.owl
Expand All @@ -148,7 +150,6 @@ See [Monarch Ontology](https://github.com/monarch-initiative/monarch-ontology) a

- `/minerva-server/src/main/java/org/geneontology/minerva/server/handler/M3BatchHandler.java`


## Using the Blazegraph model store

### Create a new Blazegraph journal from a directory of existing model files
Expand All @@ -163,7 +164,8 @@ See [Monarch Ontology](https://github.com/monarch-initiative/monarch-ontology) a

`java "-Xmx$MINERVA_MEMORY" -jar minerva-server.jar -c catalog-v001.xml -g http://purl.obolibrary.org/obo/go/extensions/go-lego.owl -f blazegraph.jnl --export-folder exported-models --port 9999 --use-request-logging --slme-elk --skip-class-id-validation --set-important-relation-parent http://purl.obolibrary.org/obo/LEGOREL_0000000`

Note the options `-f blazegraph.jnl` for specifying the journal file and `--export-folder exported-models` for specifying where to write OWL models in response to a `export-all` operation request.
Note the options `-f blazegraph.jnl` for specifying the journal file and `--export-folder exported-models` for
specifying where to write OWL models in response to a `export-all` operation request.

### Request an OWL dump of all models from a running Minerva Server

Expand All @@ -173,9 +175,13 @@ This will output to the folder configured in the startup arguments.

### Run a SPARQL Update against the triples in the database

*This should be handled with care since direct changes to triples will bypass any validations that typically occur when data are edited via the standard Minerva server API.*
*This should be handled with care since direct changes to triples will bypass any validations that typically occur when
data are edited via the standard Minerva server API.*

[SPARQL Update](http://www.w3.org/TR/sparql11-update/) is useful for various bulk maintenance operations that may periodically be necessary, e.g. updating all uses of an obsolete property to the current preferred IRI. Before running the update, the server should be stopped, since the Blazegraph journal can only be used from one Java process at a time. Then simply run the command like this:
[SPARQL Update](http://www.w3.org/TR/sparql11-update/) is useful for various bulk maintenance operations that may
periodically be necessary, e.g. updating all uses of an obsolete property to the current preferred IRI. Before running
the update, the server should be stopped, since the Blazegraph journal can only be used from one Java process at a time.
Then simply run the command like this:

```bash
java -jar minerva-cli.jar --sparql-update -j blazegraph.jnl -f update.rq
Expand All @@ -199,8 +205,11 @@ WHERE {

## SPARQL endpoint service

Minerva provides a read-only SPARQL query service at the `/sparql` path. Using GET, a URL-encoded query can be submitted as a value for the `query` parameter. Alternatively, POST can be used to submit form data with a `query` parameter, or to submit a SPARQL query directly, using the `application/sparql-query` MIME type.
Minerva provides a read-only SPARQL query service at the `/sparql` path. Using GET, a URL-encoded query can be submitted
as a value for the `query` parameter. Alternatively, POST can be used to submit form data with a `query` parameter, or
to submit a SPARQL query directly, using the `application/sparql-query` MIME type.

### SPARQL endpoint configuration

The only configurable aspect of the SPARQL endpoint is the query timeout. This can be set with a command-line option to the Minerva server at startup: `--sparql-endpoint-timeout 10`. The value is the time in seconds; the default is `10`.
The only configurable aspect of the SPARQL endpoint is the query timeout. This can be set with a command-line option to
the Minerva server at startup: `--sparql-endpoint-timeout 10`. The value is the time in seconds; the default is `10`.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ To build and launch a server, see [INSTRUCTIONS.md](INSTRUCTIONS.md)

## About

Minerva is a wrapper and server for the OWL API and a triplestore (currently
blazegraph) that serves as the
back end for Noctua. It communicates with Noctua via Barista. It gains
its knowledge of the world through a Golr instance.
Minerva is a wrapper and server for the OWL API and a triplestore (currently blazegraph) that serves as the back end for
Noctua. It communicates with Noctua via Barista. It gains its knowledge of the world through a Golr instance.

For specifications, see [specs/](specs)

## Code

* minerva-core : core logic
* minerva-json : conversion to and from the JSON-LD esque transport and model exchange format
* minerva-converter : converter to/from other formats. Primarily GAF/GPAD
* minerva-lookup : To be deprecated? Non-generic functions for looking up genes in golr
* minerva-server : JAX-RS server
* minerva-cli : command line interface
* minerva-core : core logic
* minerva-json : conversion to and from the JSON-LD esque transport and model exchange format
* minerva-converter : converter to/from other formats. Primarily GAF/GPAD
* minerva-lookup : To be deprecated? Non-generic functions for looking up genes in golr
* minerva-server : JAX-RS server
* minerva-cli : command line interface
6 changes: 5 additions & 1 deletion configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Configurable Minerva options

This document covers some of the configurable aspects of Minerva.

## Model ID prefix
The model ID prefix is used when constructing IRIs to name new models and individuals (which are based on their containing model ID). The default is `http://model.geneontology.org/`, however this can be changed via a command-line argument for most CLI commands and the server startup. E.g. `--model-id-prefix 'http://model.myproject.org/'`.

The model ID prefix is used when constructing IRIs to name new models and individuals (which are based on their
containing model ID). The default is `http://model.geneontology.org/`, however this can be changed via a command-line
argument for most CLI commands and the server startup. E.g. `--model-id-prefix 'http://model.myproject.org/'`.

*TODO: check consistency of argument names across CLI commands.*
Loading

0 comments on commit 11b6ec8

Please sign in to comment.