Coverage for lode / models / propertyConceptRestriction.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-11-22 15:54 +0000

1"""PropertyConceptRestriction: a restriction that links a property to a concept.""" 

2from .restriction import Restriction 

3 

4class PropertyConceptRestriction(Restriction): 

5 """Base of the restrictions that apply a property to a concept (quantifiers, cardinalities).""" 

6 

7 def __init__(self, **kwargs): 

8 """Create a restriction with no property, no concept, and is_inverse False.""" 

9 super().__init__(**kwargs) 

10 

11 self.applies_on_property = None # 1 

12 self.applies_on_concept = None # 1 

13 self.is_inverse = False #bool 1 

14 

15 def get_applies_on_property(self): 

16 """Return applies_on_property.""" 

17 return self.applies_on_property 

18 

19 def set_applies_on_property(self, property): 

20 """Set applies_on_property.""" 

21 self.applies_on_property = property 

22 

23 def get_applies_on_concept(self): 

24 """Return applies_on_concept.""" 

25 return self.applies_on_concept 

26 

27 def set_applies_on_concept(self, concept): 

28 """Set applies_on_concept.""" 

29 self.applies_on_concept = concept 

30 

31 def get_is_inverse(self): 

32 """Return is_inverse.""" 

33 return self.is_inverse 

34 

35 def set_is_inverse(self, boolean): 

36 """Set is_inverse: whether the restriction is on the inverse of the property.""" 

37 self.is_inverse = boolean