Coverage for heritrace/uri_generator/uri_generator.py: 100%

1 statements  

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

1from abc import ABC, abstractmethod 

2 

3 

4class URIGenerator(ABC): # pragma: no cover 

5 """ 

6 Abstract base class for URI generators. 

7 """ 

8 

9 @abstractmethod 

10 def generate_uri(self, entity_type: str | None = None) -> str: 

11 """ 

12 Generate a new URI for an entity of the given type. 

13 

14 :param entity_type: The type of entity to generate a URI for 

15 :type entity_type: str 

16 :return: The generated URI 

17 :rtype: str 

18 """ 

19 pass 

20 

21 @abstractmethod 

22 def initialize_counters(self, sparql) -> None: 

23 """ 

24 Initialize counters for entity types supported by this URI generator. 

25 

26 :param sparql: SPARQLWrapper instance to execute queries on the dataset 

27 :return: None 

28 """ 

29 pass