Skip to content

Instantly share code, notes, and snippets.

@grtjn
Created June 27, 2012 10:14
Show Gist options
  • Save grtjn/3003148 to your computer and use it in GitHub Desktop.
Save grtjn/3003148 to your computer and use it in GitHub Desktop.
Bottlecap Rex EBNF for .nx files
ntripleDoc ::= (line eoln?)* EOF
line ::= comment | triple
triple ::= subject predicate object context? '.'
subject ::= uriref | nodeID
predicate ::= uriref
object ::= uriref | nodeID | literal
context ::= uriref | nodeID | literal
literal ::= langString | datatypeString
_ ::= ws /* ws:definition */
<?TOKENS?>
comment ::= '#' ( character )*
uriref ::= '<' absoluteURI '>'
nodeID ::= '_:' name
langString ::= '"' string '"' ( '@' language )?
datatypeString ::= '"' string '"' '^^' uriref
language ::=
[a-z]+
('-'
[a-z0-9]+
)*
ws ::= space | tab
eoln ::= cr | lf | cr lf
space ::= #x20 /* US-ASCII space - decimal 32 */
cr ::= #xD /* US-ASCII carriage return - decimal 13 */
lf ::= #xA /* US-ASCII line feed - decimal 10 */
tab ::= #x9 /* US-ASCII horizontal tab - decimal 9 */
string ::= character*
name ::= [A-Za-z][A-Za-z0-9]*
absoluteURI ::= character+
character ::= [#x20-#x7E] /* US-ASCII space to decimal 126 */
EOF ::= $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment