diff --git a/README.md b/README.md index 69c635d..f28f95d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Distributed Graph Database +# not4oundGraph -Distributed Graph Database Management System written on `Python` as the project in Advanced Databases course at Innopolis University. +Simple Distributed Graph Database Management System written on `Python` as the project in Advanced Databases course at Innopolis University. ## Getting Started @@ -78,11 +78,12 @@ Tests affect various layers of the Graph Database: To deploy ***Graph Database*** simply use ``` -graphDB [conf_path] +n4Graph [conf_path] ``` where `conf_path` stands for the path to configuration file that describes peers of distributed file system including managers and workers (slaves). -Configuration file has the following JSON format: +### Distributed File System +DFS configuration file has the following JSON format: ``` { @@ -114,15 +115,20 @@ Configuration file has the following JSON format: Without specifying any arguments, the default [configuration file](configs/config.json) with `replica_factor = 2` is used. +***not4oundGraph*** supports two DFS modes: +* **Replication** of data across multiple workers, each worker contains the same portion of data (example configuration file: [config.json](configs/config.json)) +* **Distribution** of data across multiple workers using Round-Robin algorithm (example configuration file: [config.json](configs/config_distributed.json)) + ### Graph Engine API -We provide an [API](src/graph_db/engine/api.py) for managing graph database system directly from Python code. +We provide an [API](src/graph_db/engine/api.py) for managing graph database system directly from Python code. Supported graph operations are listed in [specifications](SPECIFICATIONS.md). ### Data Access API (Query Language) -We provide own simple graph query language (*SGQL*) for executing queries and a [wrapper](src/graph_db/access/db.py) around it. +We provide own simple graph query language ***not4oundQL*** for executing queries and a [wrapper](src/graph_db/access/db.py) around it. +Language specification can found in ***not4oundGraph*** [specifications](SPECIFICATIONS.md). -Executable file `graphDB` runs [console](src/graph_db/console/console.py) mode and accepts *SGQL* queries: +Executable file `n4Graph` runs [console](src/graph_db/console/console.py) mode and accepts *not4oundQL* queries: ``` -Welcome to Graph DB. (c) Ilya Borovik, Artur Khayaliev, Boris Makaev +Welcome to not4oundGraph DB. (c) Ilya Borovik, Artur Khayaliev, Boris Makaev You can enter `/help` to see query examples. @@ -139,6 +145,8 @@ create relationship: label from label1 to label2 key:value create relationship: label from id:0 to id:1 key:value ... ``` + +**Note:** *not4oundGraph* DB does not support `delete graph` queries. If you want to delete graph, please, delete the `db_path` directory with data that you have specified in configuration file. ## Built With * Python 3.6 diff --git a/SPECIFICATIONS.md b/SPECIFICATIONS.md index 0b1f70f..9f60df7 100644 --- a/SPECIFICATIONS.md +++ b/SPECIFICATIONS.md @@ -6,7 +6,7 @@ | `in_use` | `label_id` | `first_rel_id` | `first_prop_id` | |:------:|:---------:|:----------:|:----------:| -| 1 byte | 4 bytes | 4 bytes | 4 byte | +| 1 byte | 4 bytes | 4 bytes | 4 bytes | * `Relationship` - 33 bytes @@ -28,7 +28,7 @@ * `Dynamic Data` - 32 bytes -| `number of bytes taken by data` | `data` | `pointer to id of next_chunk` | +| `real data length` | `data` | `next_chunk_id` | |:------:|:------:|:-----------:| | 1 byte | 27 bytes | 4 bytes | @@ -36,4 +36,39 @@ * `Int` - 4 bytes * `Bool` - 1 byte -* `Str` - depends on the length \ No newline at end of file +* `Str` - depends on the length + +## Graph Engine API + +Following graph operations are supported: + +* Creation of graph +* Creation of nodes, relationships with label and properties +* Match (selection) of nodes, relationships, labels and all graph objects together +* Deletion of nodes and relationships +* Addition of new properties to nodes adn relationships + +## Query Language + +Graph Database *not4oundQL* supports the following queries: + +``` +create graph: label +create node: label +create node: label key:value +create node: label key:value key:value key:value +create relationship: label from label1 to label2 +create relationship: label from label1 to label2 key:value +create relationship: label from id:0 to id:1 key:value +match node: label +match node: id:0 +match relationship: label +match relationship: id:1 +match node: key=value +match node: key=value +match graph: label +delete node: id:0 +delete relationship: id:0 +``` + diff --git a/setup.py b/setup.py index 9b5e60b..6ad2516 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ package_dir={'graph_db': 'src/graph_db'}, entry_points={ 'console_scripts': - ['graphDB = graph_db.console.console:run'] + ['n4Graph = graph_db.console.console:run'] }, test_suite='src.tests', install_requires=['rpyc'], diff --git a/src/graph_db/console/console.py b/src/graph_db/console/console.py index ec69fac..c9e5549 100644 --- a/src/graph_db/console/console.py +++ b/src/graph_db/console/console.py @@ -8,7 +8,7 @@ from graph_db.engine.types import DFS_CONFIG_PATH GREETING = """ -Welcome to Graph DB. (c) Ilya Borovik, Artur Khayaliev, Boris Makaev +Welcome to not4oundGraph DB. (c) Ilya Borovik, Artur Khayaliev, Boris Makaev Use `help` to see query examples. Use `exit` to close database connection. """