<commit_before># Deployment instructions

Installing the system on Ubuntu.

* Install Java 8
* Install command line utilities
* Install PROV-RIF-SPARQL harvester application
* Install and configure Apache Fuseki
* Schedule updates
* Install Provisualizer user interface
* Analytics

# Check Java is at least version 8

The Fuseki SPARQL store requires Java 8 (also known as 1.8).

Check the version of Java installed:

```bash
java -showversion
```

If the version of Java is not at least 8 (shown as "1.8"), you will need to update it.

As root, add the repository for Oracle Java 8, download the package metadata, install Java 8, and make it the default JVM.

```bash
# add-apt-repository ppa:webupd8team/java
# apt-get update
# apt-get install oracle-java8-installer
# apt-get install oracle-java8-set-default
# apt-get remove default-jre-headless
# apt-get remove openjdk-7
# ln -s /usr/lib/jvm/java-8-oracle /usr/lib/jvm/default-java
```

# Install command-line utilities

The `unzip` utility will be needed to unzip the Fuseki installation package.

The `curl` utility is used to query the SPARQL store and retrieve two CSV files; one containing
descriptions of nodes in the visualization, and the other containing an adjacency matrix (i.e. edges).

To install these utilities, use the following `bash` commands:

```bash
# apt-get update
# apt-get install unzip curl
```

# Install PROV-RIF-SPARQL harvester application

Download `harvester.war` web application archive from https://github.com/Conal-Tuohy/PROV-RIF-SPARQL/releases/download/v4.0/harvester.war
and save it in the `/var/lib/tomcat7/webapps/` folder.

# Install and configure Fuseki 2 SPARQL store

Create a home folder for Fuseki configuration and data storage, and install the Fuseki configuration file.

```bash
# mkdir -p /etc/fuseki/configuration
# chown -R tomcat7:tomcat7 /etc/fuseki
```

Download the configuration file from https://raw.githubusercontent.com/Conal-Tuohy/PROV-RIF-SPARQL/master/prov.ttl and save it in the `/etc/fuseki/configuration` folder.

Download the Fuseki distribution ZIP file from http://apache.mirror.serversaustralia.com.au/jena/binaries/apache-jena-fuseki-2.3.1.zip and unzip it to find the war file.

```bash
unzip apache-jena-fuseki-2.3.1.zip
cp apache-jena-fuseki-2.3.1/fuseki.war /var/lib/tomcat7/webapps/
```

# Complete installation of the web apps<commit_msg>Update deployment.md<commit_after># Deployment instructions

Installing the system on Ubuntu.

* Install Java 8
* Install command line utilities
* Install PROV-RIF-SPARQL harvester application
* Install and configure Apache Fuseki
* Schedule updates
* Install Provisualizer user interface
* Analytics

# Check Java is at least version 8

The Fuseki SPARQL store requires Java 8 (also known as 1.8).

Check the version of Java installed:

```bash
java -showversion
```

If the version of Java is not at least 8 (shown as "1.8"), you will need to update it.

As root, add the repository for Oracle Java 8, download the package metadata, install Java 8, and make it the default JVM.

```bash
# add-apt-repository ppa:webupd8team/java
# apt-get update
# apt-get install oracle-java8-installer
# apt-get install oracle-java8-set-default
# apt-get remove default-jre-headless
# apt-get remove openjdk-7
# ln -s /usr/lib/jvm/java-8-oracle /usr/lib/jvm/default-java
```

# Install command-line utilities

The `unzip` utility will be needed to unzip the Fuseki installation package.

The `curl` utility is used to query the SPARQL store and retrieve two CSV files; one containing
descriptions of nodes in the visualization, and the other containing an adjacency matrix (i.e. edges).

To install these utilities, use the following `bash` commands:

```bash
# apt-get update
# apt-get install unzip curl
```

# Install PROV-RIF-SPARQL harvester application

Download `harvester.war` web application archive from https://github.com/Conal-Tuohy/PROV-RIF-SPARQL/releases/download/v4.1/harvester.war
and save it in the `/var/lib/tomcat7/webapps/` folder.

# Install and configure Fuseki 2 SPARQL store

Create a home folder for Fuseki configuration and data storage, and install the Fuseki configuration file.

```bash
# mkdir -p /etc/fuseki/configuration
# chown -R tomcat7:tomcat7 /etc/fuseki
```

Download the configuration file from https://raw.githubusercontent.com/Conal-Tuohy/PROV-RIF-SPARQL/master/prov.ttl and save it in the `/etc/fuseki/configuration` folder.

Download the Fuseki distribution ZIP file from http://apache.mirror.serversaustralia.com.au/jena/binaries/apache-jena-fuseki-2.3.1.zip and unzip it to find the war file.

```bash
unzip apache-jena-fuseki-2.3.1.zip
cp apache-jena-fuseki-2.3.1/fuseki.war /var/lib/tomcat7/webapps/
```

# Complete installation of the web apps
{'fraction_non_alphanumeric': 0.09198063565565144, 'fraction_numerical': 0.013049884234897917, 'mean_word_length': 4.28587319243604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '598907', 'n_tokens_mistral': 1608, 'n_tokens_neox': 1537, 'n_words': 546}