Skip to content

Commit

Permalink
Reorganising repo, adding some docs, updating loader config etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesamcl committed May 6, 2020
1 parent 602c85b commit ff8ab6f
Show file tree
Hide file tree
Showing 69 changed files with 1,895 additions and 1,338 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ solr-config/data
*.xml
*.md
!oxo-web/target/oxo-web.war
__pycache__
*.pyc
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ target/
*.DS_store
.idea
*~
data
properties
sorl-config/data
db
application.properties
dataloading/venv/
dataloading/oxo/config_localdev.ini
*.pyc
.mvn
oxo-web/src/main/resources/templates/search-orig.html
oxo-web/src/main/asciidoc/generated-snippets
oxo-web/src/main/resources/static
.settings
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>oxo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
OxO is a service for finding mappings (or cross-references) between terms from
ontologies, vocabularies and coding standards. OxO imports mappings from a
variety of sources including the [Ontology Lookup Service](https://www.ebi.ac.uk/ols/index) and a subset of
mappings provided by the [UMLS](https://www.nlm.nih.gov/research/umls/index.html).

# OxO with Docker

OxO is comprised of three components:

* The loader scripts (oxo-loader/), which pull data about terms and mappings from the OLS, OBO xrefs, and UMLS and upload them to neo4j
* The indexer (oxo-indexer/), which indexes terms and mappings found in neo4j in solr
* The Web application (oxo-web/), which provides the user interface

The OxO Web application, solr, and neo4j can be started using docker-compose:

docker-compose up

The docker-compose configuration, by default, stores all persistent data (the hsqldb, neo4j, and solr data files) in the data/ directory by mounting volumes. However, these datasets are empty until the loader and indexer have been executed.

## Running the loader

The loader requires neo4j to be running. If using docker-compose, neo4j can be
started on its own:

docker-compose up neo4j

The loader scripts can then be used as documented in the oxo-loader/ directory
to load data into neo4j.

## Running the indexer

The indexer requires neo4j and solr to be running. If using docker-compose:

docker-compose up neo4j solr

The indexer can be executed using Docker:

docker build -f oxo-indexer/Dockerfile -t oxo-indexer
docker run oxo-indexer


# OxO without Docker

Sometimes it is impractical to use Docker (e.g. for local development). To get
OxO up and running without Docker, first install:

* neo4j community edition 3.1.1
* solr 5.3.0
* Java 1.8
* Maven

The instructions for the loader are not Docker-specific, and can be found in the
oxo-loader/ directory. For the indexer and Web application, first compile the
project using Maven:

mvn clean package

Then run the indexer:

java -Xmx10g -jar oxo-indexer.jar

The Web application is a standard WAR and can be deployed using e.g. Tomcat.


Empty file added data/hsqldb/.gitkeep
Empty file.
Empty file added data/neo4j/.gitkeep
Empty file.
Empty file added data/neo4jimport/.gitkeep
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion dataloading/oxo/.dockerignore

This file was deleted.

12 changes: 0 additions & 12 deletions dataloading/oxo/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions dataloading/readme.md

This file was deleted.

25 changes: 25 additions & 0 deletions docker-compose.common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '2'
services:
solr:
image: solr:5.5.3-alpine
environment:
- SOLR_HOME=/mnt/solr
ports:
- 8983:8983
volumes:
- ./data/solr:/mnt/solr
command: ["solr", "-f"]
neo4j:
image: neo4j:3.1.1
environment:
- NEO4J_HEAP_MEMORY=10g # configure the heap memory
- NEO4J_dbms_memory_heap_maxSize=8g
- NEO4J_AUTH=neo4j/dba
cap_add:
- SYS_RESOURCE
ports:
- 7474:7474
- 7687:7687
volumes:
- ./data/neo4jimport:/var/lib/neo4j/import
- ./data/neo4j:/data
37 changes: 10 additions & 27 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,27 @@
version: '2'
services:
solr:
image: solr:5.5.3-alpine
environment:
- SOLR_HOME=/home/mysolrhome
ports:
- 8983:8983
volumes:
- ./solr-config:/home/mysolrhome
- ./solr-config/data:/home/mysolrhome/mapping/data
command: ["solr", "-f"]
extends:
file: docker-compose.common.yml
service: solr
neo4j:
image: neo4j:3.1.1
environment:
- NEO4J_HEAP_MEMORY=10g # configure the heap memory
- NEO4J_dbms_memory_heap_maxSize=8g
- NEO4J_AUTH=neo4j/dba
cap_add:
- SYS_RESOURCE
ports:
- 7474:7474
- 7687:7687
volumes:
- ./neo4jimport:/var/lib/neo4j/import
extends:
file: docker-compose.common.yml
service: neo4j
oxo:
build: .
build: oxo-web
depends_on:
- neo4j
- solr
links:
- neo4j
- solr
environment:
- spring.datasource.url=jdbc:hsqldb:file:/home/hsqldb
- spring.datasource.url=jdbc:hsqldb:file:/mnt/hsqldb
- oxo.neo.driver=org.neo4j.ogm.drivers.http.driver.HttpDriver
- oxo.neo.uri=http://neo4j:dba@neo4j:7474
- spring.data.solr.host=http://solr:8983/solr
command:
- java
- -jar
- /home/oxo.war
volumes:
- ./data/hsqldb:/mnt/hsqldb
ports:
- 8080:8080
44 changes: 44 additions & 0 deletions oxo-indexer/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Loading

0 comments on commit ff8ab6f

Please sign in to comment.