Name: connected-data-amanita
Owner: BBC
Description: API for Content Graph
Created: 2018-02-07 16:23:54.0
Updated: 2018-05-15 13:37:22.0
Pushed: 2018-05-15 13:37:20.0
Homepage: null
Size: 292
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
API for reading from the Content Graph/Store. Currently, the API is capable of interfacing with two databases:
Stardog
(may be generalised to any SPARQL1.1
store), and Elasticsearch
. Client specific code resides in the
clients
directory and the clients are listed in api.py
, all other code is/should be client-agnostic.
on3 -m venv env
v/bin/activate
install -r requirements.txt
rt DB_CLIENT='stardog'
rt DB_ENDPOINT=http://$SERVER:$PORT/content-graph-test/query
rt DB_USER=$USERNAME
rt DB_PASS=$PASSWORD
rt DB_CLIENT='elasticsearch'
rt DB_ENDPOINT=http://localhost:9200
rt DB_USER=$USERNAME
rt DB_PASS=$PASSWORD
Resources to run Elasticseaerch stack locally.
=5001 \
ONPATH=.:$PYTHONPATH \
on -m app.api
Check if your code is PEP8 compliant:
destyle app --max-line-length=119
Run tests using:
ONPATH=.:$PYTHONPATH py.test --cov-report term-missing --cov=app tests/ --cov-branch -vv
NB: SPARQL client not fully covered - still need to refactor tests.
This app is provided as with a Dockerfile which is used to build a container. This should then be pushed to a container registry and deployed either as a manual process or using something such as build triggers and a continuous delivery platform like Spinnaker.