Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ var/
.DS_Store

# Tests
test/virtuoso-test-data/
test/virtuoso-meta-data/database/virtuoso.lck
test/virtuoso-meta-data/database/virtuoso.log
test/virtuoso-meta-data/index_entities.txt
test/qlever-index-data/oc-index-test.server-log.txt
test/qlever-data/oc-test.server-log.txt
.coverage

# uv
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM python:3.11-slim
ENV BASE_URL="api.opencitations.net" \
LOG_DIR="/mnt/log_dir/oc_api" \
SPARQL_ENDPOINT_INDEX="http://qlever-service.default.svc.cluster.local:7011" \
SPARQL_ENDPOINT_META="http://virtuoso-service.default.svc.cluster.local:8890/sparql" \
SPARQL_ENDPOINT_META="http://meta-qlever-service.default.svc.cluster.local:7011" \
SYNC_ENABLED="true"

# Ensure Python output is unbuffered
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For instance:
BASE_URL=api.opencitations.net
LOG_DIR=/home/dir/log/
SPARQL_ENDPOINT_INDEX=http://qlever-service.default.svc.cluster.local:7011
SPARQL_ENDPOINT_META=http://virtuoso-service.default.svc.cluster.local:8890/sparql
SPARQL_ENDPOINT_META=http://meta-qlever-service.default.svc.cluster.local:7011
SYNC_ENABLED=true

# Redis Configuration
Expand Down Expand Up @@ -127,7 +127,7 @@ VERSION=$(grep -m1 '^version' pyproject.toml | cut -d'"' -f2)
docker build -t opencitations/oc_api:$VERSION .
docker run -p 8080:8080 \
-e SPARQL_ENDPOINT_INDEX=http://qlever:7011 \
-e SPARQL_ENDPOINT_META=http://virtuoso:8890/sparql \
-e SPARQL_ENDPOINT_META=http://meta-qlever:7011 \
opencitations/oc_api:$VERSION
```

Expand All @@ -141,7 +141,7 @@ You can customize the Gunicorn server configuration by modifying the `gunicorn.c

### Running Tests Locally

The tests require Docker. Pytest fixtures in `test/conftest.py` automatically start and stop the QLever and Virtuoso containers.
The tests require Docker. Pytest fixtures in `test/conftest.py` automatically start and stop the QLever container.

1. Install dependencies:
```bash
Expand Down
11 changes: 6 additions & 5 deletions api_oc.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@
skgif_api_manager = APIManager(
c["api_skgif"], endpoint_override=env_config["sparql_endpoint_meta"]
)
for config in skgif_api_manager.all_conf.values():
config["sources_map"] = {
"meta": env_config["sparql_endpoint_meta"],
"index": env_config["sparql_endpoint_index"],
}
for manager in (index_api_manager, index_api_manager_v2, skgif_api_manager):
for config in manager.all_conf.values():
config["sources_map"] = {
"meta": env_config["sparql_endpoint_meta"],
"index": env_config["sparql_endpoint_index"],
}
skgif_doc_manager = HTMLDocumentationHandler(skgif_api_manager)
skgif_openapi_manager = OpenAPIDocumentationHandler(skgif_api_manager)

Expand Down
2 changes: 1 addition & 1 deletion conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"oc_services_templates": "https://github.com/opencitations/oc_services_templates",
"base_url": " api.opencitations.net",
"sparql_endpoint_index": "http://qlever-service.default.svc.cluster.local:7011",
"sparql_endpoint_meta": "http://virtuoso-service.default.svc.cluster.local:8890/sparql",
"sparql_endpoint_meta": "http://meta-qlever-service.default.svc.cluster.local:7011",
"api_index": [ "src/api/index_v1.hf" ],
"api_index_v2": [ "src/api/index_v2.hf" ],
"api_meta": ["src/api/meta_v1.hf"],
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[project]
name = "oc-api"
version = "4.0.1"
version = "4.2.0"
description = "OpenCitations API"
authors = [
{name = "Mario Petrella", email = "mario.petrella@unibo.it"},
Expand All @@ -20,7 +20,7 @@ dependencies = [
"gunicorn>=22.0.0",
"idna>=3.15",
"python-dateutil>=2.9.0.post0",
"ramose>=2.9.1",
"ramose>=2.10.1",
"rdflib>=6.1.1",
"redis>=7.0.1",
"requests>=2.32.4",
Expand Down
Loading
Loading