This README documents the steps necessary to get your application up and running.
sherlock-epcis is the backend server responsible for converting EPCIS GS1 data to FDA CTEs & KDEs for reporting purposes.
Before starting the Sherlock API, install all requirements with:
pip3 install -r requirements.txt
Then the Flask web server can be started with:
python3 -m app
The main Flask app is in app.py, while the routes are defined in their own files in /FlaskAPI/routes.
To transform an EPCIS event into a CTE, upload an EPCIS file that uses either the EPCIS1.2 XML bindings or the proposed EPCIS2.0 JSON bindings in a POST request to http:/example.ip:5000/api/transformation/. This endpoint will currently transform an EPCIS event to a CTE, but does upload the event to the Neo4j database.
Sherlock-epcis uses Neo4j 4.1.9
The following modifications need to be made to the configuration file to run the service on port 7474
- sudo nano /etc/neo4j/neo4j.conf (elevated privileges are required for this operation)
- Uncomment line 70 as follows:
dbms.default_listen_address=0.0.0.0
- Uncomment lines 94-96 as follows:
dbms.connector.http.listen_address=:7474
dbms.connector.http.advertised_address=:7474
To enable graph algorithms, modify the neo4j config file located at /etc/neo4j/neo4j.conf as follows:
dbms.security.procedures.unrestricted=apoc.*,algo.*,gds.*
dbms.security.procedures.allowlist=gds.*,apoc.load*
dbms.security.procedures.whitelist=gds.*,apoc.*
Then download the Algorithms and Graph Data Science libraries:
neo4j-graph-data-science-1.6.2.jar
place them in the Neo4j plugins directory (i.e. /var/lib/neo4j/plugins)
To enable json file import into the Neo4j database, add the following lines at the end of the neo4j.conf file
apoc.import.file.enabled=true
apoc.import.file.use_neo4j_config=false
Classes used to represent the EPCIS events along with the URI and QuantityElement data types can be found in /JSONDeserialization/epcis_event.py.
All EPCIS event classes contain the relevant fields defined in section 7.4 of EPCIS1.2.
We use pytest for unit tests.
- Always assign your hierarchal buddy as your reviewer in addition to the defaults.
- Please also include changes to the ReadMe in your PRs as needed.
- Please name branches using the following schema
<prefix>/<JIRA-ticket-ID>-description
where:- prefix is either
feature
,hotfix
,release
orbugfix
depending on the type of task. - Jira ticket ID is the ticket number for the given feature in JIRA example
TNT-1
.
- prefix is either
Please follow the following guides to PRs:
Nathaniel Moschkin ([email protected])
Abdullah Yusuf ([email protected])