-
Notifications
You must be signed in to change notification settings - Fork 2
Plater
PLATER is a Docker container-based service which supplies uniform access to, and meta-data on, the contents of a Neo4j graph database.
Chris Bizon ( cbizon@renci.org )
TODO: Disclose more team members?
A PLATER instance connects to a Neo4j database and automatically analyzes it upon startup. PLATER then auto-generates numerous TRAPI compliant GET/POST REST endpoints which directly interface with the Neo4j database. Each REST endpoint provides insight into various characteristics of the dataset.
There are some restrictions on the data structure of the Neo4j graph database to be fully compliant with PLATER:
NEO4J data structure restrictions:
- All nodes should have an
id
to be searchable (Used in querying single graph nodes)- All edges should have an
id
to be searchable (Used in generating a TRAPI)- Nodes labeled
Concept
are ignored.
Numerous PLATER instances are typically hosted in a common proxy. An example can be found at AUTOMAT.
As noted above, PLATER generates numerous TRAPI compliant REST endpoints for the underlying Neo4j database.
A typical PLATER endpoint URL: https://< site domain >/< dataset name >/< operation verb >/.
PLATER supports both GET and POST request types.
The following REST endpoints are created and maintained by PLATER:
Endpoint verb | Description |
---|---|
/about | Returns the meta-data describing the characteristics of the underlying Neo4j database. |
/cypher | Runs a cypher query against the underlying Neo4j database and returns a formatted response. |
/graph/summary | Returns a summary of the underlying Neo4j graph. |
/overlay | Given a formatted question return support edges for any resultant linked node bindings. |
/predicates | Returns source types with second level keys as targets. Second level keys are possible edge types that connect concepts. |
/query | Given a question graph return a question graph with answers. |
/reasonerapi | Returns a list of question templates that can be used to query the PLATER instance. |
/simple_spec | Returns a list of available predicates when choosing a single source or target curie |
/{source_type}/{target_type}/{curie} | Returns one hop paths from the source node type (with CURIE) to the target node type. |
/{node_type}/{curie} | Returns a node that has the matching curie. |
Receiving a message of "Not a valid Translator query" from PLATER indicates a problem with the query failing validation.
Receiving a 500 server error typically indicates an invalid JSON being sent as the query graph. JSONs can be validated easily here: https://jsonlint.com/
To declare an issue with this software:
- Please browse to: https://github.com/TranslatorSRI/Plater/issues.
- Create a new issue by selecting the "New issue" button.
- Populate the form displayed. Please enter a concise description of the issue. Include test data if available. TODO: link to installation readme in PLATER code repo.
TODO: include preface here.
- TODO: what exactly is expected here
PLATER does not have a Smart-API registration as it creates a web service that adopts the characteristics of the underlying Neo4j graph database.
For an example Smart-API registration please refer to the AUTOMAT PLATER implementation at: https://smart-api.info/registry?q=automat
cd <PLATER-ROOT> python<version> -m venv venv source venv/bin/activate
pip install -r PLATER/requirements.txt
Populate .env-template file with settings and save as .env in repo root dir:
WEB_HOST=0.0.0.0
WEB_PORT=8080
NEO4J_HOST=neo4j
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=<change_me>
NEO4J_HTTP_PORT=7474
PLATER_TITLE='Plater'
PLATER_VERSION='1.0.0'
Run the script to launch the application
./main.sh
Or build an image and run it.
cd PLATER docker build --tag <image_tag> .
docker run --env-file .env --name plater -p 8080:8080 --network <network_where_neo4j_is_running> plater-tst
The /about endpoint can be used to present meta-data about a PLATER instance. This meta-data is served from the /PLATER/about.json file. Edit the contents of this file to suit the application's needs. In a containerized environment we recommend mounting this file as a volume.
docker run -p 0.0.0.0:8999:8080 \
--env NEO4J_HOST=<your_neo_host> \
--env NEO4J_HTTP_PORT=<your_neo4j_http_port> \
--env NEO4J_USERNAME=neo4j\
--env NEO4J_PASSWORD=<neo4j_password> \
--env WEB_HOST=0.0.0.0 \
-v <your-custom-about>:/<path-to-plater-repo-home>/plater/about.json \
--network=<docker_network_neo4j_is_running_at> \
<image_tag>
Below are a few examples using the AUTOMAT HETIO PLATER instance:
To get HETIO predicates:
curl -X GET "https://automat.renci.org/hetio/predicates" -H "accept: application/json"
To Get the number of HETIO records direct form the Neo4j graph database:
curl -X POST "https://automat.renci.org/hetio/cypher" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"query\":\"MATCH (n) RETURN count(n)\"}"
Below you will find references that detail the standards, web services and supporting tools that are part of PLATER
TODO: Add more supporting documentation here.