rdf-turtle/turtle.bnf
author Ivan Herman <ivan@ivan-herman.net>
Mon, 22 Jun 2015 11:29:34 +0200
changeset 2043 6149460bff0e
parent 660 c848b6870cee
permissions -rw-r--r--
Updated the n-triples and trig implementation reports
     1 [1] turtleDoc ::= statement* 
     2  
     3 [2] statement ::= directive 
     4  | triples "." 
     5 [3] directive ::= prefixID 
     6  | base | sparqlPrefix | sparqlBase
     7 [4] prefixID ::= '@prefix' PNAME_NS IRIREF "."
     8  
     9 [5] base ::= '@base' IRIREF "."
    10 
    11 [28*] sparqlPrefix ::= [Pp][Rr][Ee][Ff][Ii][Xx] PNAME_NS IRIREF
    12 [29*] sparqlBase ::= [Bb][Aa][Ss][Ee] IRIREF
    13  
    14 [6] triples ::= subject predicateObjectList |
    15 blankNodePropertyList predicateObjectList? 
    16  
    17 [7] predicateObjectList ::= verb objectList (';' (verb objectList)? )*
    18  
    19 [8] objectList ::= object ( "," object )* 
    20  
    21 [9] verb ::= predicate 
    22  | "a" 
    23 [10] subject ::= iri 
    24  | blank 
    25 [11] predicate ::= iri 
    26  
    27 [12] object ::= iri 
    28  | blank 
    29  | blankNodePropertyList
    30  | literal 
    31 [13] literal ::= RDFLiteral 
    32  | NumericLiteral 
    33  | BooleanLiteral 
    34 [14] blank ::= BlankNode 
    35  | collection 
    36 [15] blankNodePropertyList ::= "[" predicateObjectList "]" 
    37  
    38 [16] collection ::= "(" object* ")" 
    39 [17] NumericLiteral ::= INTEGER | DECIMAL | DOUBLE 
    40 
    41 [128s] RDFLiteral ::= String ( LANGTAG | ( "^^" iri ) )? 
    42  
    43 [133s] BooleanLiteral ::= "true" 
    44  | "false" 
    45 [18] String ::= STRING_LITERAL_QUOTE 
    46  | STRING_LITERAL_SINGLE_QUOTE 
    47  | STRING_LITERAL_LONG_SINGLE_QUOTE 
    48  | STRING_LITERAL_LONG_QUOTE 
    49 [135s] iri ::= IRIREF 
    50  | PrefixedName 
    51 [136s] PrefixedName ::= PNAME_LN 
    52  | PNAME_NS 
    53 [137s] BlankNode ::= BLANK_NODE_LABEL 
    54  | ANON 
    55 
    56 @terminals
    57 
    58 [19] IRIREF ::=  '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>'
    59  
    60 [139s] PNAME_NS ::= PN_PREFIX? ":" 
    61  
    62 [140s] PNAME_LN ::= PNAME_NS PN_LOCAL 
    63  
    64 [141s] BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
    65  
    66 [144s] LANGTAG ::= "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* 
    67 [20] INTEGER ::= [+-]? [0-9]+
    68  
    69 [21] DECIMAL ::= [+-]?  ( ([0-9])* '.' ([0-9])+  )
    70 [22] DOUBLE ::= [+-]? ( [0-9]+ '.' [0-9]* EXPONENT | '.' ([0-9])+ EXPONENT | ([0-9])+ 
    71 EXPONENT )
    72   
    73 [154s] EXPONENT ::= [eE] [+-]? [0-9]+ 
    74  
    75 [23] STRING_LITERAL_QUOTE ::= '"' ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* '"' 
    76  
    77 [24] STRING_LITERAL_SINGLE_QUOTE ::= "'" ( [^#x27#x5C#xA#xD] | ECHAR | UCHAR )* "'" 
    78  
    79 [25] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" ( ( "'" | "''" )? ( [^'\] | ECHAR | UCHAR ) )* "'''" 
    80  
    81 [26] STRING_LITERAL_LONG_QUOTE ::= '"""' ( ( '"' | '""' )? ( [^"\] | ECHAR | UCHAR ) )* '"""' 
    82  
    83 [27] UCHAR ::= ( "\u" HEX HEX HEX HEX ) 
    84  | ( "\U" HEX HEX HEX HEX HEX HEX HEX HEX ) 
    85 
    86 [159s] ECHAR ::= "\" [tbnrf\"'] 
    87  
    88 [160s] NIL ::= "(" WS* ")" 
    89  
    90 [161s] WS ::= #x20 | #x9 | #xD | #xA
    91 
    92 [162s] ANON ::= "[" WS* "]" 
    93  
    94 [163s] PN_CHARS_BASE ::= [A-Z] 
    95  | [a-z] 
    96  | [#00C0-#00D6] 
    97  | [#00D8-#00F6] 
    98  | [#00F8-#02FF] 
    99  | [#0370-#037D] 
   100  | [#037F-#1FFF] 
   101  | [#200C-#200D] 
   102  | [#2070-#218F] 
   103  | [#2C00-#2FEF] 
   104  | [#3001-#D7FF] 
   105  | [#F900-#FDCF] 
   106  | [#FDF0-#FFFD] 
   107  | [#10000-#EFFFF] 
   108 [164s] PN_CHARS_U  ::=  PN_CHARS_BASE 
   109  | '_' 
   110 [166s] PN_CHARS ::= PN_CHARS_U 
   111  | "-" 
   112  | [0-9] 
   113  | #00B7 
   114  | [#0300-#036F] 
   115  | [#203F-#2040] 
   116 [167s] PN_PREFIX ::= PN_CHARS_BASE ( ( PN_CHARS | "." )* PN_CHARS )? 
   117  
   118 [168s] PN_LOCAL ::= ( PN_CHARS_U | ':' | [0-9] | PLX ) ( ( PN_CHARS | '.' | ':' | PLX )*  ( PN_CHARS | ':' | PLX ) ) ?
   119 
   120 [169s] PLX ::= PERCENT | PN_LOCAL_ESC
   121 
   122 [170s] PERCENT ::= '%' HEX HEX
   123 
   124 [171s] HEX ::= [0-9] | [A-F] | [a-f]
   125 
   126 [172s] PN_LOCAL_ESC ::= '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' )