https://github.com/manugraj/xgrapher
CRU(xD) into ONgDB without any worries
https://github.com/manugraj/xgrapher
fastapi graph-database neo4j ongdb poetry rest-api
Last synced: about 2 months ago
JSON representation
CRU(xD) into ONgDB without any worries
- Host: GitHub
- URL: https://github.com/manugraj/xgrapher
- Owner: manugraj
- License: mit
- Created: 2021-06-24T15:06:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-31T15:33:09.000Z (about 2 years ago)
- Last Synced: 2025-03-28T03:41:27.636Z (2 months ago)
- Topics: fastapi, graph-database, neo4j, ongdb, poetry, rest-api
- Language: Python
- Homepage:
- Size: 60.5 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XGrapher
## What is XGrapher?
A simple interface to directly push data into ONgDB and read data via ReST.
## Stack
- ONgDB
- Docker
- Poetry
- FastAPI
- Py2Neo## Deployment
- Install python ^ 3.7
- Start `ONgDB` database (Optionally use ongdb.yml in docker folder)
- `poetry install`
- Run `run.py` or run `scripts\launch.sh` or run `docker-compose -f up -d`## Capability
- 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 25Execution
----------
POST /api/v1/query/store?name=sample -d "{"language": "Python"}"```