Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4cbea3c
Merge branch 'hotfix/init-script'
atsysin Aug 18, 2022
333da03
added .idea folder
NikitaSerditov Dec 7, 2023
fc01d06
added graph path settings to default config
NikitaSerditov Dec 7, 2023
00c2307
added graph path settings to settings.py
NikitaSerditov Dec 7, 2023
2adb50f
added graph filesystem manager class
NikitaSerditov Dec 7, 2023
6e84140
added minor type annotation
NikitaSerditov Dec 7, 2023
9509b75
added all 4 methods for graphs
NikitaSerditov Dec 7, 2023
045484f
added minor type annotation
NikitaSerditov Dec 7, 2023
bcddc78
added one url pattern for graph
NikitaSerditov Dec 7, 2023
c67efde
updated init of the views
NikitaSerditov Dec 7, 2023
28d8005
removed neo4j support and usage
NikitaSerditov Dec 7, 2023
ace7079
made a proper url
NikitaSerditov Dec 7, 2023
97c71af
cleaned up
NikitaSerditov Dec 7, 2023
2ca775a
minor documentation and type hinting added
NikitaSerditov Dec 8, 2023
29a93d6
added id_name_map folder
NikitaSerditov Dec 8, 2023
b09c885
major commenting and changes structure of the id_map and json graph f…
NikitaSerditov Dec 8, 2023
0779921
added save to file function
NikitaSerditov Dec 8, 2023
784cae7
updated filesystem manager files accroding new endpoint map
NikitaSerditov Dec 11, 2023
4ab9048
fixed all endpoints and urls.py
NikitaSerditov Dec 11, 2023
18c8f49
removed unnecesary tests
NikitaSerditov Dec 13, 2023
f0a7425
testsa re passing
NikitaSerditov Jan 22, 2024
7498dbd
fixed all errors with saving files and ids to map file
NikitaSerditov Jan 22, 2024
090d14b
updated versions and maintainer
NikitaSerditov Jan 22, 2024
3575ef9
cleaned up & updated README.md
NikitaSerditov Jan 22, 2024
ba95c07
fixed typo
NikitaSerditov Jan 22, 2024
90173ae
updated user-guide
NikitaSerditov Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# Ignore the default SQLite database.
*.sqlite3
Expand Down Expand Up @@ -196,3 +196,6 @@ default_root_uid.txt
make_build/
venv.tar.gz
*.tar.gz

# id_map folder
id_name_map/
80 changes: 5 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
# Supergraph plugin

[Complex rest](https://github.com/ISGNeuroTeam/complex_rest/tree/develop) plugin for graph management.

For an introduction check out the [User guide](docs/user-guide.md).

## Installation

These instructions will get you a copy of the plugin up and running on your local machine for development and testing purposes. See [deployment](#deployment) for notes on how to deploy the plugin on a live system.
[Complex rest](https://github.com/ISGNeuroTeam/complex_rest/tree/develop) plugin for graph management. For an introduction check out the [User guide](docs/user-guide.md).

### Prerequisites

1. Deploy [complex rest](https://github.com/ISGNeuroTeam/complex_rest).
2. Install [Neo4j](https://neo4j.com/docs/operations-manual/current/installation/) graph database.
1. Follow installation instructions for your OS [ [Linux](https://neo4j.com/docs/operations-manual/current/installation/linux/) | [Windows](https://neo4j.com/docs/operations-manual/current/installation/windows/) | [Mac](https://neo4j.com/docs/operations-manual/current/installation/osx/) ]. Pay attention to the [required Java version](https://neo4j.com/docs/operations-manual/current/installation/requirements/#deployment-requirements-java); you may need to change system defaults.
2. [Set initial password](https://neo4j.com/docs/operations-manual/current/configuration/set-initial-password/) to `password` with the following command:
```sh
neo4j-admin set-initial-password password
```
> This must be performed before starting up the database for the first time.
3. Run the service, make sure it is available on port `7687`:
```sh
systemctl start neo4j
```
4. (optional) If you installed *Cypher shell*, you can try to connect to Neo4j to make sure everything is ok:
```sh
cypher-shell -a neo4j://localhost:7687 -u neo4j -p password
```

### Deploy from GitHub or Nexus

You can get the latest build from either [GitHub releases](https://github.com/ISGNeuroTeam/complex_rest_dtcd_supergraph/releases) page or Nexus - the archives are identical.

1. Download an archive with the latest build.
2. Unpack the archive into `complex_rest/plugins` directory.
3. Run the [initialization script](#initialization-script) to prepare the database.

### Deploy via Make

If you want to have an access to feature branch version, you can build this plugin locally.
If you want to have access to feature branch version, you can build this plugin locally.

1. Clone the Git repository:
```sh
Expand All @@ -49,7 +27,6 @@ If you want to have an access to feature branch version, you can build this plug
make pack
```
3. Unpack the archive into `complex_rest/plugins` directory.
4. Run the [initialization script](#initialization-script) to prepare the database.

### Deploy manually

Expand Down Expand Up @@ -78,66 +55,18 @@ If you are a developer, then follow this section.
cd complex_rest/plugins
ln -s pathtofolder/repo/complex_rest_dtcd_supergraph
```
6. [Re-install constraints and indexes](#re-installing-constraints-and-indexes), [initialize the default `Root` node](#initializing-the-default-root).

## Deployment

For deployment we need to get a build archive - see the previous section on how to do that. Then:
For deployment, we need to get a build archive - see the previous section on how to do that. Then:

1. Stop `complex_rest`.
2. Unpack the archive into `complex_rest/plugins` directory.
3. Run the [initialization script](#initialization-script) to prepare the database.
4. **TODO** Backup / reset / migrate the database.
5. Start `complex_rest`.

## Notes

### Re-installing constraints and indexes

Neo4j provides support for applying [indexes](https://neo4j.com/docs/getting-started/current/graphdb-concepts/#graphdb-indexes) and [constraints](https://neo4j.com/docs/getting-started/current/graphdb-concepts/#graphdb-constraints).

To do this, activate plugin's virtual environment and run:

```sh
address="bolt://neo4j:password@localhost:7687"
neomodel_remove_labels --db $address
neomodel_install_labels models --db $address
```

For password and port use values from `supergraph.conf`.

### Initializing the default Root

We need to create the default root node in order to keep backwards compatibility with the API v0.2.0. There is a script just for that!

Activate plugin's virtual environment, navigate to script's parent directory and run:

```sh
python create_default_root.py
```

It will create a single `Root` node and save its `uid` attribute in the file `default_root_uid.txt` inside source code directory.

### Initialization script

There is a helper script `database_init.sh` that prepares the plugin for work when deploying *from build archive*. It combines activation of correct virtual environment, [re-installation of constraints and indexes](#re-installing-constraints-and-indexes) with [default Root creation](#initializing-the-default-root) in one place.

You can run it from anywhere you like:

```sh
./database_init.sh
```
3. Start `complex_rest`.

## TODO

- Update [User guide](docs/user-guide.md).
- Resolve `RelationshipClassRedefined` error when trying to test `neomodel` models directly (see `test_managers.py`).
- User-defined properties that were saved before *stay on the node after merge* even if they are missing in new structure and should be deleted (see how `create_or_update` works). We handle it in converter, but this is not nice.
- Some database queries are inefficient (`n+1` problems).

## Built With

- [Neo4j](https://neo4j.com/) - Graph data platform.

## Versioning

Expand All @@ -146,6 +75,7 @@ We use [SemVer](http://semver.org/) for versioning. For the versions available,
## Authors

- Aleksei Tsysin (atsysin@isgneuro.com)
- Nikita Serditov (nserditov@isgneuro.com)

## License

Expand Down
149 changes: 0 additions & 149 deletions complex_rest_dtcd_supergraph/converters.py

This file was deleted.

55 changes: 0 additions & 55 deletions complex_rest_dtcd_supergraph/create_default_root.py

This file was deleted.

19 changes: 0 additions & 19 deletions complex_rest_dtcd_supergraph/exceptions.py

This file was deleted.

Loading