ontology
This commit is contained in:
173
ontology_platform/vendored/ontocast/docker/README.md
Normal file
173
ontology_platform/vendored/ontocast/docker/README.md
Normal file
@@ -0,0 +1,173 @@
|
||||
# Triple Store Configuration
|
||||
|
||||
OntoCast supports multiple triple store backends for storing and managing RDF data. This guide covers the setup and configuration of supported triple stores.
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
OntoCast supports the following triple store backends:
|
||||
|
||||
1. **Apache Fuseki** (Recommended) - Native RDF triple store with SPARQL support
|
||||
2. **Neo4j with n10s plugin** - Graph database with RDF capabilities
|
||||
3. **Filesystem** - Local file-based storage (fallback)
|
||||
|
||||
When multiple triple stores are configured, OntoCast uses the following priority order:
|
||||
1. Fuseki (if `FUSEKI_URI` and `FUSEKI_AUTH` are set)
|
||||
2. Neo4j (if `NEO4J_URI` and `NEO4J_AUTH` are set)
|
||||
3. Filesystem (default fallback)
|
||||
|
||||
---
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Configure your triple store connection using environment variables in your main `.env` file:
|
||||
|
||||
```bash
|
||||
# Fuseki Configuration (Preferred)
|
||||
FUSEKI_URI=http://localhost:3032/test
|
||||
FUSEKI_AUTH=admin/abc123-qwe
|
||||
|
||||
# Neo4j Configuration (Alternative)
|
||||
NEO4J_URI=bolt://localhost:7689
|
||||
NEO4J_AUTH=neo4j/test!passfortesting
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Apache Fuseki Setup
|
||||
|
||||
Sample configurations are provided here: [ontocast/docker](https://github.com/growgraph/ontocast/tree/main/docker).
|
||||
|
||||
**1. Prepare the environment file:**
|
||||
```bash
|
||||
cd docker/fuseki
|
||||
cp .env.example .env
|
||||
# Edit with your values
|
||||
```
|
||||
|
||||
**Example `docker/fuseki/.env.example`:**
|
||||
```bash
|
||||
IMAGE_VERSION=secoresearch/fuseki:5.1.0
|
||||
SPEC=test
|
||||
CONTAINER_NAME="${SPEC}.fuseki"
|
||||
STORE_FOLDER="$HOME/tmp/${CONTAINER_NAME}"
|
||||
TS_PORT=3032
|
||||
TS_PASSWORD="abc123-qwe"
|
||||
TS_USERNAME="admin"
|
||||
UID=1000
|
||||
GID=1000
|
||||
```
|
||||
|
||||
**2. Start/Stop Fuseki:**
|
||||
```bash
|
||||
# Start
|
||||
cd docker/fuseki
|
||||
docker compose --env-file .env up fuseki -d
|
||||
|
||||
# Stop
|
||||
# (use the container name from your .env, e.g. test.fuseki)
|
||||
docker compose stop test.fuseki
|
||||
```
|
||||
|
||||
**3. Access Fuseki:**
|
||||
- Web interface: http://localhost:3032
|
||||
- Default dataset: `/test`
|
||||
- SPARQL endpoint: http://localhost:3032/test/sparql
|
||||
|
||||
---
|
||||
|
||||
## Neo4j with n10s Plugin Setup
|
||||
|
||||
**1. Prepare the environment file:**
|
||||
```bash
|
||||
cd docker/neo4j
|
||||
cp .env.example .env
|
||||
# Edit with your values
|
||||
```
|
||||
|
||||
**Example `docker/neo4j/.env.example`:**
|
||||
```bash
|
||||
IMAGE_VERSION=neo4j:5.20
|
||||
SPEC=test
|
||||
CONTAINER_NAME="${SPEC}.sem.neo4j"
|
||||
NEO4J_PORT=7476
|
||||
NEO4J_BOLT_PORT=7689
|
||||
STORE_FOLDER="$HOME/tmp/${CONTAINER_NAME}"
|
||||
NEO4J_PLUGINS='["apoc", "graph-data-science", "n10s"]'
|
||||
NEO4J_AUTH="neo4j/test!passfortesting"
|
||||
```
|
||||
|
||||
**2. Start/Stop Neo4j:**
|
||||
```bash
|
||||
# Start
|
||||
cd docker/neo4j
|
||||
docker compose --env-file .env up neo4j -d
|
||||
|
||||
# Stop
|
||||
docker compose stop neo4j
|
||||
```
|
||||
|
||||
**3. Access Neo4j:**
|
||||
- Browser: http://localhost:7476
|
||||
- Username: `neo4j`
|
||||
- Password: `test!passfortesting`
|
||||
- Bolt: bolt://localhost:7689
|
||||
|
||||
---
|
||||
|
||||
## Filesystem Storage (Fallback)
|
||||
|
||||
If neither Fuseki nor Neo4j is configured, OntoCast will store ontologies and facts as Turtle files in the working directory.
|
||||
|
||||
**No setup required.**
|
||||
|
||||
---
|
||||
|
||||
## Triple Store Comparison
|
||||
|
||||
| Feature | Fuseki | Neo4j + n10s | Filesystem |
|
||||
|---------|--------|--------------|------------|
|
||||
| **RDF Native** | ✅ Yes | ⚠️ Via plugin | ✅ Yes |
|
||||
| **SPARQL** | ✅ Full 1.1 | ❌ Limited | ❌ No |
|
||||
| **Setup Complexity** | ✅ Simple | ⚠️ Moderate | ✅ Very Simple |
|
||||
| **Visualization** | ⚠️ Basic | ✅ Excellent | ❌ None |
|
||||
| **Production Ready** | ✅ Yes | ✅ Yes | ❌ No |
|
||||
|
||||
---
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Use **Filesystem** for quick setup and testing.
|
||||
- Use **Fuseki** for RDF-focused or production deployments.
|
||||
- Use **Neo4j** if you need advanced graph analytics or visualization.
|
||||
- Monitor triple store performance and logs.
|
||||
- Backup your data regularly.
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Fuseki
|
||||
```bash
|
||||
# Check if Fuseki is running
|
||||
curl http://localhost:3032/$/ping
|
||||
|
||||
# Restart Fuseki
|
||||
docker compose restart fuseki
|
||||
```
|
||||
|
||||
### Neo4j
|
||||
```bash
|
||||
# Check if Neo4j is running
|
||||
curl http://localhost:7476
|
||||
|
||||
# Check n10s plugin
|
||||
cypher-shell -u neo4j -p test!passfortesting "CALL n10s.graphconfig.show()"
|
||||
```
|
||||
|
||||
### Common Problems
|
||||
- **Connection Refused**: Triple store not running
|
||||
- **Authentication Failed**: Incorrect credentials
|
||||
- **Dataset Not Found**: Dataset not created in Fuseki
|
||||
- **Plugin Not Loaded**: n10s plugin not installed in Neo4j
|
||||
9
ontology_platform/vendored/ontocast/docker/__init__.py
Normal file
9
ontology_platform/vendored/ontocast/docker/__init__.py
Normal file
@@ -0,0 +1,9 @@
|
||||
"""Docker configurations for OntoCast.
|
||||
|
||||
This package contains Docker configurations for running OntoCast
|
||||
dependencies, including triple store databases and other services.
|
||||
|
||||
Available configurations:
|
||||
- neo4j: Neo4j database with n10s plugin
|
||||
- fuseki: Apache Fuseki triple store server
|
||||
"""
|
||||
@@ -0,0 +1,6 @@
|
||||
IMAGE_VERSION=secoresearch/fuseki:5.1.0
|
||||
SPEC=ontocast
|
||||
CONTAINER_NAME="${SPEC}.fuseki"
|
||||
TS_PORT=3032
|
||||
TS_PASSWORD="abc123-qwe"
|
||||
TS_USERNAME="admin"
|
||||
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
fuseki:
|
||||
image: ${IMAGE_VERSION}
|
||||
user: "${UID}:${GID}"
|
||||
restart: "no"
|
||||
profiles: ["${CONTAINER_NAME}"]
|
||||
ports:
|
||||
- "${TS_PORT}:3030"
|
||||
container_name: ${CONTAINER_NAME}
|
||||
volumes:
|
||||
- fuseki_data:/fuseki
|
||||
environment:
|
||||
- ADMIN_PASSWORD=${TS_PASSWORD}
|
||||
volumes:
|
||||
fuseki_data:
|
||||
driver: local
|
||||
@@ -0,0 +1,7 @@
|
||||
IMAGE_VERSION=neo4j:5.21.0
|
||||
SPEC=ontocast
|
||||
CONTAINER_NAME="${SPEC}.neo4j"
|
||||
NEO4J_PORT=7476
|
||||
NEO4J_BOLT_PORT=7689
|
||||
NEO4J_PLUGINS='["n10s"]'
|
||||
NEO4J_AUTH="neo4j/test!passfortesting"
|
||||
@@ -0,0 +1,26 @@
|
||||
services:
|
||||
neo4j:
|
||||
image: ${IMAGE_VERSION}
|
||||
restart: "no"
|
||||
profiles: ["${CONTAINER_NAME}"]
|
||||
ports:
|
||||
- "${NEO4J_PORT}:7474"
|
||||
- "${NEO4J_BOLT_PORT}:7687"
|
||||
container_name: ${CONTAINER_NAME}
|
||||
volumes:
|
||||
- neo4j_data:/data
|
||||
- neo4j_plugins:/plugins
|
||||
- neo4j_logs:/logs
|
||||
environment:
|
||||
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
|
||||
- NEO4J_AUTH=${NEO4J_AUTH}
|
||||
- NEO4J_PLUGINS=${NEO4J_PLUGINS}
|
||||
- NEO4J_dbms_security_procedures_unrestricted=n10s.*
|
||||
- NEO4J_dbms_security_procedures_allowlist=n10s.*
|
||||
volumes:
|
||||
neo4j_data:
|
||||
driver: local
|
||||
neo4j_plugins:
|
||||
driver: local
|
||||
neo4j_logs:
|
||||
driver: local
|
||||
@@ -0,0 +1,7 @@
|
||||
IMAGE_VERSION=qdrant/qdrant:v1.16.3
|
||||
SPEC=ontocast
|
||||
CONTAINER_NAME="${SPEC}.qdrant"
|
||||
QDRANT_HTTP_PORT=6333
|
||||
QDRANT_GRPC_PORT=6334
|
||||
QDRANT_API_KEY="abc123-qwe"
|
||||
QDRANT_LOG_LEVEL=INFO
|
||||
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
qdrant:
|
||||
image: ${IMAGE_VERSION}
|
||||
restart: "no"
|
||||
profiles: ["${CONTAINER_NAME}"]
|
||||
ports:
|
||||
- "${QDRANT_HTTP_PORT}:6333"
|
||||
- "${QDRANT_GRPC_PORT}:6334"
|
||||
container_name: ${CONTAINER_NAME}
|
||||
volumes:
|
||||
- qdrant_data:/qdrant/storage
|
||||
environment:
|
||||
- QDRANT__SERVICE__API_KEY=${QDRANT_API_KEY}
|
||||
- QDRANT__LOG_LEVEL=${QDRANT_LOG_LEVEL}
|
||||
|
||||
volumes:
|
||||
qdrant_data:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user