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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ class SHACLValidator {
}

// Exposed to be available from validation functions as `SHACL.nodeConformsToShape`
nodeConformsToShape(focusNode, shapeNode, engine = this.validationEngine.clone()) {
nodeConformsToShape(focusNode, shapeNode, engine = this.validationEngine.clone(), resetCheckedNodes = false) {
s-tittel marked this conversation as resolved.
Show resolved Hide resolved
if (resetCheckedNodes) {
this.checkedNodes.clear()
}
const shape = this.shapesGraph.getShape(shapeNode)
try {
this.depth++
Expand Down
2 changes: 1 addition & 1 deletion src/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function validateQualifiedHelper(context, focusNode, constraint) {
const path = constraint.shape.pathObject
return getPathObjects(context.$data, focusNode, path)
.filter(value =>
context.nodeConformsToShape(value, qualifiedValueShapeNode) &&
context.nodeConformsToShape(value, qualifiedValueShapeNode, context.validationEngine, true) &&
!validateQualifiedConformsToASibling(context, value, [...siblingShapes]),
)
.length
Expand Down