Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round tripping node constraints between ShExJ and ShExC #106

Open
labra opened this issue Sep 16, 2020 · 1 comment
Open

Round tripping node constraints between ShExJ and ShExC #106

labra opened this issue Sep 16, 2020 · 1 comment

Comments

@labra
Copy link
Contributor

labra commented Sep 16, 2020

The following ShExC fails in the grammar:

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

:S Literal xsd:string

while the equivalent ShExJ seems to be ok:

{
  "@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:

[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
@ericprud
Copy link
Contributor

This points to a suspicious hole in the schema tests. I.e. we should have seen this before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants