Skip to content
cbizon edited this page May 6, 2021 · 12 revisions

Back to Home

PLATER Knowledge Provider Wiki Page

Packer Layering APIs to Translator Entities and Relationships (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.

Team Contact:

Chris Bizon ( [email protected] )

PLATER Tool Description

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.

Technical user guide

Numerous PLATER instances are typically hosted in a common proxy. An example can be found at AUTOMAT.

Interfaces

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.

Tips and common errors

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/

Issue support

To declare an issue with this software:

Smart API Registry link

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

How to build a PLATER instance

Create a virtual Environment and activate.

cd <PLATER-ROOT> python<version> -m venv venv source venv/bin/activate

Install dependencies

pip install -r PLATER/requirements.txt

Configure PLATER settings

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

DOCKER

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 

Miscellaneous

The /about Endpoint

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> 

Source Code

Below you will find references that detail the standards, web services and supporting tools that are part of PLATER

Clone this wiki locally