Skip to content

Commit ffbd322

Browse files
authored
Merge pull request #2028 from OpenEnergyPlatform/feature-2001-ontop-docker-service
Add ontop to docker services
2 parents 2a3eaba + 81ce6da commit ffbd322

File tree

9 files changed

+85
-15
lines changed

9 files changed

+85
-15
lines changed

docker/Dockerfile.ontop

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Use the official Ontop image as the base
2+
FROM ontop/ontop:latest
3+
4+
# Copy the PostgreSQL JDBC driver into Ontop's lib directory
5+
COPY serviceConfigs/ontop/postgresql.jar /opt/ontop/lib/postgresql.jar
6+
7+
# Ensure it's world-readable (optional but safe)
8+
# RUN chmod 644 /opt/ontop/lib/postgresql.jar

docker/docker-compose.dev.yaml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,21 @@ services:
110110
depends_on:
111111
- web
112112

113-
# ontop:
114-
# image: ontop/ontop-endpoint:latest
115-
# container_name: ontop
116-
# ports:
117-
# - "8080:8080"
118-
# environment:
119-
# ONTOP_MAPPING_FILE: "/opt/ontop/mapping.obda"
120-
# ONTOP_OWL_FILE: "/opt/ontop/ontology.owl"
121-
# ONTOP_PROPERTIES_FILE: "/opt/ontop/ontop.properties"
122-
# volumes:
123-
# - ./ontop:/opt/ontop # Mount your .obda, .owl, and .properties files here
124-
# depends_on:
125-
# - postgres
113+
ontop:
114+
build:
115+
context: .
116+
dockerfile: Dockerfile.ontop
117+
container_name: ontop
118+
ports:
119+
- "8080:8080"
120+
environment:
121+
ONTOP_MAPPING_FILE: "/opt/ontop-config/mapping.obda"
122+
ONTOP_OWL_FILE: "/opt/ontop-config/ontology.owl"
123+
ONTOP_PROPERTIES_FILE: "/opt/ontop-config/ontop.properties"
124+
volumes:
125+
- ./serviceConfigs/ontop:/opt/ontop-config
126+
depends_on:
127+
- postgres
126128

127129
lookup:
128130
restart: unless-stopped
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Complete ontop setup
2+
3+
Download the database JDBC driver for ontop:
4+
5+
- <https://jdbc.postgresql.org/>
6+
7+
Add the file postgresql.jar to this directory.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[PrefixDeclaration]
2+
: http://example.org/voc#
3+
owl: http://www.w3.org/2002/07/owl#
4+
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
5+
xml: http://www.w3.org/XML/1998/namespace
6+
xsd: http://www.w3.org/2001/XMLSchema#
7+
foaf: http://xmlns.com/foaf/0.1/
8+
obda: https://w3id.org/obda/vocabulary#
9+
rdfs: http://www.w3.org/2000/01/rdf-schema#
10+
oeo: https://openenergyplatform.org/ontology/oeo/
11+
oekg: http://openenergy-platform.org/ontology/oeo/oekg/
12+
llc: https://www.omg.org/spec/LCC/Countries/ISO3166-1-CountryCodes/
13+
14+
[MappingDeclaration] @collection [[
15+
16+
17+
18+
]]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@prefix : <http://example.org/ontology#> .
2+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
3+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
4+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
6+
7+
<http://example.org/ontology> a owl:Ontology .
8+
9+
:Person a owl:Class .
10+
:hasName a owl:DatatypeProperty ;
11+
rdfs:domain :Person ;
12+
rdfs:range xsd:string .
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
jdbc.url=jdbc:postgresql://postgres:5432/oedb
2+
jdbc.user=postgres
3+
jdbc.password=postgres
4+
jdbc.driver=org.postgresql.Driver

docs/installation/guides/installation-docker-dev.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ You can set these environment variablesto override defaults:
3535
- `OEP_DEV_PORT_FUSEKI`: public port to fuseki server, defaults to 3030
3636
- `OEP_DEV_PORT_VITE`: public vite JavaScript server port, defaults to 5173
3737

38+
#### Setup ontop service
39+
40+
The ontop service requires a special database driver which must be [downloaded manually first](./setuo-ontop.md).
41+
3842
#### Docker compose command
3943

4044
!!! Info

docs/installation/guides/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Below we describe the manual installation of the oeplatform code and infrastruct
66
We also support [docker](https://www.docker.com/) users by providing basic oeplatform-webapp and database images . This brings an easy setup which provides an installed and ready to use locally oeplatform and additional databases.
77
To support developers with getting started with the initial setup which provides a pre configured complete oeplatform software infrastructure with a docker compose setup that installs all components of the infrastructure using containers run locally in a shared virtual network. By adding convince functionality to the setup we enhance the developer experience to support the development.
88

9-
We provide 2 [docker container images](https://docs.docker.com/get-started/#what-is-a-container-image) (OEP-website and OEP-database). The images are updated & published with each release. They can be pulled from [GitHub packages](https://github.com/OpenEnergyPlatform/oeplatform/pkgs/container/oeplatform).
9+
[Find the installation instructions that get you started with development here](./installation-docker-dev.md)
1010

11-
[Here you can find instructions on how to install the docker images.](https://github.com/OpenEnergyPlatform/oeplatform/tree/develop/docker)
11+
[Find the (old) instructions related to our docker image mainly used for testing as part of the CI](../../../docker/README.md)
1212

1313
!!! danger
1414
Currently the docker based installation does not cover the installation of the additional database `jenna-fuseki` a triple store that stores graph data used in some of our features.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Setup ontop service
2+
3+
The ontop service is mainly use as enabling technology for the quantitative scenario comparison as it enables SPARQL queries on SQL databases using semantic mappings ontop on the "normal" sql like table definition.
4+
5+
## Installation
6+
7+
We offer the pre-configured ontop service as part of the OEP-docker setup for development. It comes with a empty semantic mapping template which can be extended based on the user needs. You still need to download the JDBC database driver to enable connection to the postgresql database OEDB.
8+
9+
Once you downloaded the driver make sure it is available in the ontop config directory and only then build the ontop service using docker.
10+
11+
Download the database JDBC driver for ontop:
12+
13+
- <https://jdbc.postgresql.org/>
14+
15+
Add the file postgresql.jar to this directory.

0 commit comments

Comments
 (0)