shexSpec / shex

ShEx language issues, including new features for e.g. ShEx2.1
24 stars 8 forks source link

Trailing dots in prefixed names #72

Closed labra closed 6 years ago

labra commented 6 years ago

At this moment, ShEx grammar doesn't allow a trailing dot in prefixed names following SPARQL and Turtle grammar.

This limitation may make sense for SPARQL but it seems too restrictive for ShEx, specially in value sets.

An example which doesn't work in ShEx is:

PREFIX :       <http://example.org/>
PREFIX codes: <http://example.codes/>

:Product {
  :status [ codes:good.~ codes:bad.~ ]
}

The problem is that codes:good. doesn't conform to the PNAME_LN rule in the grammar as the PN_LOCAL rule doesn't allow a trailing dot.

It seems that changing the rule for PN_LOCAL to be:

<PN_LOCAL> ::= (PN_CHARS_U | ":" | [0-9] | PLX) (PN_CHARS | "." | ":" | PLX))?

solves the problem. However, it is not clear if allowing the trailing dots in local names will introduce some future incompatibility with further uses of the dot keyword or with implementations that use SPARQL.

ericprud commented 6 years ago

I tested this in my impl and it passed all of our current tests.

jimkont commented 6 years ago

Closed in 2017-10-10 meeting with the following resolution

PROPOSAL: Allow Trailing dots in prefixed names by changing the rule for PN_LOCAL to be: <PN_LOCAL> ::= (PN_CHARS_U | ":" | [0-9] | PLX) (PN_CHARS | "." | ":" | PLX))?

RESOLVED