Code Monkey home page Code Monkey logo

sherlock-epcis's Introduction

Code style: black Version badge

README

This README documents the steps necessary to get your application up and running.

What is this repository for?

Quick summary

sherlock-epcis is the backend server responsible for converting EPCIS GS1 data to FDA CTEs & KDEs for reporting purposes.

Content

FlaskAPI

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.

Database configuration

Sherlock-epcis uses Neo4j 4.1.9

Neo4j service setup

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

Graph algorithms

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:

apoc-4.1.0.9-core.jar

neo4j-graph-data-science-1.6.2.jar

place them in the Neo4j plugins directory (i.e. /var/lib/neo4j/plugins)

Json file import

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 

EPCIS Event Classes

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.

CTE Classes

Contribution guidelines

Writing tests

We use pytest for unit tests.

Code review and PRs

  • 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 or bugfix depending on the type of task.
    • Jira ticket ID is the ticket number for the given feature in JIRA example TNT-1.

Please follow the following guides to PRs:

Other guidelines

Who do I talk to?

Repo owner or admin

Nathaniel Moschkin ([email protected])

Other community or team contact

Abdullah Yusuf ([email protected])

Learn Markdown

sherlock-epcis's People

Contributors

charshou avatar clemessien avatar conniesunn avatar nmoschkin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.