An example project for gremlin_python, as there is very little public code out there using it.
This project also uses Chalice (https://github.com/aws/chalice)
>> mkvirtualenv neptunedemo --python=python3.6
>> pip install chalice
>> pip install gremlinpython
- Clone this repo to your project folder
- Set GRAPH_DB in .chalice/config.json to your graph db
- export AWS_DEFAULT_REGION=us-east-1 if using AWS Neptune
>> chalice deploy
Then send http requests (examples below) to your new endpoint.
If using AWS Neptune:
- Add AWSLambdaVPCAccessExecutionRole to the lambda role
- Set the correct VPC, subnet and SG
POST to https://whatever.execute-api.us-east-1.amazonaws.com/api/person
{"id": "XYZ1234", "prop1": "Some", "prop2": "Value"}
GET to https://whatever.execute-api.us-east-1.amazonaws.com/api/person/XYZ1234
PUT to https://whatever.execute-api.us-east-1.amazonaws.com/api/person/XYZ1234
{"id": "XYZ1234", "prop1": "Some", "prop2": "NewValue"}
POST to https://whatever.execute-api.us-east-1.amazonaws.com/api/relationship
{"from": "XYZ1234", "to": "BOB", "weight": "1.0"}
GET to https://whatever.execute-api.us-east-1.amazonaws.com/api/relationship/XYZ1234
You can optionally add a ?threshold=0.n parameter to the querystring to set the threshold of relationship weighting to retrieve.
DELETE to https://whatever.execute-api.us-east-1.amazonaws.com/api/clear
- Cleanup the retrieval query
- Add more unit tests using TinkerGraph
- Add Cognito for authorisation of requests
- Extend demo instructions to include graph db setup
- Add additional options to the search