Skip to content

Commit

Permalink
Fix #631
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrancart committed Sep 10, 2024
1 parent 3f570d9 commit 37181b6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,13 @@ export class SHACLSpecificationEntity extends SHACLSpecificationEntry implements
}

/**
* @returns true if this shape has a target, either a targetClass or sh:target
* @returns true if this shape has a target, either a targetClass or sh:target, or is itself a Class
*/
hasTypeCriteria(): boolean {
var hasTargetClass = this.graph.hasTriple(factory.namedNode(this.uri), SH.TARGET_CLASS, null);
var hasTarget = this.graph.hasTriple(factory.namedNode(this.uri), SH.TARGET, null);
return (hasTargetClass || hasTarget);
var isItselfClass = this.graph.hasTriple(factory.namedNode(this.uri), RDF.TYPE, RDFS.CLASS);
return (hasTargetClass || hasTarget || isItselfClass);
}

/**
Expand Down

0 comments on commit 37181b6

Please sign in to comment.