Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes https://github.com/zazuko/rdf-validate-shacl/issues/136 #137

Merged
merged 13 commits into from
Jul 23, 2024

Conversation

s-tittel
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Jul 15, 2024

🦋 Changeset detected

Latest commit: 6041552

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
rdf-validate-shacl Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tpluscode
Copy link
Collaborator

Hey, thank you for your contribution!

Would you please add your failing test case to test/data/data-shapes/custom/ and to the manifest.ttl?

@tpluscode
Copy link
Collaborator

Also, I noticed that the CI wasn't set up correctly. You may want to rebase master in order to run the tests on GH

@s-tittel
Copy link
Contributor Author

Hey, I have rebased master, added the test case and fixed a bug in my code that erroneously let all tests pass. Now I get:

132 passing (3s)
3 pending
6 failing

The failing tests are:

  1. Test of validation report for shape xone-duplicate by property constraints
  2. Test of sh:property at property shape 001
  3. Test of sh:qualifiedMinCount with disjoint shapes at property shape 001
  4. Test of sh:qualifiedValueShape at property shape 001
  5. Test of sh:qualifiedValueShapesDisjoint at property shape 001
  6. Test of validation report for shape shared by property constraints

I am not sure if my code really breaks something or if it just changes the order in the expected test reports.

@tpluscode
Copy link
Collaborator

Thank you for you update.

Unfortunately, there appear to be multiple types of issues here. It is most definitely not just ordering :)

These three produce less validation results, related to logical constraints, I think.

  • Test of validation report for shape xone-duplicate by property constraints
  • Test of sh:property at property shape 001
  • Test of validation report for shape shared by property constraints

On the other hand these two produces duplicate results. Probably somehow related.

  • Test of sh:qualifiedMinCount with disjoint shapes at property shape 001
  • Test of sh:qualifiedValueShapesDisjoint at property shape 001

Finally, this one succeeds validation where it should have failed

  • Test of sh:qualifiedValueShape at property shape 001`

@s-tittel
Copy link
Contributor Author

Yes, unfortunately. The first 3 mentioned test cases could be fixed by reordering / deduplication of validation results (see latest commit).
Regarding the qualified value shape tests I currently have no clue.

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.77%. Comparing base (1d43b2f) to head (6041552).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #137   +/-   ##
=======================================
  Coverage   98.76%   98.77%           
=======================================
  Files          12       12           
  Lines        1866     1881   +15     
=======================================
+ Hits         1843     1858   +15     
  Misses         23       23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@s-tittel
Copy link
Contributor Author

The latest commit is a bit quirky, but fixes validation for qualified value shapes by resetting the list of already checked focus nodes.

index.js Outdated Show resolved Hide resolved
src/validation-engine.js Outdated Show resolved Hide resolved
@s-tittel
Copy link
Contributor Author

Ok, still 3 tests failing. I'll see what I can do.

@s-tittel
Copy link
Contributor Author

the latest commit lets all tests pass. it's not a perfect solution, but I couldn't come up with something better. at least the qualified value shape tests obviously need some degree of recursion, so what I do is check for a max recursion depth. what do you think?

Copy link
Collaborator

@tpluscode tpluscode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

For final touches, please see the comment suggestion and I'd make the maxRecursionDepth a field coming from the constructor like maxErrors.

src/validation-engine.js Outdated Show resolved Hide resolved
@tpluscode tpluscode merged commit b4d77c8 into zazuko:master Jul 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants