Skip to content

Commit

Permalink
Update README.adoc
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese authored Aug 29, 2023
1 parent 5076397 commit c30e860
Showing 1 changed file with 48 additions and 39 deletions.
87 changes: 48 additions & 39 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
:toc:
:toc-title:
:toclevels: 5
:toc-placement!:
:source-highlighter: highlight.js
Expand All @@ -19,65 +20,66 @@ This webservice provides some functionalities to compute explanations for some Q

toc::[]

== Build and Installation
== Build and Run

=== Build process
=== Build

==== Building from scratch using Java
==== *Preparations*

Create the .jar-file like so:
You may change these settings to fit your requirements:

[source,bash]
._applications.properties_
[source,ini]
----
mvn clean install
server.port = 4000
sparqlEndpoint = http://demos.swe.htwk-leipzig.de:40111/sparql
----

==== Building with Docker
==== *from scratch using Java*

You might build a Docker image locally with the existing Dockerfile by using the following command:
* create a executable -jar-file like so:

** `mvn clean install`

[source,bash]
----
docker build . -t qanary-explanation-service:latest
----
==== *by using Docker*

. *_locally:_*

- build a Docker image with the existing Dockerfile by using the following command inside the projects folder
- `docker build . -t qanary-explanation-service`

. *_from Dockerhub:_*

- pull the repository *wseresearch/qanary-explanation-service* with `docker pull wseresearch/qanary-explanation-service:latest`

- you might replace the tag `latest` with your desired release-tag from `https://hub.docker.com/repository/docker/wseresearch/qanary-explanation-service/tags`


=== Running the application

* while using the JAR file:
+
--
** execute it like so `java -jar ./PATH/TO/PACKAGED_JAR.jar`
--
* while using the created Dockerfile:
+
--
** `docker run -p 12345:4000 qanary-explanation-service:latest`
*** the "p"-tag is optional and maps the applications-port (4000) to another one, in this case (and on a local machine), the service would be available at "http://localhost:12345"
--
==== *using Java*

== Usage
* start the built jar-file by executing `java -jar PATH/TO/JAR/qanary-explanation-service.jar`
** the built jar is usually located inside the target-directory (of the projects directory)

=== Settings
==== *using Docker*

Change the following as you need them:
. *_locally built:_*

.*applications.properties*
[source,ini]
----
server.port = 4000
sparqlEndpoint = http://demos.swe.htwk-leipzig.de:40111/sparql
----
* run the built image with `docker run -p 12345:4000 qanary-explanation-service` with parameters:
** *_"p":_* is the optional port mapping if you wish to run the application on a different port on your machine, e.g. in this case the *applications port (default: 4000) is mapped to port 12345*

. *_from Dockerhub:_*

* run the pulled image with `docker run -p 12345:4000 qanary-explanation-service:latest` with:
** your previous selected tag (replace *latest* with *your tag*)
** parameter *_"p":_* the optional port mapping if you wish to run the application on a different port on your machine, e.g. in this case the *applications port (default: 4000) is mapped to port 12345*

=== Functionalities
== Functionalities

Currently, there are several endpoints with different tasks, as of the latest version these are:

--
--

==== `/annotations/{graphURI}`
=== `/annotations/{graphURI}`

--
*Path variables:*
Expand Down Expand Up @@ -109,7 +111,8 @@ WHERE {
----

--
==== `/explanations/{graphURI}/{componentURI}`

=== `/explanations/{graphURI}/{componentURI}`

--
*Path Variables:*
Expand Down Expand Up @@ -228,6 +231,8 @@ explanations:hasExplanationForCreatedData
----
====
--


== Example

. Firstly we start a QA process with the Question "What is the real name of Superman?" and the components
Expand Down Expand Up @@ -329,6 +334,10 @@ explanations:hasExplanationForCreatedData
]
----
====
=== Spring Doc & Swagger UI

== SpringDocs & SwaggerUI
Swagger UI is available at http://localhost:40190/swagger-ui/index.html

API Docs are available at http://localhost:40190/api-docs


0 comments on commit c30e860

Please sign in to comment.