Re: shapes-ISSUE-23 (punning): Shapes, classes and punning [SHACL Spec]

Hi Peter,

> On 3 Apr 2015, at 15:05, Peter F. Patel-Schneider <pfpschneider@gmail.com> wrote:
> 
> I think that the idea for punning in SHACL is to allow for RDF nodes that
> denote both a shape and a class while still keeping these two identities
> apart.   In this way stating that the type of an individual is a class&shape
> would not trigger any shape-based stuff, because typing would be on the
> class identity, not the shape identity.

That’s not quite the behaviour that I’m after. (Which, thinking more about it, may mean that it’s not as similar to OWL 2 punning as I thought.)

A statement of form

    :MyInstance rdf:type :MyClassAndShape

should still mean that validate(:MyInstance) checks any constraints attached to :MyClassAndShape.

Here’s a scenario that uses an approach where classes and shapes are distinct:

    # Data
    :MyInstance rdf:type :MyClass.

    # Constraint graph
    :MyClass rdfs:label “My Class”@en.
    :MyClass sh:classShape :MyShape.
    :MyShape sh:constraint [ … ].

In the case where :MyClass and :MyShape are defined by the same party (e.g., for closed-world in-house use cases, or for things like R2RML and the Data Cube Vocabulary), I think it is wasteful and confusing having to define two separate nodes here, :MyClass and :MyShape. So I want to say simply:

    # Data
    :MyInstance rdf:type :MyClassAndShape.

    # Constraint graph
    :MyClassAndShape rdfs:label “My Class (and Shape)”@en.
    :MyClassAndShape sh:constraint [ … ].

And this should have the same effect. So, compared to the previous approach, here we have merged two nodes into one, and eliminated the arc connecting them, because in my use case there is no value in keeping the two nodes separate.

This is what I mean when I (mis-?)use the word “punning”: I want to be able to merge two RDF nodes and eliminate the arc between them, while still having exactly the same behaviour.

Best,
Richard

Received on Friday, 3 April 2015 15:40:28 UTC