diff --git a/spec/index.html b/spec/index.html index fd81765..30c261b 100644 --- a/spec/index.html +++ b/spec/index.html @@ -86,7 +86,9 @@ subject or object of another triple, - making it possible to make statements about other statements.

+ making it possible to make statements about other statements. + RDF 1.2 N-Quads also adds support for + directional language-tagged strings.

@@ -243,6 +245,13 @@

RDF Literals

As in N-Triples, literals are used to identify values such as strings, numbers, dates.

+

Literals (Grammar production Literal) + have a lexical form followed by either a + language tag + (possibly including base direction), + a datatype IRI, + or neither.

+

The representation of the lexical form consists of an initial delimiter ", a sequence of permitted characters or numeric escape sequence or string escape sequence, @@ -260,11 +269,17 @@

RDF Literals

The corresponding lexical form is the characters between the delimiters, after processing any escape sequences. - If present, the language tag - is preceded by an @. + If present, the LANG_DIR + terminal matches the language tag + and optionally the base direction. + The language tag + is preceded by an @, + and, if present, the base direction + is separated from the language tag + by --. If there is no language tag, there may be a datatype IRI, preceded by ^^. - If there is no datatype IRI and no language tag + If there is no datatype IRI and no language tag, then it is a simple literal and the datatype is http://www.w3.org/2001/XMLSchema#string.

@@ -276,7 +291,7 @@

RDF Blank Nodes

As in N-Triples, RDF blank nodes are expressed as _: followed by a blank node label which is a series of name characters. - The characters in the label are built upon PN_CHARS_BASE, + The characters in the label are built upon PN_CHARS_BASE, liberalized as follows:

- A fresh RDF blank node is allocated for each unique blank node label in a document. - Repeated use of the same blank node label identifies the same RDF blank node. + A fresh RDF blank node is allocated for each unique blank node identifier in a document. + Repeated use of the same blank node identifier identifies the same blank node.

A Canonical form of N-Quads
       any of which MUST be a single space.
     
  • Literals with the datatype http://www.w3.org/2001/XMLSchema#string - MUST NOT use the datatype IRI part of the literal, + MUST NOT use the datatype IRI part of the literal, and are represented using only STRING_LITERAL_QUOTE.
  • HEX MUST use only digits @@ -394,7 +409,7 @@

    A Canonical form of N-Quads

    additional constraints of Canonical N-Quads.

    A conforming N-Quads parser is a system capable of - reading N-Quads documents on behalf of an application. + reading N-Quads documents on behalf of an application. It makes the serialized RDF dataset, as defined in , available to the application, usually through some form of API.

    @@ -430,8 +445,7 @@

    N-Quads Grammar

    White Space

    White space (spaces, and/or tabs) is allowed outside of terminals. - Rule names below in capitals indicate where white space is significant. -

    + Rule names in capitals below indicate where white space is significant.

    White space is significant in the production STRING_LITERAL_QUOTE.

    @@ -617,6 +631,8 @@

    Selected Terminal Literal Strings

    two concatenated circumflex accent characters, each having the code point U+005E
    _:
    _ followed by :
    +
    --
    +
    two concatenated - characters
  • @@ -649,7 +665,7 @@

    RDF Term Constructors

    The string after _:, is a key in bnodeLabels. - If there is no corresponding blank node in the map, + If there is no corresponding blank node in the map, one is allocated. @@ -661,20 +677,25 @@

    RDF Term Constructors

    IRI - The characters between "<" and ">" are taken, + The characters between < + and > are taken, with escape sequences unescaped, to form the IRI. - + - LANGTAG + LANG_DIR language tag - The characters following the @ form the language tag. + The characters following the @ + form the language tag + and optionally the base direction, + if the matched characters include + --. @@ -699,13 +720,21 @@

    RDF Term Constructors

    The literal has a lexical form of the first rule argument, STRING_LITERAL_QUOTE, - and either a language tag of LANGTAG - or a datatype IRI of iri, + and either a language tag + with optional base direction + from LANG_DIR + or a datatype IRI of iri, depending on which rule matched the input. - If the LANGTAG rule matched, - the datatype is rdf:langString - and the language tag is LANGTAG. - If neither a language tag nor a datatype IRI is provided, + If the LANG_DIR rule matched, + the language tag + and base direction + are taken from LANG_DIR. + If there is no base direction, + the datatype is rdf:langString. + If there is a base direction, + the datatype is rdf:dirLangString. + If neither LANG_DIR + nor datatype IRI match, the literal has a datatype of xsd:string. @@ -736,8 +765,8 @@

    RDF Dataset Construction

    The statement production produces a triple defined by the terms constructed for subject, - a href="#grammar-production-predicate">predicate, and - object>. + predicate, and + object. This RDF triple is added to the graph labeled by the production graphLabel, if no graphLabel is present the triple is added to the RDF dataset's default graph.

    @@ -927,17 +956,20 @@

    Changes between RDF 1.1 and RDF 1.2

    for White space and Comments, better mirroring [[RDF12-TURTLE]]. -
  • Updated the PN_CHARS_U +
  • Updated the PN_CHARS_U grammar production to be consistent with Turtle. - Formerly, PN_CHARS_U + Formerly, PN_CHARS_U included "`:`" in N-Triples and N-Quads, but not in Turtle nor TriG. - PN_CHARS_U is a component - of BLANK_NODE_LABEL.
  • -
  • Adds support for quoted triples + PN_CHARS_U is a component + of BLANK_NODE_LABEL.
  • +
  • Adds support for quoted triples as described in with updates to .
  • Separated from and updated language.
  • +
  • Changes the `LANGTAG` terminal production to + LANG_DIR to include + an optional base direction.
  • diff --git a/spec/nquads-bnf.html b/spec/nquads-bnf.html index f745722..c16ae6f 100644 --- a/spec/nquads-bnf.html +++ b/spec/nquads-bnf.html @@ -41,7 +41,7 @@ [7] literal ::= - STRING_LITERAL_QUOTE (('^^' IRIREF) | LANGTAG)? + STRING_LITERAL_QUOTE (('^^' IRIREF) | LANG_DIR)? [8] @@ -66,11 +66,11 @@

    Productions for terminals

    ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)? - + [12] - LANGTAG + LANG_DIR ::= - '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* + '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* ('--' [a-zA-Z]+)? [13] diff --git a/spec/nquads.bnf b/spec/nquads.bnf index f5cadd0..ccc2e38 100644 --- a/spec/nquads.bnf +++ b/spec/nquads.bnf @@ -4,14 +4,14 @@ subject ::= IRIREF | BLANK_NODE_LABEL | quotedTriple predicate ::= IRIREF object ::= IRIREF | BLANK_NODE_LABEL | literal | quotedTriple graphLabel ::= IRIREF | BLANK_NODE_LABEL -literal ::= STRING_LITERAL_QUOTE ('^^' IRIREF | LANGTAG )? +literal ::= STRING_LITERAL_QUOTE ('^^' IRIREF | LANG_DIR )? quotedTriple ::= '<<' subject predicate object '>>' @terminals IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>' BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)? -LANGTAG ::= '@' [a-zA-Z]+ ( '-' [a-zA-Z0-9]+ )* +LANG_DIR ::= '@' [a-zA-Z]+ ( '-' [a-zA-Z0-9]+ )* ( '--' [a-zA-Z]+ )? STRING_LITERAL_QUOTE ::= '"' ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* '"' UCHAR ::= ( '\u' HEX HEX HEX HEX ) | ( '\U' HEX HEX HEX HEX HEX HEX HEX HEX )