Re: Signs '!' and '^' and the problem with open/closed types

On Apr 25, 2014 3:25 PM, "Daniel Fernández Álvarez" <
danifdezalvarez@gmail.com> wrote:
>
> Hello everyone
>
>
>
> I am Daniel Fernández, from the University of Oviedo. I am trying to
produce an implementation of ShEx in python, but I have some specific
doubts about the syntax. Precisely, I have doubts with the use and meaning
of the signs ‘!’ and ‘^’.

To calibrate you as to the maturity of ‘!’ and ‘^’,I added them to the
grammar in response to LDP use cases like "an IssueReport must linked from
some IssueList" and "you can attach arbitrary triples but we reserve
dc:creator", but I've never implemented them. The arcs-out bias of shape
expressions reflects a similar bias in RDF (possibly the result of literals
only appearing in the object position, but probably more the result of
F-logical human brains). They mostly serve to reserve the tokens for future
use and stimulate discussion.

> I have been checking two formal definitions of ShEx, both made by Eric,
and I have found that these signs do not appear in the definition
http://www.w3.org/2013/ShEx/Definition.html, but they do appear in
http://www.w3.org/2013/ShEx/ShEx.bnf, so I am not sure if they are going to
be part of the final syntax. Anyway, I will ask my questions assuming that
they can be used.
>
>
> I understand that ‘!’ is used for negation and ‘^’ for entering
relations. i.e.:
>
>
> <A>{
>
> ! :a xsd:string,
>
> ^ :b <A>
>
> }
>
>
> That would mean that a node is of type <A> if it does not have an edge
labelled with “a” pointing to a string and if it does have another node of
type <A> pointing to it.
>
> The main problem with these signs belongs to a wider discussion that Sam,
Slawek and Iovka introduced: open types and closed types. I think “!” only
makes sense in definitions of open types and ‘^’ introduces a problem of
meaning if we use it in closed types. I will use the syntax that Sam,
Slawek and Iovka suggested in their mail to distinguish the open types from
the closed ones: ‘..’ at the end of the definition if the type is open.
>
>
> <C>{
>
> ! :a xsd:string
>
> }
>
>
> <D>{
>
> ! :a xsd:string
>
> …
>
> }
>
>
> Using ‘! :a xsd:string’ in the definition of the type <C> does not
provide any meaning. C is closed, so, by definition, nodes with more
relations of the ones defined in <C> would not match <C>, so there is no
need to negate some specific relations, because they are already excluded.
>
>
> However, in <D>, ‘! :a xsd:string’ does provide useful meaning. Nodes
that match with <D> are every nodes of the graph but those that have at
least one “a” edge pointing to a string.
>
>
> On the other hand, If we use “^” in closed types, I think we introduce a
bigger problem than thinking if it is useful or not. At least for me, the
meaning of using it is not clear. i.e.:
>
>
> <E>{
>
> ^ :a <A>
>
> }
>
>
> <F>{
>
> ^ :a <A>
>
> ..
>
> }

I think you mean ^ :a @<A>

> To consider a node of type <E>, it looks clear that it must have another
node of type <A> pointing to it… but what does ‘^ :a <A>’ say about the
rest of entering relations? If we define closed types as types that only
accept relations that are specified in their definition, and no more than
these relations, then we could interpret that  <E> can only be pointed by
an <A> with an “a”. No more relations would be allowed.
>
>
> We could even think that a type such as <C>, that does not have any rule
referring to entering edges, would not match with any node with an entering
edge. It looks that several possibilities are available:
>
> -          To consider closed types “not so close” according to the use
of ‘^’. To allow any entering relations, meanwhile the specified ones exist.
>
> -          Assuming that if we don’t have entering rules, then the type
does not specify any restriction over entering relations. But, if we have
at least a sign ‘^’ in the definition of the type, then only the specified
entering relations are allowed, and not any other apart from them.
>
> -          To consider closed types as closed with entering relations as
they are with outgoing ones. I mean, if no “^” is used, then there can’t be
any edge pointing to the node.
>
> I think all the options have pros and cons… and it would be worthy to
discuss them.
>
>
> It looks like we do not have this problem with open types. <F> would
match with any node that is pointed by an <A> with an “a”, not mattering
the rest of the relations (entering or not).
>
>
> Apart from that, I have noticed that in the grammar
http://www.w3.org/2013/ShEx/ShEx.bnf, where the signs ‘!’ and ‘^’ do
appear, they are placed in the rule “arc”. I think that it would mean that
syntax does not allow ‘!’ and ‘^’ over blocks of rules. i.e:
>
>
> <G> {
>
> ! :a xsd:string
>
> ..
>
> }
>
>
> <H>{
>
> ! (:a xsd:string,
>
> :b xsd:string)
>
> ..
>
> }
>
>
> <G> would be a valid definition but <H> would not. Am I correct in this?
And, if I am, is it a final decision?

Not final at all. I very much appreciate your analysis. When I have a
moment, I would like to go to another an approach to describing open/closed
types. In this approach, don't specifically open; instead you get a report
back with the remaining arcs. I know that this does not respond the limited
arcs in scenario, but that may be a reality of the semantic web.

> Best regards,
>
>
>
> Daniel Fernández
>
>

Received on Wednesday, 30 April 2014 08:53:19 UTC