Skip to content

FAILED test/test_js/test_js_constraint_component.py::test_js_constraint_component #290

@santiagorr

Description

@santiagorr

Hi there!

When trying to package pyshacl for Debian, I am getting failures with six tests:

...
=========================== short test summary info ============================
FAILED test/test_js/test_js_constraint_component.py::test_js_constraint_component - pyshacl.errors.ConstraintLoadError: A Custom Constraint must include one of a SPARQLConstraintComponent validator or a JSConstraint validator.
For reference, see https://www.w3.org/TR/shacl/#constraint-components-validators
FAILED test/test_js/test_js_constraint_path_component.py::test_js_constraint_path_component - pyshacl.errors.ConstraintLoadError: A Custom Constraint must include one of a SPARQLConstraintComponent validator or a JSConstraint validator.
For reference, see https://www.w3.org/TR/shacl/#constraint-components-validators
FAILED test/test_js/test_js_function.py::test_js_function - assert not True
FAILED test/test_js/test_js_rules.py::test_js_rules - pyshacl.errors.RuleLoadError: when using sh:rule, the Rule must be defined as either a TripleRule or SPARQLRule.
For reference, see https://www.w3.org/TR/shacl-af/#rules-syntax
FAILED test/test_js/test_js_target.py::test_js_target - KeyError: 'type'
FAILED test/test_js/test_js_target_type.py::test_js_target_type - pyshacl.errors.ShapeLoadError: None of these types match a TargetType: http://datashapes.org/sh/tests/js/target/jsTargetType-001.test#PeopleBornInCountryTarget
For reference, see https://www.w3.org/TR/shacl-af/#SPARQLTargetType
============ 6 failed, 362 passed, 21 warnings in 88.58s (0:01:28) =============
...

This is report for test_js_constraint_component.py::test_js_constraint_component:


_________________________ test_js_constraint_component _________________________

    def test_js_constraint_component():
        s1 = Graph().parse(data=shapes_graph, format="turtle")
        g1 = Graph().parse(data=data_graph, format="turtle")
>       conforms, result_graph, result_text = validate(g1, shacl_graph=s1, advanced=True, debug=True, js=True)

test/test_js/test_js_constraint_component.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pyshacl/entrypoints.py:178: in validate
    conforms, report_graph, report_text = validator.run()
pyshacl/validator.py:315: in run
    _is_conform, _reports = s.validate(executor, g, focus=on_focus_nodes)
pyshacl/shape.py:772: in validate
    _is_conform, _reports = c.evaluate(executor, target_graph, focus_value_nodes, _e_p_copy)
pyshacl/constraints/core/shape_based_constraints.py:99: in evaluate
    _nc, _r = self._evaluate_property_shape(
pyshacl/constraints/core/shape_based_constraints.py:128: in _evaluate_property_shape
    _is_conform, _r = prop_shape.validate(
pyshacl/shape.py:809: in validate
    validator = a.make_validator_for_shape(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pyshacl.constraints.constraint_component.CustomConstraintComponent object at 0x7f9e57151c10>
shape = <Shape p=True node=n5429d4942b604bacb21b2973d2ddbd1bb3>

    def make_validator_for_shape(self, shape: 'Shape'):
>       raise ConstraintLoadError(
            "A Custom Constraint must include one of a SPARQLConstraintComponent validator or a JSConstraint validator.",
            "https://www.w3.org/TR/shacl/#constraint-components-validators",
        )
E       pyshacl.errors.ConstraintLoadError: A Custom Constraint must include one of a SPARQLConstraintComponent validator or a JSConstraint validator.
E       For reference, see https://www.w3.org/TR/shacl/#constraint-components-validators

pyshacl/constraints/constraint_component.py:447: ConstraintLoadError

Full log can be found at: https://salsa.debian.org/python-team/packages/pyshacl/-/jobs/7443344

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions