These settings will configure your system to use AllegroGraph RDF store as its backend.
Your OntoPortal Virtual Appliance can use either 4store or (new with version 3.0) AllegroGraph as its RDF backend store. The 4store is the default RDF store for the system, as we have much more experience with it to date.
The configuration can be changed at any time by shutting down BioPortal, resetting the backend store configuration attribute, and restarting BioPortal. However, the Annotator and search index data will not change when you switch the backend, so it isn’t really feasible to go back and forth — you’ll want to pick your backend system at the beginning, or be prepared to re-index your databases with each switch.
We included a version of AllegroGraph with your Virtual Appliance (VA) that is tested to work with this version of the Appliance. The included AllegroGraph is not necessarily the most recent version of the AllegroGraph software.
If you want to upgrade your AllegroGraph software to the most recent version, you can obtain that from the Franz, Inc. website. However, we can not guarantee the compatibility of the Appliance with the latest AllegroGraph version.
The AllegroGraph was shipped in the distribution pre-configured to support the settings described here. Follow the steps below to convert your system from 4store to AllegroGraph backend store.
[centos@localhost ~]$ sudo systemctl enable agraph
agraph.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig agraph on
[centos@localhost ~]$ sudo /sbin/service agraph start
Starting agraph (via systemctl): [ OK ]
The local version of AllegroGraph bundled with the Virtual Appliance (VA) sits behind a firewall, and thus, cannot be accessed from an outside system (such as your Host operating system). To get around that restriction, we can create an SSH tunnel that allows this access. Open your favorite terminal app in your host OS and run the following command:
ssh -N -L localhost:10035:localhost:10035 centos@<IP address of your VA>
For example:
Next, on your host OS, open a browser and navigate to:
http://localhost:10035
You should see a page requiring AllegroGraph Username and Password. Ignore the login prompt for the moment. All we needed at this point is to ensure that the AllegroGraph server is up and running.
ontoportal
User[centos@localhost ~]$ sudo su - ontoportal
[ontoportal@localhost ~]$
[ontoportal@localhost bootstrap]$ cd /srv/ontoportal/virtual_appliance/appliance_config/
[ontoportal@localhost appliance_config]$ ls -l
total 8
drwxr-xr-x. 5 ontoportal ontoportal 45 Aug 3 23:24 bioportal_web_ui
drwxr-xr-x. 3 ontoportal ontoportal 20 Aug 3 23:24 ncbo_cron
drwxr-xr-x. 3 ontoportal ontoportal 20 Aug 3 23:24 ontologies_api
drwxrwxr-x 7 ontoportal ontoportal 228 Oct 22 16:36 ontologies_linked_data
-rw-r--r--. 1 ontoportal ontoportal 1712 Oct 14 13:07 site_config.rb
-rw-r--r--. 1 ontoportal ontoportal 1716 Aug 3 23:24 site_config.rb.default
You will need to update the configuration files in the following directories: ncbo_cron
, ontologies_api
per the instructions below.
Navigate to NCBO Cron config directory and open config.rb
in your favorite Linux editor:
[ontoportal@localhost config]$ cd /srv/ontoportal/virtual_appliance/appliance_config/ncbo_cron/config/
[ontoportal@localhost config]$ nano config.rb
Find the following line:
GOO_BACKEND_NAME = '4store'
and replace it with:
GOO_BACKEND_NAME = 'AG'
The values are case-sensitive. Make sure you use the uppercase ‘AG’ as the value. Save the file and exit.
Navigate to Ontologies API config directory and open appliance.rb
in your favorite Linux editor:
[ontoportal@localhost config]$ cd /srv/ontoportal/virtual_appliance/appliance_config/ontologies_api/config/environments
[ontoportal@localhost config]$ nano appliance.rb
Find the following line:
GOO_BACKEND_NAME = '4store'
and replace it with:
GOO_BACKEND_NAME = 'AG'
The values are case-sensitive. Make sure you use the uppercase ‘AG’ as the value. Save the file and exit.
The bootstrapping script creates the initial triple records and lookup data which is required for Ontoportal to operate properly. It also deploys the updated configuration files to the server.
[ontoportal@localhost ~]$ cd /srv/ontoportal/virtual_appliance/utils/bootstrap/
[ontoportal@localhost bootstrap]$ sh bootstrap_AG.sh
Starting agraph (via systemctl): [ OK ]
uri: http://localhost:10035/repositories/ontoportal
relativeUri: repositories/ontoportal
id: ontoportal
title: ontoportal
readable: true
writable: true
replication: no
distributed: false
...
Note that this script may take a few minutes to execute. Please wait unit it finishes.
[ontoportal@localhost deployment]$ sudo oprestart
Open your browser on the host machine and once again navigate to:
http://localhost:10035
This time, you should see the following page instead of the login prompt:
Click on the ontoportal
repository link. You should see some records in the repository: Repository ontoportal — 890 statements
.
firstboot
File and Reboot the Appliance <= IMPORTANT!!!This is a very important step, which is required in order to re-initialize the system for AllegroGraph backend.
[ontoportal@localhost deployment]$ touch /srv/ontoportal/firstboot
[ontoportal@localhost deployment]$ exit
logout
[centos@localhost deployment]$ sudo reboot
Your Virtual Appliance is now pointing to AllegroGraph as the backend. Next, check the web UI and the REST services to make sure they are up and running.
You can now stop and disable the defunct 4store service:
[centos@localhost ~]$ sudo systemctl stop 4s-httpd
[centos@localhost ~]$ sudo systemctl disable 4s-httpd
Removed symlink /etc/systemd/system/multi-user.target.wants/4s-httpd.service.
From your host operating system’s browser (not in the virtual environment), the Appliance Web UI can be accessed at http://{ip_address_of_appliance}
.
If the AllegroGraph switch completed successfully, clicking on the Ontologies
link at the top should bring up this page with a single ontology, Semantic Types Ontology (STY):
REST services are available at the following location:
http://{ip_address_of_appliance}:8080
Run the command below as the centos
user. Replace the link below with the correct link to the RPM file.
[centos@localhost ~]$ sudo curl -O https://franz.com/ftp/pri/acl/ag/ag<version>/linuxamd64.64/agraph-<version>.x86_64.rpm
[centos@localhost ~]$ sudo /sbin/service agraph stop
Stopping agraph (via systemctl): [ OK ]
[centos@localhost ~]$ sudo rpm -U agraph-<version>.x86_64.rpm
If you are downgrading from a newer verson, run the command below instead:
[centos@localhost ~]$ sudo rpm -U --oldpackage agraph-<version>.x86_64.rpm
[centos@localhost ~]$ sudo systemctl daemon-reload
[centos@localhost ~]$ sudo /sbin/service agraph start
Starting agraph (via systemctl): [ OK ]
If you would like to install your own version of AllegroGraph, ignoring the one bundled with the appliance, follow the steps below. You will need to point the configuration files from the step Update OntoPortal configuration files to your own server in addition to switching GOO_BACKEND_NAME
to AG
.
LinkedData.config do |config|
config.goo_host = 'localhost'
Set config.goo_host
to the IP address of your AllegroGraph server.
If not already present in a current version, install the AllegroGraph (AG) server using the instructions on this page:
https://franz.com/agraph/support/documentation/current/server-installation.html
We recommend reviewing these instructions, which cover a number of different installation scenarios.
An example from this page of commands to start and stop AllegroGraph:
Note that the last few lines of the script show how to start and stop AllegroGraph on your server. These lines will be similar to this example:
You can start AllegroGraph by running:
sudo /sbin/service agraph start
You can stop AllegroGraph by running:
sudo /sbin/service agraph stop
You need to run these commands as centos
user, NOT ontoportal
user!
Once AllegroGraph is running, navigate to the AG Admin console. By default it runs on port 10035:
http://<your server name>:10035/#
Under Create new repository
type in a name for your new repository to be used for OntoPortal and click Create
. For Example: ontoportal
Once created, you should be able to navigate to your new repository via:
http://<your server name>:10035/#/repositories/ontoportal
From this view, you can run SPARQL queries against your data, add or delete records, export the repository in a number of formats, and run reports on the use of your data store.