[shex] Round tripping language tags case

ericprud has just created a new issue for https://github.com/shexSpec/shex:

== Round tripping language tags case ==
Related: #72 

Apart from values set values with language tags, ShExC, ShExJ and ShExR can be exactly round tripped, c.f. [schema tests](https://github.com/shexSpec/shexTest/blob/master/schemas/manifest.ttl). Because language-tagged literals are expressed as JSON-LD object literals and RDF parsers are not responsible for preserving upper/lower case in literal language tags, a ShExC schema:
```
<vs1> ["flat"@en-GB]
```
would be be translated to ShExR:
```
[] a sx:Schema ; sx:shapes <http://a.example/vs1> .
<http://a.example/vs1> a sx:NodeConstraint ;
  sx:values ( "flat"@en-GB ) .
```
An RDF parser is allowed to parse that as `en-gb` so it would [round-trip to ShExC](http://rawgit.com/shexSpec/shex.js/LanguageTag-schema-case/doc/shex-simple.html?schema=PREFIX%20ex%3A%20%3Chttp%3A%2F%2Fa.example%3E%0APREFIX%20sx%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2Fns%2Fshex%23%3E%0APREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0A%0A%5B%5D%20a%20sx%3ASchema%20%3B%20sx%3Ashapes%20%3Chttp%3A%2F%2Fa.example%2Fvs1%3E%20.%0A%3Chttp%3A%2F%2Fa.example%2Fvs1%3E%20a%20sx%3ANodeConstraint%20%3B%0A%20%20sx%3Avalues%20(%20%22flat%22%40en-GB%20)%20.%0A&data=&shape-map=&interface=human&regexpEngine=threaded-val-nerr):
```
<vs1> ["flat"@en-gb]
```
This doesn't affect semantics of validation but it can be a pain for folks who like to follow ISO language code rules where regions should be upper case, i.e. `en-GB`. (This has little impact as no one uses ShExR anyways.) Round-tripping between ShExC and ShExJ (as JSON) is unaffected by this.

PROPOSE:
  1. add a note in the spec documenting this as a round-tripping deficiency and stating that if this is a problem for users, future versions of ShExJ will not use JSON-LD object literals for value set values.
  2. adopt https://github.com/shexSpec/shexTest/pull/25 which has additional schemas which differ only in language tag case.


Please view or discuss this issue at https://github.com/shexSpec/shex/issues/73 using your GitHub account

Received on Saturday, 7 October 2017 11:47:54 UTC