-
Notifications
You must be signed in to change notification settings - Fork 2
Plater
PLATER is a Docker container-based tool for providing uniform access to, and meta-data on, the contents of a Neo4j graph database. PLATER can be used as a simple way to instantiate a standards-compliant KG from biolink-compliant neo4j graph.
Chris Bizon ( [email protected] )
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 endpoints for the underlying Neo4j database, including a TRAPI-compliant query interface, simple lookup interfaces, and an interface for sending cypher queries..
The following REST endpoints are created and maintained by PLATER:
Endpoint verb | Description |
---|---|
/query | A TRAPI question-answering interface. |
/predicates | Returns metadata about available data types. Defined in the TRAPI spec. |
/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 TRAPI message, add edges that connect any nodes in the Knowledge Graph. |
/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. JSON 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.
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 you will find references that detail the standards, web services and supporting tools that are part of PLATER