A simple interface to directly push data into ONgDB and read data via ReST.
- ONgDB
- Docker
- Poetry
- FastAPI
- Py2Neo
- Install python ^ 3.7
- Start
ONgDB
database (Optionally use ongdb.yml in docker folder) poetry install
- Run
run.py
or runscripts\launch.sh
or rundocker-compose -f <docker-compose.yml> up -d
- Add nodes directly or using graph
- endpoints = /api/v1/data/graph ,/api/v1/data, /api/v1/data/relation
{
"graphs": [
{
"start": {
"type": "Framework",
"id_field": "name",
"attributes": {
"name" : "FastAPI"
}
},
"through": {
"type": "RELY_ON"
},
"reach": {
"type": "Framework",
"id_field": "name",
"attributes": {
"name" : "Pydantic"
}
}
},
{
"through": {
"type": "BASED_ON"
},
"reach": {
"type": "Language",
"id_field": "name",
"attributes": {
"name" : "Python",
"tag" : "simple tag"
}
}
}
]
}
- Query data based on graph
- /api/v1/query/
{
"traverse": [
{
"traverse_from": {
"type": "Language",
"alias": "n",
"filter": {
"name": "Python"
},
"where": "n.tag = \"simple tag\""
},
"through": {
"relation": "BASED_ON",
"alias": "b"
},
"reach": {
"type": "Framework",
"alias": "f"
}
},
{
"through": {
"relation": "RELY_ON",
"alias": "r"
},
"reach": {
"type": "Framework",
"alias": "f2"
}
}
],
"return_attributes": [
"f2"
]
}
- Store parameterised native query and then run it later
- /api/v1/query/store
Store
-------
Name: sample
Query: MATCH (language:Language{name : $language}) RETURN language LIMIT 25
Execution
----------
POST /api/v1/query/store?name=sample -d "{"language": "Python"}"