Re: N-Quads: Section 2.2 - IRIs vs. Section 4 - Grammar

> On Apr 14, 2023, at 6:16 AM, Dolezal, Vojtech <dolezvo1@fit.cvut.cz> wrote:
> 
> Good afternoon,
> 
> I'm sorry if this question has an obvious answer, but I noticed that Section 2.2 of the N-Quads specification says "IRIs may be written only as absolute IRIs.". On the other hand, however, the grammar specifies the IRIREF as IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>', which seems to imply both '<>' and '<notAnIRI>' are valid IRIREFs.

The IRIREF grammar production is intended to be a quick and easy way to parse IRIs. The normative requirement is RFC3987,  which is described in RDF Concepts [1]. IRIs are defined using an ABNF grammar which is different than the EBNF used to define the N-Quads grammar. To be fully conformant, an N-Quads parser having extracted an IRIREF token must further match that against the ABNF grammar from RFC3987.

Note that similarly, language tags used in language-tagged string literals have a simple EBNF production, but never the less need to be well formed accoring to BCP47.

Gregg

[1] https://www.w3.org/TR/rdf11-concepts/#section-IRIs

> My question, therefore, is, which of these statements is correct, and if it is, like I suspect, the first one, would it be possible to modify the grammar to reflect this?
> 
> Best regards,
> 
> Vojtěch Doležal

Received on Friday, 14 April 2023 16:30:23 UTC