Coverage for heritrace / utils / virtuoso_utils.py: 90%
10 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-07-02 10:16 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-07-02 10:16 +0000
1# SPDX-FileCopyrightText: 2024-2025 Arcangelo Massari <arcangelo.massari@unibo.it>
2#
3# SPDX-License-Identifier: ISC
5from __future__ import annotations
7from typing import TYPE_CHECKING
9from flask import current_app
11if TYPE_CHECKING:
12 from flask import Flask
15VIRTUOSO_EXCLUDED_GRAPHS = [
16 "http://localhost:8890/DAV/",
17 "http://www.openlinksw.com/schemas/virtrdf#",
18 "http://www.w3.org/2002/07/owl#",
19 "http://www.w3.org/ns/ldp#",
20 "urn:activitystreams-owl:map",
21 "urn:core:services:sparql",
22]
25def is_virtuoso(app: Flask | None = None) -> bool:
26 """
27 Check if the triplestore is Virtuoso.
29 Args:
30 app: Flask application object (optional)
32 Returns:
33 bool: True if triplestore is Virtuoso, False otherwise
34 """
35 if app is None:
36 app = current_app
37 return app.config["DATASET_DB_TRIPLESTORE"].lower() == "virtuoso"