Coverage for heritrace/utils/virtuoso_utils.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-18 11:10 +0000

1from flask import current_app 

2 

3 

4VIRTUOSO_EXCLUDED_GRAPHS = [ 

5 "http://localhost:8890/DAV/", 

6 "http://www.openlinksw.com/schemas/virtrdf#", 

7 "http://www.w3.org/2002/07/owl#", 

8 "http://www.w3.org/ns/ldp#", 

9 "urn:activitystreams-owl:map", 

10 "urn:core:services:sparql", 

11] 

12 

13 

14def is_virtuoso(app=None): 

15 """ 

16 Check if the triplestore is Virtuoso. 

17 

18 Args: 

19 app: Flask application object (optional) 

20 

21 Returns: 

22 bool: True if triplestore is Virtuoso, False otherwise 

23 """ 

24 if app is None: 

25 from flask import current_app 

26 

27 app = current_app 

28 return app.config["DATASET_DB_TRIPLESTORE"].lower() == "virtuoso"