|
1 | 1 | # AddictionKB |
2 | 2 | A knowledge base for AI research in addiction and HIV, based on graph databases. |
3 | 3 |
|
4 | | - |
| 4 | + |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | +- Memgraph Lab (Desktop application) |
| 8 | + - Memgraph is used as the knowledge graph server in AddictionKB. |
| 9 | + - Memgraph offers a variety of [installation options](https://memgraph.com/docs/getting-started/install-memgraph). |
| 10 | + - Memgraph Lab is the easiest way to get up and running with AddictionKB. But you may use Memgraph Server if your deployment requires it. |
| 11 | +- Python (version 3.7 or later) |
| 12 | + |
| 13 | +## Installation |
| 14 | + |
| 15 | +To build a copy of AddictionKB graph database, you can either: |
| 16 | +- Download a copy of the latest CYPHERL file and import it into Memgraph |
| 17 | +- Build the knowledge base from its original third-party sources and import it into Memgraph |
| 18 | + |
| 19 | +### Install from CYPHERL file (easy) |
| 20 | +- Visit the [Releases page](https://github.com/EpistasisLab/AddictionKB/releases) and find the version of AddictionKB you want to install. Unless you have a particular reason to do otherwise, this should probably be the most recent release. Follow the link in the release notes to the corresponding database dump (it will redirect to an external page). |
| 21 | +- Using Memgraph Lab, import the downloaded CYPHERL file by navigating to _Import & Export_ and then click the _Import Data_ button. |
| 22 | + - For other ways to import the CYPHERL file into a Memgraph server, see [here](https://memgraph.com/docs/data-migration/cypherl) |
| 23 | +- In Memgraph Lab, navigate to _Query execution_ to start querying the knowledge graph. |
| 24 | + |
| 25 | +### Build from scratch (less easy) |
| 26 | + |
| 27 | +**For detailed instructions on building AddictionKB from scratch, see the [Alzheimer's Disease Knowledge Base (AlzKB)] (https://github.com/EpistasisLab/AlzKB) [here](https://github.com/EpistasisLab/AlzKB/blob/master/BUILD.org)** |
| 28 | + |
| 29 | +Start by installing the Python package, which includes the necessary scripts: |
| 30 | + |
| 31 | +```{bash} |
| 32 | +$ git clone https://github.com/EpistasisLab/AddictionKB |
| 33 | +$ cd AddictionKB |
| 34 | +$ pip install . |
| 35 | +``` |
| 36 | + |
| 37 | +#### Download the third-party database sources |
| 38 | + |
| 39 | +First, install MySQL and make sure it is running, as some of the source |
| 40 | +databases are only available as MySQL dumps. |
| 41 | + |
| 42 | +We've created a script that will fetch all of the source files and put them into |
| 43 | +the expected directory structure. We will try to keep this script as updated as |
| 44 | +possible, but if you encounter any issues we suggest looking at the script and |
| 45 | +making sure it points to entities that still exist. |
| 46 | + |
| 47 | +```{bash} |
| 48 | +$ addictionkb bootstrap |
| 49 | +``` |
| 50 | + |
| 51 | +#### Populate the ontology |
| 52 | + |
| 53 | +We use the external `ista` library to populate the OWL ontology. This should |
| 54 | +be pretty much entirely automated: |
| 55 | + |
| 56 | +```{bash} |
| 57 | +$ addictionkb build |
| 58 | +``` |
| 59 | + |
| 60 | +#### Load the ontology contents into Memgraph |
| 61 | + |
| 62 | +This script will import the OWL 2 ontology contents into an empty Memgraph database |
| 63 | +and clean up unnecessary artifacts left over by the OWL 2 standard: |
| 64 | + |
| 65 | +```{bash} |
| 66 | +$ addictionkb install |
| 67 | +``` |
| 68 | + |
| 69 | +After this, check the Memgraph database (which will now be turned on) and make sure |
| 70 | +everything looks alright. |
0 commit comments