W3C home > Mailing lists > Public > public-shex-dev@w3.org > October 2017

[shex] Round tripping language tags case

From: Eric Prud'hommeaux via GitHub <sysbot+gh@w3.org>
Date: Sat, 07 Oct 2017 11:48:02 +0000
To: public-shex-dev@w3.org
Message-ID: <issues.opened-263636201-1507376868-sysbot+gh@w3.org>
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.

  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

This archive was generated by hypermail 2.3.1 : Tuesday, 4 June 2019 11:00:16 UTC