Re: SHACL Compact Syntax, was Re: Fwd: Transition Request: 3 FPWGNOTE documents

With respect to having syntax be the same where the semantics are the same, let’s take a look at the few basic examples:

:User IRI {
 schema:name xsd:string
}

This would be valid in ShEx and in SHACL compact syntax. The same syntax - different semantics. Semantics are different because default cardinalities are different. If you don’t say anything in ShEx, it means exactly 1. If you don’t say anything in SHACL, it means min 0, max unbounded.

Obviously, there is nothing that could be done at the compact syntax level other than may be require that in the SHACL compact syntax one always has to be explicit about cardinalities and that would be silly (I think) - a compact syntax that requires more verbosity. 

Another example:

:Employee {
 ex:worksFor ex:Person;
 ex:worksFor ex:Organization;
}

Besides the cardinality differences, we now have differences in conjunction and disjunction. In SHACL the above means that worksFor must be a person and an organization. In ShEx it means either one.

So, we clearly have very fundamental cases where the same syntax means different things semantically. And this is down to the fundamental differences in the semantics of the two languages. Each syntax reflects the semantic of the language it is a syntax for.

Do we have the reverse situation - where the same semantics can never be expressed in the same syntax? I suspect so, although I don’t have readily available examples besides cardinality. SHACL uses [] brackets to specify cardinality explicitly. This could be better alligned with ShEx, but in the bigger scheme of things I am not sure how much difference it would make.

Holger may be able to give additional examples.

It sounds like Sandro is hoping that there would be a way to write a shape in a compact syntax that would be interpreted the same way by ShEx engines and by SHACL engines. I don’t believe this would be possible in a general sense or even for a significantly meaningful subset of the languages. There are too many differences - some small, some bigger, but they all matter and they add up. At most, this goal may be achievable for a very small constrained set of each language and I am not sure anyone would find it sufficiently useful.

With this, I believe that making some change that makes it very clear that something is a SHACL shape and not a ShEx shape is the only way forward. There are already a number of differences that make syntaxes disjoint (targets, the way ‘closed’ is specified, the way ignored properties are specified, the IMPORT keyword, etc). However, there could be viable shapes that don’t use any of these. So, I think the difference would have to be something that is very basic i.e., something that is always used. For example, don’t use ‘{‘ brackets for SHACL.

Irene


> On May 24, 2017, at 2:17 PM, Sandro Hawke <sandro@w3.org> wrote:
> 
> Tom's email, to which Irene is replying, was send to a W3C Member Confidential mailing list (chairs@w3.org <mailto:chairs@w3.org>).  She accidentally included it in her reply, perhaps not knowing the list's confidentiality (which is not obvious).   Here's my to reply to that list, which bears on this this group:
> 
>> My sincere apologies, Tom.  You mentioned this concern to me earlier, and then I completely forgot about it in the flurry of documents.  That was a serious error on my part. 
>> 
>> I agree, it's a very bad architectural practice to design languages such that a non-trivial document could be syntactically valid in multiple languages while having different semantics.   We pretty much only see this in a few notoriously bad situations, like "1/2/2017" being either 2017-01-02 or 2017-02-01, depending on the locale. 
>> 
>> I suggest the Data Shapes Working Group withdraw its decision to publish this (or the Director not approve it), and instead delegate to an expected new SHACL CG to figure out a way to make the syntax disjoint from ShExC in at least the cases where the semantics are distinct, [then] publish it as a CG Report, much like ShExC, instead of a WG Note (since the WG will presumably have expired by then). 
> 
> Does that sound like a reasonably path forward?
> 
> I guess another option would be to make a trivial change to the syntax (before next week) to make it disjoint, but I believe the community would be far better served by having the syntax be the same in places where the semantics are the same.  If that's possible, it seems worthwhile to take the time in a CG to figure that out in concert with ShEx folks.
>  
> Thoughts?
> 
>       -- Sandro
> 
> 
> On 05/24/2017 11:57 AM, Irene Polikoff wrote:
>> I really do not think ShEx has a “copywrite" on an idea of a compact syntax. Its syntax itself was itself influenced by many different syntaxes/previous works, I am sure.
>> 
>> Further, the syntaxes are not identical. They are similar. For example, SHACL has target declarations and it is supported in the syntax. The way cardinalities are expressed is different. 
>> 
>> I guess one option would be to modify the syntax to be even less similar. But I can’t think what could be done to make it significantly more different - because the information it is trying to express is very similar and it is expressed in an obvious way as a “property”, then a list of constraints for the values such as the data type, cardinality, etc. There is nothing novel or special in this format.
>> 
>> I suppose one could change delimiters. However, many delimiters are quite standard and making them into something else would be very peculiar e.g., the use of ‘|” for ‘or’; the use of “;”  as a separator. These are used by many-many languages. With this, I am not sure what changes would be sufficient to ensure that SHACL and ShEx compact syntax can’t be confused. Should SHACL WG members object to the ShEx CG use of the words ‘shape’, ‘node shape’, etc.? Because this will be confusing to potential users - when they hear or see shape, they wouldn’t know which one.
>> 
>> Overall, this sounds like an attempt to prevent SHACL from having a compact syntax so that for those who want a compact syntax, ShEx will be an only option. This is not good for the community and, to me, sounds like a desire to block progress and deprive users of SHACL of features. No one should have a right to do this, especially not on the open web.
>> 
>> 
>>> Begin forwarded message:
>>> 
>>> From: Tom Baker <tom@tombaker.org <mailto:tom@tombaker.org>>
>>> Subject: Re: Transition Request: 3 FPWGNOTE documents
>>> Date: May 24, 2017 at 11:05:47 AM EDT
> ...

Received on Wednesday, 24 May 2017 21:16:34 UTC