diff --git a/src/main/resources/correct-rdf-turtle-11-ebfn-spec.txt b/src/main/resources/correct-rdf-turtle-11-ebfn-spec.txt new file mode 100644 index 0000000..7139919 --- /dev/null +++ b/src/main/resources/correct-rdf-turtle-11-ebfn-spec.txt @@ -0,0 +1,56 @@ +turtleDoc ::= statement* +statement ::= directive | triples '.' +directive ::= prefixID | base | sparqlPrefix | sparqlBase +prefixID ::= '@prefix' PNAME_NS IRIREF '.' +base ::= '@base' IRIREF '.' +sparqlBase ::= 'BASE' IRIREF +sparqlPrefix ::= 'PREFIX' PNAME_NS IRIREF +triples ::= subject predicateObjectList | blankNodePropertyList predicateObjectList? +predicateObjectList ::= verb objectList (';' (verb objectList)?)* +objectList ::= object (',' object)* +verb ::= predicate | 'a' +subject ::= iri | BlankNode | collection +predicate ::= iri +object ::= iri | BlankNode | collection | blankNodePropertyList | literal +literal ::= RDFLiteral | NumericLiteral | BooleanLiteral +blankNodePropertyList ::= '[' predicateObjectList ']' +collection ::= '(' object* ')' +NumericLiteral ::= INTEGER | DECIMAL | DOUBLE +RDFLiteral ::= String (LANGTAG | '^^' iri)? +BooleanLiteral ::= 'true' | 'false' +String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE +iri ::= IRIREF | PrefixedName +PrefixedName ::= PNAME_LN | PNAME_NS +BlankNode ::= BLANK_NODE_LABEL | ANON +IRIREF ::= '<' (#'[^\u0000-\u0020<>\"{}|^`\\]' | UCHAR)* '>' +PNAME_NS ::= PN_PREFIX? ':' +PNAME_LN ::= PNAME_NS PN_LOCAL +BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | #'[0-9]') ((PN_CHARS | '.')* PN_CHARS)? +LANGTAG ::= '@' #'[a-zA-Z]'+ ('-' #'[a-zA-Z0-9]'+)* +INTEGER ::= #'[+-]'? #'[0-9]'+ +DECIMAL ::= #'[+-]'? #'[0-9]'* '.' #'[0-9]'+ +DOUBLE ::= #'[+-]'? (#'[0-9]'+ '.' #'[0-9]'* EXPONENT | '.' #'[0-9]'+ EXPONENT | #'[0-9]'+ EXPONENT) +EXPONENT ::= #'[eE]' #'[+-]'? #'[0-9]'+ +STRING_LITERAL_QUOTE ::= '"' (#'[^\u0022\u005C\u000A\u000D]' | ECHAR | UCHAR)* '"' +STRING_LITERAL_SINGLE_QUOTE ::= "\'" (#'[^\u0027\u005C\u000A\u000D]' | ECHAR | UCHAR)* "\'" +STRING_LITERAL_LONG_SINGLE_QUOTE ::= "\'\'\'" (("\'" | "\'\'")? (#'[^\'\\]' | ECHAR | UCHAR))* "\'\'\'" +STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? (#'[^\"\\]' | ECHAR | UCHAR))* '"""' +UCHAR ::= '\\u' HEX HEX HEX HEX | '\\U' HEX HEX HEX HEX HEX HEX HEX HEX +ECHAR ::= '\\u005C' #'[tbnrf"\'\\]' +WS ::= #'[\s]'+ | #'#.*' +ANON ::= '[' WS* ']' +PN_CHARS_BASE ::= #'[A-Z]' | #'[a-z]' | #'[\u00C0-\u00D6]' | + #'[\u00D8-\u00F6]' | #'[\u00F8-\u02FF]' | + #'[\u0370-\u037D]' | #'[\u037F-\u1FFF]' | + #'[\u200C-\u200D]' | #'[\u2070-\u218F]' | + #'[\u2C00-\u2FEF]' | #'[\u3001-\uD7FF]' | + #'[\uF900-\uFDCF]' | #'[\uFDF0-\uFFFD]' | + #'[\x{10000}-\x{EFFFF}]' +PN_CHARS_U ::= PN_CHARS_BASE | '_' +PN_CHARS ::= PN_CHARS_U | '-' | #'[0-9]' | '\\u00B7' | #'[\u0300-\u036F]' | #'[\u203F-\u2040]' +PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)? +PN_LOCAL ::= (PN_CHARS_U | ':' | #'[0-9]' | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? +PLX ::= PERCENT | PN_LOCAL_ESC +PERCENT ::= '%' HEX HEX +HEX ::= #'[0-9]' | #'[A-F]' | #'[a-f]' +PN_LOCAL_ESC ::= '\\u005C' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | '\\u0027' | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%') diff --git a/src/main/resources/echar.txt b/src/main/resources/echar.txt new file mode 100644 index 0000000..bed5773 --- /dev/null +++ b/src/main/resources/echar.txt @@ -0,0 +1 @@ +ECHAR ::= '\\u005C' #'[tbnrf"\'\\]' diff --git a/src/main/resources/example.ttl b/src/main/resources/example.ttl new file mode 100644 index 0000000..b8b1f84 --- /dev/null +++ b/src/main/resources/example.ttl @@ -0,0 +1,15 @@ +@base . +@prefix rdf: . +@prefix rdfs: . +@prefix foaf: . +@prefix rel: . + +<#green-goblin> + rel:enemyOf <#spiderman> ; + a foaf:Person ; # in the context of the Marvel universe + foaf:name "Green Goblin" . + +<#spiderman> + rel:enemyOf <#green-goblin> ; + a foaf:Person ; + foaf:name "Spiderman", "Человек-паук"@ru . diff --git a/src/main/resources/example0.ttl b/src/main/resources/example0.ttl new file mode 100644 index 0000000..bceb6d8 --- /dev/null +++ b/src/main/resources/example0.ttl @@ -0,0 +1,22 @@ +# A triple with all absolute IRIs + . + +@base . + . # relative IRIs, e.g. http://one.example/subject2 + +BASE + . # relative IRIs, e.g. http://one.example/subject2 + +@prefix p: . +p:subject3 p:predicate3 p:object3 . # prefixed name, e.g. http://two.example/subject3 + +PREFIX p: +p:subject3 p:predicate3 p:object3 . # prefixed name, e.g. http://two.example/subject3 + +@prefix p: . # prefix p: now stands for http://one.example/path/ +p:subject4 p:predicate4 p:object4 . # prefixed name, e.g. http://one.example/path/subject4 + +@prefix : . # empty prefix +:subject5 :predicate5 :object5 . # prefixed name, e.g. http://another.example/subject5 + +:subject6 a :subject7 . # same as :subject6 :subject7 . \ No newline at end of file diff --git a/src/main/resources/example1.ttl b/src/main/resources/example1.ttl new file mode 100644 index 0000000..c2a4884 --- /dev/null +++ b/src/main/resources/example1.ttl @@ -0,0 +1,10 @@ +@prefix rdf: . +@prefix dc: . +@prefix ex: . + + + dc:title "RDF/XML Syntax Specification (Revised)" ; + ex:editor [ + ex:fullname "Dave Beckett"; + ex:homePage + ] . diff --git a/src/main/resources/example10.ttl b/src/main/resources/example10.ttl new file mode 100644 index 0000000..1d9081d --- /dev/null +++ b/src/main/resources/example10.ttl @@ -0,0 +1,7 @@ +@prefix foaf: . + +[ foaf:name "Alice" ] foaf:knows [ + foaf:name "Bob" ; + foaf:knows [ + foaf:name "Eve" ] ; + foaf:mbox ] . \ No newline at end of file diff --git a/src/main/resources/example11.ttl b/src/main/resources/example11.ttl new file mode 100644 index 0000000..d94c0c1 --- /dev/null +++ b/src/main/resources/example11.ttl @@ -0,0 +1,6 @@ +_:a "Alice" . +_:a _:b . +_:b "Bob" . +_:b _:c . +_:c "Eve" . +_:b . \ No newline at end of file diff --git a/src/main/resources/example2-new.ttl b/src/main/resources/example2-new.ttl new file mode 100644 index 0000000..79ab3cb --- /dev/null +++ b/src/main/resources/example2-new.ttl @@ -0,0 +1,9 @@ +@prefix : . +@prefix rdf: . +:a :b + [ rdf:first "apple"; + rdf:rest [ rdf:first "banana"; + rdf:rest rdf:nil ] + ] . + + diff --git a/src/main/resources/example2.ttl b/src/main/resources/example2.ttl new file mode 100644 index 0000000..79ab3cb --- /dev/null +++ b/src/main/resources/example2.ttl @@ -0,0 +1,9 @@ +@prefix : . +@prefix rdf: . +:a :b + [ rdf:first "apple"; + rdf:rest [ rdf:first "banana"; + rdf:rest rdf:nil ] + ] . + + diff --git a/src/main/resources/example3-new.ttl b/src/main/resources/example3-new.ttl new file mode 100644 index 0000000..c208f93 --- /dev/null +++ b/src/main/resources/example3-new.ttl @@ -0,0 +1,9 @@ +@prefix : . + +:a :b "The first line\nThe second line\n more" . + +:a :b """The first line +The second line + more""" . + + diff --git a/src/main/resources/example3.ttl b/src/main/resources/example3.ttl new file mode 100644 index 0000000..c208f93 --- /dev/null +++ b/src/main/resources/example3.ttl @@ -0,0 +1,9 @@ +@prefix : . + +:a :b "The first line\nThe second line\n more" . + +:a :b """The first line +The second line + more""" . + + diff --git a/src/main/resources/example4.ttl b/src/main/resources/example4.ttl new file mode 100644 index 0000000..57709ad --- /dev/null +++ b/src/main/resources/example4.ttl @@ -0,0 +1,2 @@ +@prefix : . +(1 2.0 3E1) :p "w" . diff --git a/src/main/resources/example5.ttl b/src/main/resources/example5.ttl new file mode 100644 index 0000000..4af8085 --- /dev/null +++ b/src/main/resources/example5.ttl @@ -0,0 +1,2 @@ +PREFIX : +(1 [:p :q] ( 2 ) ) :p2 :q2 . diff --git a/src/main/resources/example6.ttl b/src/main/resources/example6.ttl new file mode 100644 index 0000000..0a9075c --- /dev/null +++ b/src/main/resources/example6.ttl @@ -0,0 +1,13 @@ +@prefix rdfs: . +@prefix show: . +@prefix xsd: . + +show:218 rdfs:label "That Seventies Show"^^xsd:string . # literal with XML Schema string datatype +show:218 rdfs:label "That Seventies Show"^^ . # same as above +show:218 rdfs:label "That Seventies Show" . # same again +show:218 show:localName "That Seventies Show"@en . # literal with a language tag +show:218 show:localName 'Cette Série des Années Soixante-dix'@fr . # literal delimited by single quote +show:218 show:localName "Cette Série des Années Septante"@fr-be . # literal with a region subtag +show:218 show:blurb '''This is a multi-line # literal with embedded new lines and quotes +literal with many quotes (""""") +and up to two sequential apostrophes ('').''' . \ No newline at end of file diff --git a/src/main/resources/example7.ttl b/src/main/resources/example7.ttl new file mode 100644 index 0000000..870b8ea --- /dev/null +++ b/src/main/resources/example7.ttl @@ -0,0 +1,5 @@ +@prefix : . + + :atomicNumber 2 ; # xsd:integer + :atomicMass 4.002602 ; # xsd:decimal + :specificGravity 1.663E-4 . # xsd:double \ No newline at end of file diff --git a/src/main/resources/example8.ttl b/src/main/resources/example8.ttl new file mode 100644 index 0000000..709eb28 --- /dev/null +++ b/src/main/resources/example8.ttl @@ -0,0 +1,3 @@ +@prefix : . + + :isLandlocked false . # xsd:boolean \ No newline at end of file diff --git a/src/main/resources/example9.ttl b/src/main/resources/example9.ttl new file mode 100644 index 0000000..9a6763f --- /dev/null +++ b/src/main/resources/example9.ttl @@ -0,0 +1,5 @@ +@prefix foaf: . + +_:alice foaf:knows _:bob . +_:bob foaf:knows _:alice . +[] foaf:knows [ foaf:name "Bob" ] . diff --git a/src/main/resources/old-rdf-file.txt b/src/main/resources/old-rdf-file.txt new file mode 100644 index 0000000..26070ae --- /dev/null +++ b/src/main/resources/old-rdf-file.txt @@ -0,0 +1,56 @@ +turtleDoc ::= statement* +statement ::= directive | triples '.' +directive ::= prefixID | base | sparqlPrefix | sparqlBase +prefixID ::= '@prefix' PNAME_NS IRIREF '.' +base ::= '@base' IRIREF '.' +sparqlBase ::= "BASE" IRIREF +sparqlPrefix ::= "PREFIX" PNAME_NS IRIREF +triples ::= subject predicateObjectList | blankNodePropertyList predicateObjectList? +predicateObjectList ::= verb objectList (';' (verb objectList)?)* +objectList ::= object (',' object)* +verb ::= predicate | 'a' +subject ::= iri | BlankNode | collection +predicate ::= iri +object ::= iri | BlankNode | collection | blankNodePropertyList | literal +literal ::= RDFLiteral | NumericLiteral | BooleanLiteral +blankNodePropertyList ::= '[' predicateObjectList ']' +collection ::= '(' object* ')' +NumericLiteral ::= INTEGER | DECIMAL | DOUBLE +RDFLiteral ::= String (LANGTAG | '^^' iri)? +BooleanLiteral ::= 'true' | 'false' +String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE +iri ::= IRIREF | PrefixedName +PrefixedName ::= PNAME_LN | PNAME_NS +BlankNode ::= BLANK_NODE_LABEL | ANON +IRIREF ::= '<' (#"[^\u0000-\u0020<>\"{}|^`\\]" | UCHAR)* '>' +PNAME_NS ::= PN_PREFIX? ':' +PNAME_LN ::= PNAME_NS PN_LOCAL +BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | #"[0-9]") ((PN_CHARS | '.')* PN_CHARS)? +LANGTAG ::= '@' #"[a-zA-Z]"+ ('-' #"[a-zA-Z0-9]"+)* +INTEGER ::= #"[+-]"? #"[0-9]"+ +DECIMAL ::= #"[+-]"? #"[0-9]"* '.' #"[0-9]"+ +DOUBLE ::= #"[+-]"? (#"[0-9]"+ '.' #"[0-9]"* EXPONENT | '.' #"[0-9]"+ EXPONENT | #"[0-9]"+ EXPONENT) +EXPONENT ::= #"[eE]" #"[+-]?" #"[0-9]"+ +STRING_LITERAL_QUOTE ::= '"' (#"[^\u0022\u005C\u000A\u000D]" | ECHAR | UCHAR)* '"' +STRING_LITERAL_SINGLE_QUOTE ::= "'" (#"[^\u0027\u005C\u000A\u000D]" | ECHAR | UCHAR)* "'" +STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" (("'" | "''")? (#"[^'\\]" | ECHAR | UCHAR))* "'''" +STRING_LITERAL_LONG_QUOTE ::= '\"\"\"' (('"' | '""')? ([^"\\] | ECHAR | UCHAR))* '\"\"\"' +UCHAR ::= "\u" HEX HEX HEX HEX | "\U" HEX HEX HEX HEX HEX HEX HEX HEX +ECHAR ::= "\\" #"[tbnrf\"\'\\]" +WS ::= \u0020 | \u0009 | \u000D | \u000A +ANON ::= "[" WS* "]" +PN_CHARS_BASE ::= #"[A-Z]" | #"[a-z]" | #"[\u00C0-\u00D6]" | + #"[\u00D8-\u00F6]" | #"[\u00F8-\u02FF]" | + #"[\u0370-\u037D]" | #"[\u037F-\u1FFF]" | + #"[\u200C-\u200D]" | #"[\u2070-\u218F]" | + #"[\u2C00-\u2FEF]" | #"[\u3001-\uD7FF]" | + #"[\uF900-\uFDCF]" | #"[\uFDF0-\uFFFD]" | + #"[\x{10000}-\x{EFFFF}]" +PN_CHARS_U ::= PN_CHARS_BASE | "_" +PN_CHARS ::= PN_CHARS_U | "-" | #"[0-9]" | \u00B7 | #"[\u0300-\u036F]" | #"[\u203F-\u2040]" +PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | ".")* PN_CHARS)? +PN_LOCAL ::= (PN_CHARS_U | ":" | #"[0-9]" | PLX) ((PN_CHARS | "." | ":" | PLX)* (PN_CHARS | ":" | PLX))? +PLX ::= PERCENT | PN_LOCAL_ESC +PERCENT ::= "%" HEX HEX +HEX ::= #"[0-9]" | #"[A-F]" | #"[a-f]" +PN_LOCAL_ESC ::= "\\" ("_" | "~" | "." | "-" | "!" | "$" | "&" | \u0027 | "(" | ")" | "*" | "+" | "," | ";" | "=" | "/" | "?" | "#" | "@" | "%") diff --git a/src/main/resources/rdf-turtle-11-ebfn-spec.txt b/src/main/resources/rdf-turtle-11-ebfn-spec.txt new file mode 100644 index 0000000..804a6dc --- /dev/null +++ b/src/main/resources/rdf-turtle-11-ebfn-spec.txt @@ -0,0 +1,56 @@ +turtleDoc ::= statement* +statement ::= directive | triples '.' +directive ::= prefixID | base | sparqlPrefix | sparqlBase +prefixID ::= '@prefix' PNAME_NS IRIREF '.' +base ::= '@base' IRIREF '.' +sparqlBase ::= 'BASE' IRIREF +sparqlPrefix ::= 'PREFIX' PNAME_NS IRIREF +triples ::= subject predicateObjectList | blankNodePropertyList predicateObjectList? +predicateObjectList ::= verb objectList (';' (verb objectList)?)* +objectList ::= object (',' object)* +verb ::= predicate | 'a' +subject ::= iri | BlankNode | collection +predicate ::= iri +object ::= iri | BlankNode | collection | blankNodePropertyList | literal +literal ::= RDFLiteral | NumericLiteral | BooleanLiteral +blankNodePropertyList ::= '[' predicateObjectList ']' +collection ::= '(' object* ')' +NumericLiteral ::= INTEGER | DECIMAL | DOUBLE +RDFLiteral ::= String (LANGTAG | '^^' iri)? +BooleanLiteral ::= 'true' | 'false' +String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE +iri ::= IRIREF | PrefixedName +PrefixedName ::= PNAME_LN | PNAME_NS +BlankNode ::= BLANK_NODE_LABEL | ANON +IRIREF ::= '<' (#'[^\u0000-\u0020<>\"{}|^`\\]' | UCHAR)* '>' +PNAME_NS ::= PN_PREFIX? ':' +PNAME_LN ::= PNAME_NS PN_LOCAL +BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | #'[0-9]') ((PN_CHARS | '.')* PN_CHARS)? +LANGTAG ::= '@' #'[a-zA-Z]'+ ('-' #'[a-zA-Z0-9]'+)* +INTEGER ::= #'[+-]'? #'[0-9]'+ +DECIMAL ::= #'[+-]'? #'[0-9]'* '.' #'[0-9]'+ +DOUBLE ::= #'[+-]'? (#'[0-9]'+ '.' #'[0-9]'* EXPONENT | '.' #'[0-9]'+ EXPONENT | #'[0-9]'+ EXPONENT) +EXPONENT ::= #'[eE]' #'[+-]?' #'[0-9]'+ +STRING_LITERAL_QUOTE ::= \"'\" (#'[^\u0022\u005C\u000A\u000D]' | ECHAR | UCHAR)* \"'\" +STRING_LITERAL_SINGLE_QUOTE ::= \"'\" (#'[^\u0027\u005C\u000A\u000D]' | ECHAR | UCHAR)* \"'\" +STRING_LITERAL_LONG_SINGLE_QUOTE ::= \"'''\" ((\"'\" | \"''\")? (#'[^'\\]' | ECHAR | UCHAR))* \"'''\" +STRING_LITERAL_LONG_QUOTE ::= '\"\"\"' (('\"' | '\"\"')? (#'[^\"\\]' | ECHAR | UCHAR))* '\"\"\"' +UCHAR ::= '\\u' HEX HEX HEX HEX | '\\U' HEX HEX HEX HEX HEX HEX HEX HEX +ECHAR ::= '\\' #'[tbnrf\"\'\\]' +WS ::= #'[\u0020]'+ | #'[\u0009]'+ | #'[\u000D]'+ | #'[\u000A]'+ +ANON ::= '[' WS* ']' +PN_CHARS_BASE ::= #'[A-Z]' | #'[a-z]' | #'[\u00C0-\u00D6]' | + #'[\u00D8-\u00F6]' | #'[\u00F8-\u02FF]' | + #'[\u0370-\u037D]' | #'[\u037F-\u1FFF]' | + #'[\u200C-\u200D]' | #'[\u2070-\u218F]' | + #'[\u2C00-\u2FEF]' | #'[\u3001-\uD7FF]' | + #'[\uF900-\uFDCF]' | #'[\uFDF0-\uFFFD]' | + #'[\x{10000}-\x{EFFFF}]' +PN_CHARS_U ::= PN_CHARS_BASE | '_' +PN_CHARS ::= PN_CHARS_U | '-' | #'[0-9]' | #'[\u00B7]' | #'[\u0300-\u036F]' | #'[\u203F-\u2040]' +PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)? +PN_LOCAL ::= (PN_CHARS_U | ':' | #'[0-9]' | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? +PLX ::= PERCENT | PN_LOCAL_ESC +PERCENT ::= '%' HEX HEX +HEX ::= #'[0-9]' | #'[A-F]' | #'[a-f]' +PN_LOCAL_ESC ::= '\\' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | #'[\u0027]' | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%') diff --git a/src/main/resources/rdf-turtle-spec.txt b/src/main/resources/rdf-turtle-spec.txt new file mode 100644 index 0000000..45b1a82 --- /dev/null +++ b/src/main/resources/rdf-turtle-spec.txt @@ -0,0 +1,68 @@ +turtleDoc ::= statement* + ::= directive | WSE* triples WS* <'.'> WSE* + ::= prefix | base +prefix ::= WS* prefixID WSE* | WS* sparqlPrefix WSE* +base ::= WS* regBase WSE* | WS* sparqlBase WSE* + ::= <'@prefix'> WS+ PNAME_NS WS+ iri WS* <'.'> + ::= <'@base'> WS+ iri WS+ <'.'> + ::= <#'[BbAaSsEe]+'> WS+ iri + ::= <#'[PpRrEeFfIiXx]+'> WS+ PNAME_NS WS+ iri +triples ::= subject WSE+ predicateObjectList | blankNodePropertyList WSE+ predicateObjectList? +predicateObjectList ::= predicate WSE+ objectList WSE* (<';'> WSE+ (predicate WS+ objectList)?)* +objectList ::= object WSE* (<','> WSE* object)* +predicate ::= verb | a +a ::= 'a' +subject ::= iri | BlankNode | collection + ::= iri +object ::= iri | BlankNode | collection | blankNodePropertyList | literal +literal ::= RDFLiteral | NumericLiteral | BooleanLiteral +blankNodePropertyList ::= <'['> WSE* predicateObjectList WSE* <']'> +collection ::= <'('> object-wse* <')'> + ::= object | WSE* + ::= integer | decimal | double +RDFLiteral ::= string (langtag | <'^^'> iri)? +BooleanLiteral ::= 'true' | 'false' +string ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE +iri ::= IRIREF | PrefixedName +PrefixedName ::= PNAME_LN | PNAME_NS +BlankNode ::= BLANK_NODE_LABEL | ANON + ::= <#'[\n\r]+'> + ::= FULLIRI | ref +ref ::= <'<'> (#'[^\u0000-\u0020<>\"{}:|^`\\]+' | UCHAR)* <'>'> + ::= <'<'> (#'[^\u0000-\u0020<>\"{}|^`\\]*' | UCHAR)* <'>'> + ::= PN_PREFIX? ':' + ::= PNAME_NS PN_LOCAL + ::= '_:' (PN_CHARS_U | #'[0-9]') ((PN_CHARS | '.')* PN_CHARS)? +langtag ::= '@' #'[a-zA-Z]+' ('-' #'[a-zA-Z0-9]+')* +integer ::= #'[+-]'? #'[0-9]+' +decimal ::= #'[+-]'? #'[0-9]*' '.' #'[0-9]+' +double ::= #'[+-]'? (#'[0-9]+' '.' #'[0-9]*' EXPONENT | '.' #'[0-9]+' EXPONENT | #'[0-9]+' EXPONENT) + ::= #'[eE]' #'[+-]'? #'[0-9]'+ + ::= <'"'> line-double <'"'> + ::= (#'[^\u0022\u005C\u000A\u000D\']*' | ECHAR | UCHAR)* + ::= (#'[^\u0022\u005C\u000A\u000D\"]*' | ECHAR | UCHAR)* + ::= <"\'"> line-single <"\'"> + ::= <"\'\'\'"> multi-line-single <"\'\'\'"> + ::= (('"' | '""')? (#'[^\"\\]*' | ECHAR | UCHAR))* + ::= (("\'" | "\'\'")? (#'[^\'\\]*' | ECHAR | UCHAR))* + ::= <'"""'> multi-line-double <'"""'> + ::= '\\u' HEX HEX HEX HEX | '\\U' HEX HEX HEX HEX HEX HEX HEX HEX + ::= '\\' #'[tbnrf"\'\\]' + ::= WS? EOL? + ::= <#'[ \t]*'> | <#'#.*'> + ::= '[' WSE* ']' + ::= #'[a-zA-Z]+' | #'[\u00C0-\u00D6]+' | + #'[\u00D8-\u00F6]+' | #'[\u00F8-\u02FF]+' | + #'[\u0370-\u037D]+' | #'[\u037F-\u1FFF]+' | + #'[\u200C-\u200D]+' | #'[\u2070-\u218F]+' | + #'[\u2C00-\u2FEF]+' | #'[\u3001-\uD7FF]+' | + #'[\uF900-\uFDCF]+' | #'[\uFDF0-\uFFFD]+' | + #'[\x{10000}-\x{EFFFF}]+' + ::= PN_CHARS_BASE | '_' + ::= PN_CHARS_U | '-' | #'[0-9]' | '\\u00B7' | #'[\u0300-\u036F]' | #'[\u203F-\u2040]' + ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)? + ::= (PN_CHARS_U | ':' | #'[0-9]+' | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? + ::= PERCENT | PN_LOCAL_ESC + ::= '%' HEX HEX + ::= #'[0-9]' | #'[A-F]' | #'[a-f]' + ::= '\\u005C' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | '\\u0027' | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%') diff --git a/src/main/resources/string-literal-long-quote.txt b/src/main/resources/string-literal-long-quote.txt new file mode 100644 index 0000000..3702727 --- /dev/null +++ b/src/main/resources/string-literal-long-quote.txt @@ -0,0 +1 @@ +STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? (#'[^\"\\]' | ECHAR | UCHAR))* '"""' diff --git a/src/main/resources/string-literal-long-single-quote.txt b/src/main/resources/string-literal-long-single-quote.txt new file mode 100644 index 0000000..4d16966 --- /dev/null +++ b/src/main/resources/string-literal-long-single-quote.txt @@ -0,0 +1 @@ +STRING_LITERAL_LONG_SINGLE_QUOTE ::= "\'\'\'" (("\'" | "\'\'")? (#'[^\'\\]' | ECHAR | UCHAR))* "\'\'\'" diff --git a/src/main/resources/string-literal-quote.txt b/src/main/resources/string-literal-quote.txt new file mode 100644 index 0000000..9250de5 --- /dev/null +++ b/src/main/resources/string-literal-quote.txt @@ -0,0 +1 @@ +STRING_LITERAL_QUOTE ::= '"' (#'[^\u0022\u005C\u000A\u000D]' | ECHAR | UCHAR)* '"' diff --git a/src/main/resources/string-literal-single-quote.txt b/src/main/resources/string-literal-single-quote.txt new file mode 100644 index 0000000..295823f --- /dev/null +++ b/src/main/resources/string-literal-single-quote.txt @@ -0,0 +1 @@ +STRING_LITERAL_SINGLE_QUOTE ::= "\'" (#'[^\u0027\u005C\u000A\u000D]' | ECHAR | UCHAR)* "\'" diff --git a/src/main/resources/tst-rdf-turtle-11-ebfn-spec.txt b/src/main/resources/tst-rdf-turtle-11-ebfn-spec.txt new file mode 100644 index 0000000..7139919 --- /dev/null +++ b/src/main/resources/tst-rdf-turtle-11-ebfn-spec.txt @@ -0,0 +1,56 @@ +turtleDoc ::= statement* +statement ::= directive | triples '.' +directive ::= prefixID | base | sparqlPrefix | sparqlBase +prefixID ::= '@prefix' PNAME_NS IRIREF '.' +base ::= '@base' IRIREF '.' +sparqlBase ::= 'BASE' IRIREF +sparqlPrefix ::= 'PREFIX' PNAME_NS IRIREF +triples ::= subject predicateObjectList | blankNodePropertyList predicateObjectList? +predicateObjectList ::= verb objectList (';' (verb objectList)?)* +objectList ::= object (',' object)* +verb ::= predicate | 'a' +subject ::= iri | BlankNode | collection +predicate ::= iri +object ::= iri | BlankNode | collection | blankNodePropertyList | literal +literal ::= RDFLiteral | NumericLiteral | BooleanLiteral +blankNodePropertyList ::= '[' predicateObjectList ']' +collection ::= '(' object* ')' +NumericLiteral ::= INTEGER | DECIMAL | DOUBLE +RDFLiteral ::= String (LANGTAG | '^^' iri)? +BooleanLiteral ::= 'true' | 'false' +String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE +iri ::= IRIREF | PrefixedName +PrefixedName ::= PNAME_LN | PNAME_NS +BlankNode ::= BLANK_NODE_LABEL | ANON +IRIREF ::= '<' (#'[^\u0000-\u0020<>\"{}|^`\\]' | UCHAR)* '>' +PNAME_NS ::= PN_PREFIX? ':' +PNAME_LN ::= PNAME_NS PN_LOCAL +BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | #'[0-9]') ((PN_CHARS | '.')* PN_CHARS)? +LANGTAG ::= '@' #'[a-zA-Z]'+ ('-' #'[a-zA-Z0-9]'+)* +INTEGER ::= #'[+-]'? #'[0-9]'+ +DECIMAL ::= #'[+-]'? #'[0-9]'* '.' #'[0-9]'+ +DOUBLE ::= #'[+-]'? (#'[0-9]'+ '.' #'[0-9]'* EXPONENT | '.' #'[0-9]'+ EXPONENT | #'[0-9]'+ EXPONENT) +EXPONENT ::= #'[eE]' #'[+-]'? #'[0-9]'+ +STRING_LITERAL_QUOTE ::= '"' (#'[^\u0022\u005C\u000A\u000D]' | ECHAR | UCHAR)* '"' +STRING_LITERAL_SINGLE_QUOTE ::= "\'" (#'[^\u0027\u005C\u000A\u000D]' | ECHAR | UCHAR)* "\'" +STRING_LITERAL_LONG_SINGLE_QUOTE ::= "\'\'\'" (("\'" | "\'\'")? (#'[^\'\\]' | ECHAR | UCHAR))* "\'\'\'" +STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? (#'[^\"\\]' | ECHAR | UCHAR))* '"""' +UCHAR ::= '\\u' HEX HEX HEX HEX | '\\U' HEX HEX HEX HEX HEX HEX HEX HEX +ECHAR ::= '\\u005C' #'[tbnrf"\'\\]' +WS ::= #'[\s]'+ | #'#.*' +ANON ::= '[' WS* ']' +PN_CHARS_BASE ::= #'[A-Z]' | #'[a-z]' | #'[\u00C0-\u00D6]' | + #'[\u00D8-\u00F6]' | #'[\u00F8-\u02FF]' | + #'[\u0370-\u037D]' | #'[\u037F-\u1FFF]' | + #'[\u200C-\u200D]' | #'[\u2070-\u218F]' | + #'[\u2C00-\u2FEF]' | #'[\u3001-\uD7FF]' | + #'[\uF900-\uFDCF]' | #'[\uFDF0-\uFFFD]' | + #'[\x{10000}-\x{EFFFF}]' +PN_CHARS_U ::= PN_CHARS_BASE | '_' +PN_CHARS ::= PN_CHARS_U | '-' | #'[0-9]' | '\\u00B7' | #'[\u0300-\u036F]' | #'[\u203F-\u2040]' +PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)? +PN_LOCAL ::= (PN_CHARS_U | ':' | #'[0-9]' | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? +PLX ::= PERCENT | PN_LOCAL_ESC +PERCENT ::= '%' HEX HEX +HEX ::= #'[0-9]' | #'[A-F]' | #'[a-f]' +PN_LOCAL_ESC ::= '\\u005C' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | '\\u0027' | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%')