Reasonable Graph is a generic web solution for the management of digital and physical collections. It inherently manages ontologies, specified on a scientific field or based on prototypes (e.g. FRBR-FRAD-FRSAD/FRBR LRM, BIB-FRAME, FRBR-OO, e.t.c.).
It offers the ability for the management of your organization collection directly as a semantic and linked open data set. A perfect fit for Libraries (Academic, Municipal, Public), Archives, Museums or generic content.
Learn more on RG's homepage and in the RG Demonstration Installation.
The rest of this guide makes the assumption that /opt/rg/
is going to be your RG home installation directory.
It is recommended to use this path on your first attempts, but you can of course change it later.
$ cd /opt
$ git clone https://github.com/reasonablegraph/docker-rg.git rg
$ git clone https://github.com/reasonablegraph/docker-solr.git solr
$ git clone https://github.com/reasonablegraph/docker-redis.git redis
$ docker pull ghcr.io/reasonablegraph/archive-app-v27:latest
$ docker pull ghcr.io/reasonablegraph/archive-solr:9.7.0
$ docker pull redis:latest
You need a PostgreSQL database system running.
The recommended mechanism is running in a separate container, while RG expects it with the host name postgresql
available on the local Docker bridge network.
You can also install it locally on your host operating system and run the main RG container in net=host mode, which is what is showcased in this guide.
You can populate the databases as follows:
$ createuser -s rg
$ createdb -U rg -E UNICODE rg
$ createdb -U rg -E UNICODE rg_b
$ psql -U rg rg < /opt/rg/db/schema.sql
$ psql -U rg rg_b < /opt/rg/db/schema_b.sql
You also need a Solr version 9 service for indexing.
The recommended mechanism is running in a separate container, while RG expects it with the host name solr
available on the local Docker bridge network.
You can use the provided docker configuration as a starting point:
$ cd /opt/solr
$ ./setup.sh
You also need a Redis service for caching.
The recommended mechanism is running in a separate container, while RG expects it with the host name redis
available on the local Docker bridge network.
You can use the provided docker configuration as a starting point:
$ cd /opt/redis
$ cp ./redis.env.example ./redis.env
$ ./start.sh
This is the main project container.
Before starting the container, your network setup for the Databases, Solr and the HTTP proxy needs to be reflected in the main configuration file located in /opt/rg/runtime/server.conf.sh
.
As a reminder, the example below assumes that postgresql
is running natively on your local operating system, while redis
, solr
and RG
are running inside containers with the rg
container in net=host
mode:
$ cd /opt/rg/
$ ./setup.sh
$ cp doc/rg.env instance/etc/
$ cd /opt/rg/runtime
$ cp ./server.conf.example.sh ./server.conf.sh
$ cp ./volumes.conf.example.sh ./volumes.conf.sh
$ ./rgc-rg run:mock && ./rgc-rg tools:deps && ./rgc-rg remove
Typically, users want to run each service as a standalone server in a container, while storing data and source code in a local directory. This is a convenient mechanism for developers, and can be used for single-server production hosts too.
$ cd /opt/rg/runtime
$ ./rgc-rg run
You also need the Drupal CMS as the frontend.
You can follow the official instructions to install it on your system.
A helpful Apache Web Server VirtualHost setup is also included below.
Then follow these steps, assuming the Drupal's DocumentRoot is at /opt/drupal/web
:
$ apt install libapache2-mod-xsendfile
# Modules
$ cd /opt/drupal
$ mkdir -p web/modules/custom
$ cd web/modules/custom
$ git clone https://github.com/reasonablegraph/rg_module.git reasonable_graph
# Themes
$ cd /opt/drupal
$ composer require drupal/bootstrap5
$ mkdir -p web/themes/custom
$ cd web/themes/custom
$ git clone https://github.com/reasonablegraph/rg_theme.git rg_theme
# Append the following to /etc/hosts
127.0.0.1 laravel.local
127.0.0.1 rg.local
Enable the Reasonable Graph modules on Drupal, you can visit http://rg.local/admin/modules:
- Enable Reasonable Graph module
- Enable Reasonable Graph Cache module
- Enable Reasonable Graph Login module.
Enable the Reasonable Graph Public theme on Drupal, you can visit http://rg.local/admin/appearance, install Public theme and set it as default.
Visit the Reasonable Graph Settings on Drupal Configuration page (Administration -> Configuration -> Reasonable Graph Settings),
and set the Laravel Host URL to: http://laravel.local:81
, careful not to include any trailing slash (/
) character.
<VirtualHost *:80>
ServerName rg.local
ServerAdmin webmaster@localhost
AddDefaultCharset UTF-8
DocumentRoot /opt/drupal/web
<Directory /opt/drupal/web>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
XSendFile On
XSendFilePath /opt/rg/instance/tmp
XSendFilePath /opt/rg/instance/assetstore
XSendFilePath /opt/rg/instance/media
</Directory>
Alias /assets/ /opt/rg/runtime/data/www/assets/
Alias /_assets/ /opt/rg/runtime/data/www/assets/
<Directory /opt/rg/runtime/data/www/assets/>
Options -MultiViews
AllowOverride None
Require all granted
RewriteEngine on
RewriteBase /
</Directory>
Alias /prepo/spool/ /opt/rg/instance/spool/
<Directory /opt/rg/instance/spool/>
Options -MultiViews
AllowOverride None
Require all granted
RewriteEngine on
RewriteBase /
</Directory>
Alias /media/ /opt/rg/instance/media/
<Directory /opt/rg/instance/media/>
Options -MultiViews
AllowOverride None
Require all granted
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule $ /_assets/img/message-24-error.png [L]
</Directory>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
When all above services are up and properly configured, you can point your browser to http://rg.local. The Reasonable Graph user interface includes the following endpoints:
This repository is available on github.com/reasonablegraph/docker-rg.
Reasonable Graph is provided freely as open source software under the GNU General Public License, Version 3.0.
Copyright © ReasonableGraph.org