W3C home > Mailing lists > Public > public-rdf-shapes@w3.org > November 2016

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

From: Irene Polikoff <irene@topquadrant.com>
Date: Mon, 21 Nov 2016 20:47:47 -0500
Message-ID: <CACU-zeLhzOq4kWhq7Fn7qGe5+8G6HZYNnHAbwXnY=jpayGqB8Q@mail.gmail.com>
To: "Peter F. Patel-Schneider" <pfpschneider@gmail.com>
Cc: Dimitris Kontokostas <kontokostas@informatik.uni-leipzig.de>, "public-rdf-shapes@w3.org" <public-rdf-shapes@w3.org>
Possibly a misinformed question, but is "being recursive" an intrinsic
quality of the shape or is it an interplay between a shape and a data graph?

Another words, with some data, the shape below is not going to be
recursive, but with other data, it is?

ex:sr rdf:type sh:Shape ;
  sh:class ex:c ;
  sh:property [ rdf:type sh:ProperyConstraint;
                sh:predicate ex:p ; sh:shape ex:sr ] .

In general, recursive shape is such that validating data against it
requires repeated passes. There is more than one way as to how this could
happen. I am not convinced they all should or could be listed. Instead, it
may be enough to give the general definition of what the recursion means,
acknowledge that there are multiple ways for this to happen and give one or
two examples.

On Tue, Sep 27, 2016 at 7:51 AM, 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
> >
>
>
Received on Tuesday, 22 November 2016 01:48:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:02:46 UTC