Skip to content

Webservice User Guide

Alexis Radisson edited this page Jul 13, 2021 · 16 revisions

web service User Guide

Compile and package the web service

Open a console and navigate to the folder where all the modules are: OLGAAsAService/OLGA and you can compile and package the web service from there:

cd /path/to/OLGAAsAService/OLGA
mvn --projects OLGA-Core,OLGA-Ws clean install

Grab a coffee, stretch your legs, this will take some time... Or skip the tests :

cd /path/to/OLGAAsAService/OLGA
mvn --projects OLGA-Core,OLGA-Ws clean install -DskipTests

Run the web service

The above commands generate the OLGA web service.jar in the folder target inside the module OLGA-Ws, to run the web service with its default parameter do as follow:

cd OLGA-Ws/target
java -jar ./OLGA-Ws-0.0.4-with-dependencies.jar

The web service is now running on port 9090, and is reachable at http://localhost:9090/Ontology/OLGAsaas/1.0.0/1.0. If you want to run the service on another port, open your file explorer and create an application.properties file in the target folder of Olga-Ws and enter the text "server.port=${port}" with your desired port as ${port} or you can modify it before building the web service in "/OLGA-Ws/src/main/resources/application.properties", run the web service as follow:

java -jar ./OLGA-Ws-0.0.4-with-dependencies.jar application.properties

The service is now running on port ${port}.

General Description

End points:

OLGA As A Service has three end points:

  1. Post request to generate the object oriented model based on an ontology model and the URL ends with "/1.0/generate".

    Parameters:

     * code -> "java or cs or python".
    
     * name -> String.
    
     * library-> "trinity[cs] or rdf4j[java] or rdfalchemy[python].
    
     * preserve-> Boolean "Optional".
    
     * version-> String follow the version convention "Optional".
    
     * partial-> Boolean "Optional".
    

    Header: Content-Type-> application/zip.

    Body: a zipped folder with your ontology(ies).

    Response: Generated project.

  2. Get request to collect all of the daily log files and the URL ends with "/1.0/admin/collectlogs".

    Response: All of the uncleared log files.

  3. Get request to clear all of the daily log files and the URL ends with "/1.0/admin/clearlogs".