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

feat(shacl): validate command: look for shapes in validated chunk #322

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

tpluscode
Copy link
Contributor

I wanted to be able to validate from the CLI command without --shapes. In this case, the standard input would be expected to include the shapes too

b59 shacl validate < data+shapes.ttl

As consequence, in any pipeline where we use the SHACL step, we can process each chunk individually, where each can have different shapes too.

Copy link

changeset-bot bot commented Aug 21, 2024

🦋 Changeset detected

Latest commit: b4b70c1

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

This PR includes changesets to release 2 packages
Name Type
barnard59-core Minor
barnard59 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

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.30%. Comparing base (6ff3428) to head (b4b70c1).
Report is 4 commits behind head on master.

Files Patch % Lines
packages/shacl/report.js 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
+ Coverage   84.34%   85.30%   +0.96%     
==========================================
  Files         176      177       +1     
  Lines        7390     7411      +21     
  Branches      241      241              
==========================================
+ Hits         6233     6322      +89     
+ Misses       1155     1087      -68     
  Partials        2        2              
Flag Coverage Δ
barnard59 80.02% <ø> (ø)
barnard59-base 48.85% <ø> (ø)
barnard59-core 90.97% <100.00%> (+0.01%) ⬆️
barnard59-csvw 68.48% <ø> (ø)
barnard59-cube 95.43% <ø> (ø)
barnard59-formats 28.17% <ø> (ø)
barnard59-ftp 97.60% <ø> (ø)
barnard59-graph-store 95.10% <ø> (ø)
barnard59-http 87.09% <ø> (ø)
barnard59-rdf 94.84% <ø> (ø)
barnard59-s3 100.00% <ø> (ø)
barnard59-shacl 80.21% <93.54%> (+28.25%) ⬆️
barnard59-sparql 94.93% <ø> (ø)
barnard59-validation 97.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@@ -19,8 +20,7 @@ async function * validate(ds, maxViolations, iterable) {
break
}

// create a new validator instance at each iteration to avoid memory leaks
const validator = new SHACLValidator(ds, { maxErrors: 0, factory: this.env })
const validator = new SHACLValidator(shapes || chunk, { maxErrors: 0, factory: this.env })
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering about merging shapes and chunk, but probably not worth it for the overhead and the added complexity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merging how?

Copy link
Contributor

Choose a reason for hiding this comment

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

regular graph merge, hence collecting shapes from both

@tpluscode tpluscode merged commit 6af7335 into master Aug 26, 2024
39 checks passed
@tpluscode tpluscode deleted the shacl-validate-combine-graphs branch August 26, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants