-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker Compose template for SPARQL endpoint and RDF browser. (#97)
* Add Docker Compose template for SPARQL endpoint and RDF browser. Resolve #96. * Update docker/README.md Co-authored-by: Ted Thibodeau Jr <[email protected]> * Improve formatting of docker/rdf/example.ttl Co-authored-by: Ted Thibodeau Jr <[email protected]> * Update docker/README.md Co-authored-by: Ted Thibodeau Jr <[email protected]> * Use LodView instead of RickView. Co-authored-by: Ted Thibodeau Jr <[email protected]>
- Loading branch information
1 parent
d79c6db
commit 9b04031
Showing
5 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DBA_PASSWORD=changeme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Simple template for a Docker Compose setup based on [Virtuoso](https://github.com/openlink/virtuoso-opensource/), providing an RDF store, SPARQL Endpoint, and RDF browser (among other available features) for a quick knowledge base deployment. | ||
|
||
# Localize | ||
|
||
1. Replace `rdf/example.ttl` with your knowledge base | ||
2. Add your namespaces to `initdb.d/setup.sql` | ||
3. Adapt `docker-compose.yml` | ||
4. Copy `.env.dist` to `.env` and change `DBA_PASSWORD` | ||
|
||
# Start to use | ||
|
||
1. Run `docker compose up --build` | ||
2. Test the SPARQL endpoint at [`http://localhost:8890/sparql`](http://localhost:8890/sparql) | ||
2. Test the RDF browser at [`http://localhost:8080/ExInstance`](http://localhost:8080/ExInstance) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
services: | ||
|
||
virtuoso: | ||
image: openlink/virtuoso-opensource-7 | ||
environment: | ||
- DBA_PASSWORD=${DBA_PASSWORD} | ||
- VIRT_DATABASE_ERRORLOGLEVEL=3 | ||
- VIRT_SPARQL_DEFAULTGRAPH=http://example.org | ||
- VIRT_SPARQL_DEFAULTQUERY=select distinct * {?s ?p ?o.} LIMIT 100 | ||
- VIRT_PARAMETERS_DIRSALLOWED=., /usr/local/virtuoso-opensource/share/virtuoso/vad, /rdf | ||
- VIRT_PLUGINS_-=- | ||
volumes: | ||
- ./rdf:/rdf:ro | ||
- ./initdb.d:/opt/virtuoso-opensource/initdb.d:ro | ||
ports: | ||
- "127.0.0.1:8890:8890" | ||
restart: unless-stopped | ||
|
||
lodview: | ||
image: ghcr.io/konradhoeffner/lodview:22.05 | ||
environment: | ||
- LodViewendpoint=http://virtuoso:8890/sparql | ||
- LodViewIRInamespace=http://example.org/ | ||
- LodViewhomeUrl=/ExInstance | ||
ports: | ||
- "127.0.0.1:8080:8080" | ||
depends_on: | ||
- virtuoso | ||
restart: unless-stopped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
log_message('Setup: Activate CORS'); | ||
update DB.DBA.HTTP_PATH set HP_OPTIONS = serialize(vector('browse_sheet', '', 'noinherit', 'yes', 'cors', '*', 'cors_restricted', 0)) where HP_LPATH = '/sparql'; | ||
log_message('Setup: Declare namespaces'); | ||
DB.DBA.XML_SET_NS_DECL ('ex', 'http://example.org/', 2); | ||
log_message('Setup: Load data'); | ||
ld_dir_all ('/rdf/', '*.ttl', 'http://example.org'); | ||
rdf_loader_run(); | ||
log_message('Setup: Finished'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX ex: <http://example.org/> | ||
|
||
ex:ExClass | ||
a owl:Class ; | ||
rdfs:comment "an example class"@en ; | ||
rdfs:label "example class"@en . | ||
|
||
ex:ExInstance | ||
a ex:ExClass ; | ||
ex:exProperty 5 ; | ||
rdfs:comment "an example instance."@en ; | ||
rdfs:label "example instance"@en . | ||
|
||
ex:exProperty | ||
a owl:DatatypeProperty ; | ||
rdfs:domain ex:ExClass ; | ||
rdfs:label "Beispielproperty"@de , | ||
"example property"@en . |