Re: more on recursion [was Re: fun with sh:hasShape]

Dear Peter,

Could you please check if you have further comments on the definition of
recursive shapes?
http://w3c.github.io/data-shapes/shacl/#shapes-recursion

Best regards,
Dimitris

On Tue, Sep 27, 2016 at 1:51 PM, Peter F. Patel-Schneider <
pfpschneider@gmail.com> wrote:

> I don't think that that the new wording is adequate.
>
> "A recursive shape is a shape thar refers to itself directly or
> transitively
> via shape-based constraint components (i.e. sh:shape), logical constraint
> components (i.e. sh:or), filter shapes (sh:filterShape) or the sh:hasShape
> SPARQL function as defined in appendix A. The handling of recursive shapes
> is
> not defined in SHACL and is left to SHACL processor implementations."
>
> s:s1 doesn't refer to itself.  Instead, the validation of s:s1 on ex:foo5
> ends
> up having the determination of whether a violation should be reported
> depending on whether a violation should be reported, even though there is
> no
> path from s:s1 back to itself in the shapes graph.  Different wording is
> needed to describe this newly-detected problem with sh:hasShape.
>
> The wording also continues to not distinguish between
>
> ex:sr rdf:type sh:Shape ;
>   sh:class ex:c ;
>   sh:property [ rdf:type sh:ProperyConstraint;
>                 sh:predicate ex:p ; sh:shape ex:sr ] .
>
> and
>
> ex:sr rdf:type sh:Shape ;
>   ex:class ex:c ;
>   rdfs:seeAlso [ rdf:type sh:ProperyConstraint;
>                  sh:predicate ex:p ; sh:shape ex:sr ] .
>
>
>
> There needs to be a better definition of what counts as a recursive shape
> in
> SHACL.
>
>
> Peter F. Patel-Schneider
> Nuance Communications
>
>
>
>
> On 09/27/2016 12:44 AM, Dimitris Kontokostas wrote:
> > As with other types of recursion, this is also unspecified in the spec
> >
> > I placed the sh:hasShape function in the recursive shape list
> > https://github.com/w3c/data-shapes/commit/52396ff9014e055a6332c28516ac05
> 74fb3c3211
> >
> > On Mon, Sep 26, 2016 at 10:01 PM, Peter F. Patel-Schneider
> > <pfpschneider@gmail.com <mailto:pfpschneider@gmail.com>> wrote:
> >
> >     What happens here?  Why?  Is what happens reasonable?
> >
> >
> >     Data graph
> >
> >     @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
> >     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>> .
> >     @prefix sh:  <http://www.w3.org/ns/shacl#> .
> >     @prefix ex:  <http://example.org/ex/> .
> >     @prefix s:   <http://example.org/s/> .
> >
> >     ex:foo1 rdf:type ex:foo ;
> >             rdf:type ex:bar ;
> >       s:shape s:bar .
> >
> >     ex:foo2 rdf:type ex:foo ;
> >             rdf:type ex:baz ;
> >       s:shape s:bar .
> >
> >     ex:foo3 rdf:type ex:foo ;
> >             rdf:type ex:baz ;
> >       s:shape s:baz .
> >
> >     ex:foo4 rdf:type ex:foo ;
> >             rdf:type ex:baz ;
> >       s:shape s:s0 .
> >
> >     ex:foo5 rdf:type ex:foo ;
> >             rdf:type ex:baz ;
> >       s:shape s:s1 .
> >
> >     ex:foon1 rdf:type ex:foon ;
> >             rdf:type ex:baz ;
> >       s:shape s:s2 .
> >
> >
> >
> >     Shapes graph
> >
> >     @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
> >     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>> .
> >     @prefix sh:  <http://www.w3.org/ns/shacl#> .
> >     @prefix ex:  <http://example.org/ex/> .
> >     @prefix s:   <http://example.org/s/> .
> >
> >     s:s1 rdf:type sh:Shape ;
> >       sh:targetClass ex:foo ;
> >       sh:sparql [
> >         sh:select
> >           """SELECT $this WHERE {
> >             $this s:shape ?shape ;
> >             BIND (sh:hasShape($this,?shape,$shapesGraph) AS ?hasShape)
> >             BIND (!bound(?hasShape) AS ?failure )
> >             FILTER (?failure || !?hasShape) }""" ] .
> >
> >     s:bar sh:class ex:bar .
> >
> >     s:baz sh:class ex:baz .
> >
> >     s:s2 rdf:type sh:Shape ;
> >       sh:targetClass ex:foon ;
> >       sh:sparql [
> >         sh:select
> >           """SELECT $this WHERE {
> >             $this s:shape ?shape ;
> >             BIND (sh:hasShape($this,?shape,$shapesGraph) AS ?hasShape)
> >             BIND (!bound(?hasShape) AS ?failure )
> >             FILTER (?failure || ?hasShape) }""" ] .
> >
> >
> >     Peter F. Patel-Schneider
> >     Nuance Communications
> >
> >
> >
> >
> > --
> > Dimitris Kontokostas
> > Department of Computer Science, University of Leipzig & DBpedia
> Association
> > Projects: http://dbpedia.org, http://rdfunit.aksw.org,
> http://aligned-project.eu
> > Homepage: http://aksw.org/DimitrisKontokostas
> > Research Group: AKSW/KILT http://aksw.org/Groups/KILT
> >
>
>


-- 
Dimitris Kontokostas
Department of Computer Science, University of Leipzig & DBpedia Association
Projects: http://dbpedia.org, http://rdfunit.aksw.org,
http://aligned-project.eu
Homepage: http://aksw.org/DimitrisKontokostas
Research Group: AKSW/KILT http://aksw.org/Groups/KILT

Received on Monday, 21 November 2016 10:11:34 UTC