diff --git a/README.md b/README.md index 0739446..6fe02a6 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Dockerized VIVO -This project creates three dockerized containers, +This project creates four dockerized containers, - `vivo` The vivo instance - `solr` A standalone solr instance, based on a solr docker image -- `mariadb` A standalone mariadb instance. +- `mariadb` A standalone mariadb instance +- `tpf` A standalone [Triple Pattern Fragment server](https://linkeddatafragments.org/) that queries the vivo instance. These images can be used together, or independently to setup some development or working VIVO docker instances. @@ -21,6 +22,17 @@ Regardless of the usage, you will need to build the images, which require the fo docker-compose up -d ``` +### Verification + +After running the above steps, +1. Verify your VIVO by navigating to: + - [http://localhost:8080/vivo/](http://localhost:8080/vivo/) + - username: vivo_root@mydomain.edu, password: rootPassword +1. Verify your Solr by navigating to: + - [http://localhost:8983/solr/](http://localhost:8983/solr/) +1. Verify your Triple Pattern Fragment server by navigating to: + - [http://localhost:7070/tpf/](http://localhost:7070/tpf/) + ## VIVO Runtime Example The example [docker-compose.yml](docker-compose.yml) is a typical installation for trying out a simple VIVO installation in docker. This file starts three containers and uses the standard SDB system with the mariadb backend. This example also shows how a local directory [example-config](example-config) is used to overwrite the default `runtime.properties` as installed by the Dockerfile. Here the root password, and the domain are modified. @@ -28,9 +40,7 @@ The example [docker-compose.yml](docker-compose.yml) is a typical installation f ```bash docker-compose up -d ``` - Will start this project. Navigating to http://localhost:8080/vivo will then start this simple instance. - - If you get an error indicating that the database was not found, this could be due to a bug where the vivo instance is not waiting on the mariadb instance to initialize. IF you have this error, try `docker-compose down; docker-compose up -d`. +When navigating to http://localhost:8080/vivo/, if you get an error indicating that the database was not found, this could be due to a bug where the vivo instance is not waiting on the mariadb instance to initialize. IF you have this error, try `docker-compose down; docker-compose up -d`. ## VIVO Development diff --git a/docker-compose.yml b/docker-compose.yml index 701513e..79f9c35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,13 @@ services: ports: - 8080:8080 + tpf: + build: + context: ./tpf + volumes: + - ./tpf/config:/usr/local/tpf/config + ports: + - 7070:8080 volumes: solr-data: diff --git a/tpf/Dockerfile b/tpf/Dockerfile new file mode 100644 index 0000000..2f6592c --- /dev/null +++ b/tpf/Dockerfile @@ -0,0 +1,24 @@ +FROM tomcat:9.0.27-jdk8-openjdk + +MAINTAINER Andrew Woods + +RUN apt-get update +RUN apt-get install -y maven git + +ENV TPF_MD5 c8cdb3350a0b7cf94c6a3481ca12d8d8 +ENV TPF_VERSION v0.2.4a + +RUN mkdir -v /opt/tpf +WORKDIR /opt/tpf +RUN echo "$TPF_MD5 tpf.war" > tpf.war.md5 +RUN wget -O tpf.war https://github.com/awoods/Server.Java/releases/download/${TPF_VERSION}/ldfserver-0.2.3.war && \ + md5sum -c tpf.war.md5 + +RUN mkdir /usr/local/tomcat/webapps/tpf +WORKDIR /usr/local/tomcat/webapps/tpf +RUN jar xvf /opt/tpf/tpf.war + +# Update the web.xml +COPY ./web.xml /usr/local/tomcat/webapps/tpf/WEB-INF/web.xml + +RUN export CATALINA_OPTS="-Xms512m -Xmx512m -XX:MaxPermSize=128m" diff --git a/tpf/config/.config.json.swp b/tpf/config/.config.json.swp new file mode 100644 index 0000000..0adb08c Binary files /dev/null and b/tpf/config/.config.json.swp differ diff --git a/tpf/config/config.json b/tpf/config/config.json new file mode 100644 index 0000000..cec6a37 --- /dev/null +++ b/tpf/config/config.json @@ -0,0 +1,46 @@ +{ + "title": "VIVO Linked Data Fragments server", + + "datasourcetypes": { + "SparqlDatasource" : "org.linkeddatafragments.datasource.sparql.SparqlDataSourceType" + }, + + "datasources": { + "vivo": { + "title": "VIVO Linked Data TPF", + "type": "SparqlDatasource", + "description": "VIVO Semantic TPF server", + "settings": { "endpoint": "http://vivo:8080/vivo/api/sparqlQuery", + "username": "vivo_root@mydomain.edu", + "password": "monkey" } + } + }, + + "prefixes": { + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "hydra": "http://www.w3.org/ns/hydra/core#", + "void": "http://rdfs.org/ns/void#", + "bibo": "http://purl.org/ontology/bibo/", + "c4o": "http://purl.org/spar/c4o/", + "cito": "http://purl.org/spar/cito/", + "dcterms": "http://purl.org/dc/terms/", + "event": "http://purl.org/NET/c4dm/event.owl#", + "fabio": "http://purl.org/spar/fabio/", + "foaf": "http://xmlns.com/foaf/0.1/", + "geo": "http://aims.fao.org/aos/geopolitical.owl#", + "obo": "http://purl.obolibrary.org/obo/", + "ocrer": "http://purl.org/net/OCRe/research.owl#", + "ocresst": "http://purl.org/net/OCRe/statistics.owl#", + "ocresd": "http://purl.org/net/OCRe/study_design.owl#", + "ocresp": "http://purl.org/net/OCRe/study_protocol.owl#", + "ro": "http://purl.obolibrary.org/obo/ro.owl#", + "skos": "http://www.w3.org/2004/02/skos/core#", + "swo": "http://www.ebi.ac.uk/efo/swo/", + "vcard": "http://www.w3.org/2006/vcard/ns#", + "vitro-public": "http://vitro.mannlib.cornell.edu/ns/vitro/public#", + "vivo": "http://vivoweb.org/ontology/core#", + "scires": "http://vivoweb.org/ontology/scientific-research#", + "vann": "http://purl.org/vocab/vann/" + } +} diff --git a/tpf/web.xml b/tpf/web.xml new file mode 100644 index 0000000..671e6a4 --- /dev/null +++ b/tpf/web.xml @@ -0,0 +1,17 @@ + + + Linked Data Fragments Server + + TpfServlet + TpfServlet + org.linkeddatafragments.servlet.LinkedDataFragmentServlet + + configFile + /usr/local/tpf/config/config.json + + + + TpfServlet + /* + +