pyshacl/constraints/sparql/sparql_based_constraint_components.py
def apply_to_shape_via_constraint(self, constraint, shape, **kwargs) -> BoundShapeValidatorComponent:
        """
        Create a new Custom Constraint (BoundShapeValidatorComponent)
        :param constraint:
        :type constraint: SPARQLConstraintComponent
        :param shape:
        :type shape: pyshacl.shape.Shape
        :param kwargs:
        :return:
        """
        must_be_ask_val = kwargs.pop('must_be_ask_val', False)
        if must_be_ask_val and not (isinstance(self, AskConstraintValidator)):
            # TODO:coverage: No test for this case, do we need to test this?
            raise ConstraintLoadError(
                "Validator not for NodeShape or a PropertyShape must be of type SPARQLAskValidator.",
                "https://www.w3.org/TR/shacl/#ConstraintComponent",
            )
        must_be_select_val = kwargs.pop('must_be_select_val', False)
        if must_be_select_val and not (isinstance(self, SelectConstraintValidator)):
            # TODO:coverage: No test for this case, do we need to test this?
            raise ConstraintLoadError(
                "Validator for a NodeShape or a PropertyShape must be of type SPARQLSelectValidator.",
                "https://www.w3.org/TR/shacl/#ConstraintComponent",
            )

        return BoundShapeValidatorComponent(constraint, shape, self)

        Create a new Custom Constraint (BoundShapeValidatorComponent)
        :param constraint:
        :type constraint: SPARQLConstraintComponent
        :param shape:
        :type shape: pyshacl.shape.Shape
        :param kwargs:
        :return:
        
Create a new Custom Constraint (BoundShapeValidatorComponent)
Create a new Custom Constraint ( BoundShapeValidatorComponent )
def apply_to_shape_via_constraint(self, constraint, shape, **kwargs) -> BoundShapeValidatorComponent:
        must_be_ask_val = kwargs.pop('must_be_ask_val', False)
        if must_be_ask_val and not (isinstance(self, AskConstraintValidator)):
            raise ConstraintLoadError(
                "Validator not for NodeShape or a PropertyShape must be of type SPARQLAskValidator.",
                "https://www.w3.org/TR/shacl/#ConstraintComponent",
            )
        must_be_select_val = kwargs.pop('must_be_select_val', False)
        if must_be_select_val and not (isinstance(self, SelectConstraintValidator)):
            raise ConstraintLoadError(
                "Validator for a NodeShape or a PropertyShape must be of type SPARQLSelectValidator.",
                "https://www.w3.org/TR/shacl/#ConstraintComponent",
            )
        return BoundShapeValidatorComponent(constraint, shape, self)
def apply_to_shape_via_constraint ( self , constraint , shape , ** kwargs ) -> BoundShapeValidatorComponent : must_be_ask_val = kwargs . pop ( 'must_be_ask_val' , False ) if must_be_ask_val and not ( isinstance ( self , AskConstraintValidator ) ) : raise ConstraintLoadError ( "Validator not for NodeShape or a PropertyShape must be of type SPARQLAskValidator." , "https://www.w3.org/TR/shacl/#ConstraintComponent" , ) must_be_select_val = kwargs . pop ( 'must_be_select_val' , False ) if must_be_select_val and not ( isinstance ( self , SelectConstraintValidator ) ) : raise ConstraintLoadError ( "Validator for a NodeShape or a PropertyShape must be of type SPARQLSelectValidator." , "https://www.w3.org/TR/shacl/#ConstraintComponent" , ) return BoundShapeValidatorComponent ( constraint , shape , self )
Create a new Custom Constraint (BoundShapeValidatorComponent)
Create a new Custom Constraint ( BoundShapeValidatorComponent )
"""
        Create a new Custom Constraint (BoundShapeValidatorComponent)
        :param constraint:
        :type constraint: SPARQLConstraintComponent
        :param shape:
        :type shape: pyshacl.shape.Shape
        :param kwargs:
        :return:
        """ # TODO:coverage: No test for this case, do we need to test this? # TODO:coverage: No test for this case, do we need to test this?
None
self
constraint
None
shape
None
kwargs
None