Re: Production rules for satisfying the "prefix_only_IRI" turtle parser test

On Nov 19, 2015, at 2:59 PM, Rob Stewart <robstewart57@gmail.com> wrote:
> 
> My question is about how this conforms to the turtle grammar rules at http://www.w3.org/TR/turtle/#sec-grammar-grammar . The relevant production rules are:
> 
> [139s] PNAME_NS::= PN_PREFIX? ':'
> [140s] PNAME_LN::= PNAME_NS PN_LOCAL
> [168s] PN_LOCAL::= (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))?
> 
> The "p:" satisfies PNAME_NS, so now to satisfy PN_LOCAL in order to satisfy PNAME_LN. In the "prefix_only_IRI" test case, what follows the ":" is an empty string. I don't see how an empty string can be satisfied by PN_LOCAL, given the first component of PN_LOCAL is:
> 
> (PN_CHARS_U | ':' | [0-9] | PLX)
> 
> So, how does the "prefix_only_IRI" turtle parsing test conform to the grammar rules for turtle syntax?

You’re looking too deep in the grammar.

[136s] PrefixedName ::= PNAME_LN | PNAME_NS

In this case, the subject prefixed name of the triple is matching PNAME_NS, not PNAME_LN.

.greg

Received on Thursday, 19 November 2015 23:08:12 UTC