Coverage for lode / models / concept.py: 76%

49 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-03-25 15:05 +0000

1from .resource import Resource 

2 

3class Concept(Resource): 

4 

5 def __init__(self, **kwargs): 

6 

7 super().__init__(**kwargs) 

8 

9 # Relations with Concepts 

10 self.is_sub_concept_of = [] # 0..* 

11 self.is_disjoint_with = [] # 0..* 

12 self.is_equivalent_to = [] # 0..* 

13 self.is_related_to = [] # 0..* 

14 self.has_broad_match = [] # 0..* 

15 self.has_narrow_match = [] # 0..* 

16 self.has_related_match = [] # 0..* 

17 self.has_exact_match = [] # 0..*  

18 self.has_close_match = [] # 0..* 

19 

20 # Setter e Getter per is_sub_concept_of 

21 def set_is_sub_concept_of(self, concept): 

22 """Aggiunge un Concept a is_sub_concept_of""" 

23 self.is_sub_concept_of.append(concept) 

24 

25 def get_is_sub_concept_of(self): 

26 """Restituisce la lista is_sub_concept_of""" 

27 return self.is_sub_concept_of 

28 

29 # Setter e Getter per is_disjoint_with 

30 def set_is_disjoint_with(self, concept): 

31 """Aggiunge un Concept a is_disjoint_with""" 

32 self.is_disjoint_with.append(concept) 

33 

34 def get_is_disjoint_with(self): 

35 """Restituisce la lista is_disjoint_with""" 

36 return self.is_disjoint_with 

37 

38 # Setter e Getter per is_equivalent_to 

39 def set_is_equivalent_to(self, concept): 

40 """Aggiunge un Concept a is_equivalent_to""" 

41 self.is_equivalent_to.append(concept) 

42 

43 def get_is_equivalent_to(self): 

44 """Restituisce la lista is_equivalent_to""" 

45 return self.is_equivalent_to 

46 

47 # Setter e Getter per is_related_to 

48 def set_is_related_to(self, concept): 

49 """Aggiunge un Concept a is_related_to""" 

50 self.is_related_to.append(concept) 

51 

52 def get_is_related_to(self): 

53 """Restituisce la lista is_related_to""" 

54 return self.is_related_to 

55 

56 # Setter e Getter per has_broad_match 

57 def set_has_broad_match(self, concept): 

58 """Aggiunge un Concept a has_broad_match""" 

59 self.has_broad_match.append(concept) 

60 

61 def get_has_broad_match(self): 

62 """Restituisce la lista has_broad_match""" 

63 return self.has_broad_match 

64 

65 # Setter e Getter per has_narrow_match 

66 def set_has_narrow_match(self, concept): 

67 """Aggiunge un Concept a has_narrow_match""" 

68 self.has_narrow_match.append(concept) 

69 

70 def get_has_narrow_match(self): 

71 """Restituisce la lista has_narrow_match""" 

72 return self.has_narrow_match 

73 

74 # Setter e Getter per has_related_match 

75 def set_has_related_match(self, concept): 

76 """Aggiunge un Concept a has_related_match""" 

77 self.has_related_match.append(concept) 

78 

79 def get_has_related_match(self): 

80 """Restituisce la lista has_related_match""" 

81 return self.has_related_match 

82 

83 # Setter e Getter per has_exact_match 

84 def set_has_exact_match(self, concept): 

85 """Aggiunge un Concept a has_exact_match""" 

86 self.has_exact_match.append(concept) 

87 

88 def get_has_exact_match(self): 

89 """Restituisce la lista has_exact_match""" 

90 return self.has_exact_match 

91 

92 # Setter e Getter per has_close_match 

93 def set_has_close_match(self, concept): 

94 """Aggiunge un Concept a has_close_match""" 

95 self.has_close_match.append(concept) 

96 

97 def get_has_close_match(self): 

98 """Restituisce la lista has_close_match""" 

99 return self.has_close_match 

100