diff --git a/pyshacl/constraints/advanced/__init__.py b/pyshacl/constraints/advanced/__init__.py index 841bdc9..c5afeaa 100644 --- a/pyshacl/constraints/advanced/__init__.py +++ b/pyshacl/constraints/advanced/__init__.py @@ -39,7 +39,7 @@ def constraint_parameters(cls): return [SH_expression] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "ExpressionConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: diff --git a/pyshacl/constraints/constraint_component.py b/pyshacl/constraints/constraint_component.py index a70452e..93b9123 100644 --- a/pyshacl/constraints/constraint_component.py +++ b/pyshacl/constraints/constraint_component.py @@ -73,7 +73,7 @@ def constraint_parameters(cls): @classmethod @abc.abstractmethod - def constraint_name(cls): + def constraint_name(cls) -> str: raise NotImplementedError() # pragma: no cover @abc.abstractmethod @@ -85,7 +85,7 @@ def evaluate( def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: return [] - def __str__(self): + def __str__(self) -> str: c_name = str(self.__class__.__name__) shape_id = str(self.shape) return "<{} on {}>".format(c_name, shape_id) diff --git a/pyshacl/constraints/core/cardinality_constraints.py b/pyshacl/constraints/core/cardinality_constraints.py index 18b63d2..85ca7f9 100644 --- a/pyshacl/constraints/core/cardinality_constraints.py +++ b/pyshacl/constraints/core/cardinality_constraints.py @@ -70,7 +70,7 @@ def constraint_parameters(cls): return [SH_minCount] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MinCountConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: @@ -157,7 +157,7 @@ def constraint_parameters(cls): return [SH_maxCount] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MaxCountConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: diff --git a/pyshacl/constraints/core/logical_constraints.py b/pyshacl/constraints/core/logical_constraints.py index 7a27508..504e2e1 100644 --- a/pyshacl/constraints/core/logical_constraints.py +++ b/pyshacl/constraints/core/logical_constraints.py @@ -52,7 +52,7 @@ def constraint_parameters(cls): return [SH_not] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "NotConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -155,7 +155,7 @@ def constraint_parameters(cls): return [SH_and] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "AndConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -251,7 +251,7 @@ def constraint_parameters(cls): return [SH_or] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "OrConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -347,7 +347,7 @@ def constraint_parameters(cls): return [SH_xone] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "XoneConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: diff --git a/pyshacl/constraints/core/other_constraints.py b/pyshacl/constraints/core/other_constraints.py index 342cc3d..bd152f4 100644 --- a/pyshacl/constraints/core/other_constraints.py +++ b/pyshacl/constraints/core/other_constraints.py @@ -58,7 +58,7 @@ def constraint_parameters(cls): return [SH_in] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "InConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -137,7 +137,7 @@ def constraint_parameters(cls): return [SH_closed, SH_ignoredProperties] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "ClosedConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -284,7 +284,7 @@ def constraint_parameters(cls): return [SH_hasValue] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "HasValueConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: diff --git a/pyshacl/constraints/core/property_pair_constraints.py b/pyshacl/constraints/core/property_pair_constraints.py index 29c3e5a..270207d 100644 --- a/pyshacl/constraints/core/property_pair_constraints.py +++ b/pyshacl/constraints/core/property_pair_constraints.py @@ -50,7 +50,7 @@ def constraint_parameters(cls): return [SH_equals] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "EqualsConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -177,7 +177,7 @@ def constraint_parameters(cls): return [SH_disjoint] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "DisjointConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -302,7 +302,7 @@ def constraint_parameters(cls): return [SH_lessThan] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "LessThanConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -453,7 +453,7 @@ def constraint_parameters(cls): return [SH_lessThanOrEquals] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "LessThanOrEqualsConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: diff --git a/pyshacl/constraints/core/shape_based_constraints.py b/pyshacl/constraints/core/shape_based_constraints.py index 634e3bb..db847ff 100644 --- a/pyshacl/constraints/core/shape_based_constraints.py +++ b/pyshacl/constraints/core/shape_based_constraints.py @@ -65,7 +65,7 @@ def constraint_parameters(cls): return [SH_property] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "PropertyConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -159,7 +159,7 @@ def constraint_parameters(cls): return [SH_node] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "NodeConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -320,7 +320,7 @@ def constraint_parameters(cls): return [SH_qualifiedValueShape, SH_qualifiedMinCount, SH_qualifiedValueShapesDisjoint, SH_qualifiedMaxCount] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "QualifiedValueShapeConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: diff --git a/pyshacl/constraints/core/string_based_constraints.py b/pyshacl/constraints/core/string_based_constraints.py index 5adf9a1..3090282 100644 --- a/pyshacl/constraints/core/string_based_constraints.py +++ b/pyshacl/constraints/core/string_based_constraints.py @@ -47,7 +47,7 @@ def constraint_parameters(cls): raise NotImplementedError() @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: raise NotImplementedError() @classmethod @@ -136,7 +136,7 @@ def constraint_parameters(cls): return [SH_minLength] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MinLengthConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -216,7 +216,7 @@ def constraint_parameters(cls): return [SH_maxLength] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MaxLengthConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -284,7 +284,7 @@ def constraint_parameters(cls): return [SH_pattern] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "PatternConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -362,7 +362,7 @@ def constraint_parameters(cls): return [SH_languageIn] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "LanguageInConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -456,7 +456,7 @@ def constraint_parameters(cls): return [SH_uniqueLang] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "UniqueLangConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: diff --git a/pyshacl/constraints/core/value_constraints.py b/pyshacl/constraints/core/value_constraints.py index ce83eb7..6786f52 100644 --- a/pyshacl/constraints/core/value_constraints.py +++ b/pyshacl/constraints/core/value_constraints.py @@ -74,7 +74,7 @@ def constraint_parameters(cls): return [SH_class] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "ClassConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: @@ -188,7 +188,7 @@ def constraint_parameters(cls): return [SH_datatype] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "DatatypeConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: @@ -296,7 +296,7 @@ def constraint_parameters(cls): return [SH_nodeKind] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "NodeKindConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: diff --git a/pyshacl/constraints/core/value_range_constraints.py b/pyshacl/constraints/core/value_range_constraints.py index a4b285e..266245d 100644 --- a/pyshacl/constraints/core/value_range_constraints.py +++ b/pyshacl/constraints/core/value_range_constraints.py @@ -49,7 +49,7 @@ def constraint_parameters(cls): return [SH_minExclusive] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MinExclusiveConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -139,7 +139,7 @@ def constraint_parameters(cls): return [SH_minInclusive] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MinInclusiveConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -229,7 +229,7 @@ def constraint_parameters(cls): return [SH_maxExclusive] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MaxExclusiveConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: @@ -319,7 +319,7 @@ def constraint_parameters(cls): return [SH_maxInclusive] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "MaxInclusiveConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: diff --git a/pyshacl/constraints/sparql/sparql_based_constraint_components.py b/pyshacl/constraints/sparql/sparql_based_constraint_components.py index 92c1ff9..1998146 100644 --- a/pyshacl/constraints/sparql/sparql_based_constraint_components.py +++ b/pyshacl/constraints/sparql/sparql_based_constraint_components.py @@ -52,7 +52,7 @@ def constraint_parameters(cls): return [] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "ConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[rdflib.Literal]: diff --git a/pyshacl/constraints/sparql/sparql_based_constraints.py b/pyshacl/constraints/sparql/sparql_based_constraints.py index 4fc8bf4..4b322da 100644 --- a/pyshacl/constraints/sparql/sparql_based_constraints.py +++ b/pyshacl/constraints/sparql/sparql_based_constraints.py @@ -85,7 +85,7 @@ def constraint_parameters(cls): return [SH_sparql] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "SPARQLConstraintComponent" def evaluate( diff --git a/pyshacl/extras/js/constraint.py b/pyshacl/extras/js/constraint.py index 1b7b228..28e9e80 100644 --- a/pyshacl/extras/js/constraint.py +++ b/pyshacl/extras/js/constraint.py @@ -74,7 +74,7 @@ def constraint_parameters(cls): return [SH_js] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "JSConstraint" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: diff --git a/pyshacl/extras/js/constraint_component.py b/pyshacl/extras/js/constraint_component.py index defe46c..330ef6a 100644 --- a/pyshacl/extras/js/constraint_component.py +++ b/pyshacl/extras/js/constraint_component.py @@ -70,7 +70,7 @@ def constraint_parameters(cls): return [] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "ConstraintComponent" def make_generic_messages(self, datagraph: GraphLike, focus_node, value_node) -> List[Literal]: diff --git a/pyshacl/extras/js/target.py b/pyshacl/extras/js/target.py index eaf04d9..f0854b0 100644 --- a/pyshacl/extras/js/target.py +++ b/pyshacl/extras/js/target.py @@ -39,7 +39,7 @@ def constraint_parameters(cls): return [] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "JSTargetType" @classmethod diff --git a/pyshacl/target.py b/pyshacl/target.py index 2df6c36..bba6953 100644 --- a/pyshacl/target.py +++ b/pyshacl/target.py @@ -109,7 +109,7 @@ def constraint_parameters(cls): return [] @classmethod - def constraint_name(cls): + def constraint_name(cls) -> str: return "SPARQLTargetType" @classmethod