Skip to content

Commit 2bcc520

Browse files
committed
Reorder NodeConstraint arguments
1 parent 8bb5d79 commit 2bcc520

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/ShapeLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private record ShapeContext(Statement statement, Optional<Path> path) {
121121
.put( SHACL.and(), context -> new AndConstraint( nestedConstraintList( context.statement(), context.path() ) ) )
122122
.put( SHACL.or(), context -> new OrConstraint( nestedConstraintList( context.statement(), context.path() ) ) )
123123
.put( SHACL.xone(), context -> new XoneConstraint( nestedConstraintList( context.statement(), context.path() ) ) )
124-
.put( SHACL.node(), context -> new NodeConstraint( context.path(), nodeShape( context.statement().getObject().asResource() ) ) )
124+
.put( SHACL.node(), context -> new NodeConstraint( nodeShape( context.statement().getObject().asResource() ), context.path() ) )
125125
.put( SHACL.in(), context -> new AllowedValuesConstraint( context.statement().getResource().as( RDFList.class ).asJavaList() ) )
126126
.put( SHACL.closed(), context -> {
127127
boolean closed = context.statement().getBoolean();

core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/constraint/NodeConstraint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* Implements <a href="https://www.w3.org/TR/shacl/#NodeConstraintComponent">sh:node</a>
2828
* @param targetShape the node shape this sh:node refers to
2929
*/
30-
public record NodeConstraint(Optional<Path> path, Shape.Node targetShape) implements Constraint {
30+
public record NodeConstraint(Shape.Node targetShape, Optional<Path> path) implements Constraint {
3131
@Override
3232
public List<Violation> apply( final RDFNode rdfNode, final EvaluationContext context ) {
3333
// Having a path means that the node constraint is used inside a property shape, i.e., it applies to the element the

0 commit comments

Comments
 (0)