[shex] Round tripping node constraints between ShExJ and ShExC (#106)

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

== Round tripping node constraints between ShExJ and ShExC ==
The following ShExC fails in the grammar:

```Turtle
prefix : <http://example.org>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

:S Literal xsd:string
```

while the equivalent ShExJ seems to be ok: 

```JSON
{
  "@context": "http://www.w3.org/ns/shex.jsonld",
  "type": "Schema",
  "shapes": [
    {
      "type": "NodeConstraint",
      "id": "http://example.org/S",
      "nodeKind": "literal",
      "datatype": "http://www.w3.org/2001/XMLSchema#string"
    }
  ]
}
``` 

ShEx-simple allows to convert from the latter to the former, but not in the other direction.

The ShExC grammar has this rule which allows only one component of a node constraint:

```EBNF
[22]    nodeConstraint        ::= "LITERAL" xsFacet*
                                | nonLiteralKind stringFacet*
                                | datatype xsFacet*
                                | valueSet xsFacet*
                                | xsFacet+
```

I think there are 3 possibilities:

- Change the grammar to allow more components of node constraints 
- Forbid several components of node constraints in the ShExJ.
- Leave it as is, which would limit round tripping between ShExJ and ShExC for this case


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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 16 September 2020 07:25:41 UTC