Saṅgrāhaka is presented as a full-stack application that you can install on your own server. Installing it is fairly straightforward if you have the necessary components.
Saṅgrāhaka makes use of cross-platform technologies, and in theory should run on all operating systems. It has been tested and is known to work on Ubuntu 18.04 and Windows.
- Python3: First and foremost, being powered by Flask, Saṅgrāhaka requires Python 3.
- Tested on Python 3.8.
- You may want to use Anaconda.
- Several features of Saṅgrāhaka are made possible through use of numerous Python packages available on the Python Package Index (PyPI).
- Install them using
pip install -r requirements.txt
- Install them using
- Neo4j is a graph database management system (Think MySQL but for graphs!). Saṅgrāhaka uses Neo4j as its graph database to store and query knowledge graphs.
- Check the installation instructions for your platform.
- Note: Annotation process does not require Neo4j. Therefore, if you want to quickly get started with annotation without worrying about knowledge graphs, you can skip installing Neo4j.
- Caution: The interfaces under
Graph
tab will not function if a graph database is not connected.
- Configure the application.
- Copy
settings.sample.py
tosettings.py
- Open
settings.py
in a text editor and make appropriate changes.
- Copy
- Run application server.
- Open a terminal.
- Run
python3 server.py
- Note: If you want to run it on a production environment, it is recommended to use a Web Server Gateway Interface (WSGI) such as Gunicorn
- Access the frontend to start using
- Copy the URL displayed on the terminal and load it in the browser of your choice.
Your Saṅgrāhaka instance is now running!
- Login using the administrator username and password set by you in
settings.py
- Go to
Admin
tab. - Upload Corpus
- Create a corpus entry by providing a name and an optional description.
- Prepare chapter files. (Check examples directory for the format of chapter files.)
- Upload chapter files.
- Create Ontology
- Prepare a list of node types relevant to your corpus.
- Prepare a list of relationships that you want to capture among these node types.
- Upload the ontology in one of the two ways:
- Use GUI to
Add
relations one by one. - Use
CSV
orJSON
files to uploadOntology
in bulk. (Check to data/tables for file format and sample data.)
- Use GUI to
Your Saṅgrāhaka instance is now ready for annotation!
- Ask your annotators to create accounts on your system.
- Go to
Admin
tab to addAnnotator
role to the desired users.
The knowledge graph needs to be constructed using the collected annotations.
The PropertyGraph()
class provided in utils/property_graph.py
can be used for this purpose.
Disclaimer: This step requires a certain level of familiarity with Python, property graph data model and computational aspects.
Note: examples
directory contains sample files for building the knowledge graph.
Query templates should be prepared at data/query.json
. The format of query templates as well as sample
files highlighting the query template preparation are available in examples
.
Disclaimer: Creating query templates requires a certain level of familiarity with Cypher query language and computational aspects.
If you have installed Neo4j and want to use graph related features, you should start a graph database server. It need not be on the same machine as the web server, but it needs to be accessible via network to the machine hosting your web server.
- Start Neo4j graph server
- Open a terminal.
- Navigate to the
Neo4j
installation directory. (cd <your-neo4j-installation-path>
) - Run
./bin/neo4j console