There are two alternative procedures for building VocBench3: with Maven and with Npm. We suggest to follow the one with Maven since it does not require Npm to be installed (it is downloaded as a plugin dependency and run by Maven during the building process), requires less interaction steps and the content of its build is a superset of the one built by using Npm.
Maven installed.
It can be necessary to increase the amount of memory available to Maven through the environment variable MAVEN_OPTS
PowerShell example:
$Env:MAVEN_OPTS="-Xms512M -Xmx2048M -Xss2M -XX:MaxMetaspaceSize=2048M"
Execute the command
mvn clean install
from the root of the project (/vocbench3, where the pom.xml file is located). This command will generate three folders:
/node_modules: contains the dependencies of the application;/dist/vocbench3: contains the static assets of the front-end;/target: contains the generated vocbench3-.war web archive and vocbench3-.jar to use in conjunction with Semantic Turkey
The directory /dist/vocbench3 is the distribution that contains the static assets of the front-end generated by the npm build procedure.
This distribution can be deployed on any http server. Alternatively, the jar file can be deployed on the server embedded with the Semantic Turkey system (inside the /lib directory). Finally the war file can be deployed on any application server.
Required Node.js or later. This project was generated with Angular CLI version 10.2.0 that is compatible with Node.js 10.13.x/12.11.x or later minor version.
Execute the command below:
npm install # or just: npm i
After having installed the dependencies, run npm run buildprod in order to generate a production build the project. The build artifacts will be stored in the dist/ directory.
Semantic Turkey is necessary for VocBench to operate. VB3 is actually a web client for ST.
In order to run VocBench 3, it is possible to:
- deploy the jar file produced through the Maven build procedure inside the
/libdirectory of the distribution of Semantic Turkey. Then run Semantic Turkey and access the portal athttp://localhost:1979/vocbench3 - deploy the
vocbench3directory (produced by any of the two described build procedures) on any HTTP server. Run Semantic Turkey and access VocBench at the address/port determined by the chosen HTTP server. - run VocBench in development mode on an angular development server without building (still ST must be running). After installing the dependencies (as explained above), execute the command
npm serve. Access VocBench at http://localhost:8181/ (executeng serve --port 8282for serving to a different port, 8282 in this example). The app will automatically reload if you change any of the source files.
In vbconfis.js (under src/ of the source package, or under the root folder of the built distribution) it is possible to configure the SemanticTurkey host resolution. By default VocBench3 dynamically resolves the protocol, the IP address and the port number by using the same of its container. In case you have installed VocBench in a different container or in a dedicated server you might have to change the following configuration.
/**
* IP address/logical host name of the machine hosting Semantic Turkey.
* By default (variable left unspecified) the host is resolved dynamically by using the same address of the
* machine hosting VocBench.
* Thus if VocBench3 and Semantic Turkey are running on the same machine this variable can be left commented,
* otherwise uncomment the line and edit the value.
*/
// var st_host = "127.0.0.1";
/**
* Port of the container hosting Semantic Turkey.
* By default (variable left unspecified) the port is resolved dynamically by using the same port of the
* container hosting VocBench.
* Thus if VocBench3 and Semantic Turkey are running on the same container this variable can be left commented,
* otherwise uncomment the line and edit the value.
*/
// var st_port = "1979";
It is also possible to change the path where SemanticTurkey server is listening and the protocol to use
/**
* Path where SemanticTurkey server is listening. If omitted, the sole host is considered.
* Please note that the path of Semantic Turkey services is defined as in:
* http://semanticturkey.uniroma2.it/doc/user/web_api.jsf#services_address_structure
* This additional path information is considered to be the starting part of the path described above,
* and is usually necessary in case Semantic Turkey is installed behind a proxy redirecting the ST URL.
*/
var st_path;
/**
* Protocol - either http or https.
* By default (variable left unspecified) the protocol is resolved dynamically by using the same one of the
* container hosting VocBench.
*/
// var st_protocol = "http";