turtleDoc           ::= ws* (statement ws*)*
statement           ::= directive ws* '.'
                      | triples ws* '.'
directive           ::= prefixID | base
prefixID            ::= '@prefix' ws+ (prefixName ws*)? ':' ws* uriref
base                ::= '@base' ws+ uriref
triples             ::= subject ws* predicateObjectList
predicateObjectList ::= verb ws* objectList ( ws* ';' ws* verb ws* objectList )* (ws* ';')?
objectList          ::= object (ws* ',' ws* object)*
verb                ::= predicate | 'a'
subject             ::= resource | blank
predicate           ::= resource
object              ::= resource | blank | literal
literal             ::= quotedString ( '@' language )? | datatypeString | integer | double | decimal | boolean
datatypeString      ::= quotedString '^^' resource
integer             ::= ('-' | '+') ? [0-9]+
double              ::= ('-' | '+') ? ( [0-9]+ '.' [0-9]* exponent | '.' ([0-9])+ exponent | ([0-9])+ exponent )
decimal             ::= ('-' | '+')? ( [0-9]+ '.' [0-9]* | '.' ([0-9])+ | ([0-9])+ )
exponent            ::= [eE] ('-' | '+')? [0-9]+
boolean             ::= 'true' | 'false'
blank               ::= nodeID | '[]' | '[' ws* predicateObjectList ws* ']' | collection
itemList            ::= object (ws* object)*
collection          ::= '(' ws* itemList? ws* ')'
resource            ::= uriref | qname
nodeID              ::= '_:' name
qname               ::= prefixName? ':' name?
uriref              ::= '<' relativeURI '>'
language            ::= [a-z]+ ('-' [a-z0-9]+ )*
nameStartChar       ::= [A-Z] | "_" | [a-z]
                      | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF]
                      | [#x0370-#x037D] | [#x037F-#x1FFF]
                      | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF]
                      | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD]
                      | [#x10000-#xEFFFF]
nameChar            ::= nameStartChar | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]
name                ::= nameStartChar nameChar*
prefixName          ::= ( nameStartChar - '_' ) nameChar*
relativeURI         ::= ucharacter*
quotedString        ::= string | longString
string              ::= #x22 scharacter* #x22
longString          ::= #x22 #x22 #x22 lcharacter* #x22 #x22 #x22
character           ::= '\u' hex hex hex hex
                      | '\U' hex hex hex hex hex hex hex hex
                      | '\\'
                      | [#x20-#x5B] | [#x5D-#x10FFFF]
echaracter          ::= character | '\t' | '\n' | '\r'
hex                 ::= [#x30-#x39] | [#x41-#x46]
ucharacter          ::= ( character - #x3E ) | '\>'
scharacter          ::= ( echaracter - #x22 ) | '\"'
lcharacter          ::= echaracter | '\"' | #x9 | #xA | #xD
ws                  ::= #x9 | #xA | #xD | #x20 | comment
comment             ::= '#' ( [^#xA#xD] )*
