[ 
https://issues.apache.org/jira/browse/JENA-1947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183279#comment-17183279
 ] 

Andy Seaborne commented on JENA-1947:
-------------------------------------

Hi there - thanks for the report. It should be defensive about this. 

 The stack overflow is happening in the parsing - {{sh:deactivated}} is 
interpreted when the shape is run which is why it isn't considered.

I don't know what, in general, recursion would mean for a node shape. "and" or 
"or" of the same item could make sense (they are no-ops) but they are special 
cases.


https://www.w3.org/TR/shacl/#shapes-recursion
"""
The validation with recursive shapes is not defined in SHACL and is left to 
SHACL processor implementations. For example, SHACL processors may support 
recursion scenarios or produce a failure when they detect recursion. 
"""

Basically - don't do that!


> SHACL validator: Stack overflow on recursive shapes even if deactivated
> -----------------------------------------------------------------------
>
>                 Key: JENA-1947
>                 URL: https://issues.apache.org/jira/browse/JENA-1947
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: SHACL
>            Reporter: Jan Rosecky
>            Priority: Major
>
> I'm trying to validate using a set of shapes including: 
> [http://purl.allotrope.org/shapes/adm/core/REC/2020/06/common.shapes] . 
> af-s:AFS_0000001 has a recursive sh:and(af-s:AFS_0000001) clause, which 
> causes a stack overflow exception - even though the shape is sh:deactivated.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to