BNF for JenaRules.jj
NON-TERMINALS
ruleset
::=
( <RULESET>
entityName
Prolog
imports
| ) ( <LBRACE>
rules
<RBRACE> |
rules
) (
DatasetClause
)* ( <RUN>
runExpression
)? <EOF>
runExpression
::=
parallel
parallel
::=
runSeq
( <PAR>
runSeq
)*
runSeq
::=
runSoup
( <SEMICOLON>
runSoup
)*
runSoup
::=
processDesignator
( <COMMA>
processDesignator
)*
processDesignator
::=
(
IRIrefOrName
| <LPAREN>
runExpression
<RPAREN> ) ( <STAR> )?
entityName
::=
(
IRIref
)? (
taggedString
( <COMMA>
taggedString
)* )?
taggedString
::=
String
( <LANGTAG> )?
imports
::=
( <INCLUDE>
importList
)*
importList
::=
importElement
( <COMMA>
importElement
)*
importElement
::=
IRIref
rules
::=
(
rule
)*
rule
::=
<RULE>
entityName
Prolog
(
sparqlConstructQuery
|
GroupGraphPattern
<ARROW>
Conclusion
)
Conclusion
::=
(
FunctionCall
( <COMMA>
FunctionCall
)* )?
ConstructTemplate
sparqlConstructQuery
::=
<CONSTRUCT>
ConstructTemplate
WhereClause
ConstructTemplate
::=
<LBRACE> (
LetBinding
)* (
ConstructTriples
)? <RBRACE>
ConstructTriples
::=
TriplesSameSubject
( <DOT> (
ConstructTriples
)? )?
Prolog
::=
(
BaseDecl
)? (
PrefixDecl
)* (
FunctionDecl
)*
FunctionDecl
::=
<FUNCTION>
IRIrefOrName
String
BaseDecl
::=
<BASE>
Q_IRI_REF
PrefixDecl
::=
<PREFIX> <QNAME_NS>
Q_IRI_REF
DatasetClause
::=
<FROM> (
SourceSelector
| <NAMED>
SourceSelector
)
SourceSelector
::=
IRIref
WhereClause
::=
( <WHERE> )?
GroupGraphPattern
GroupGraphPattern
::=
<LBRACE> ( <ALL> ( <DISTINCT> )? ( <VAR> | <LPAREN> ( <VAR> )* <RPAREN> <AS> <VAR> ) ( <WHERE> | <DOT> )
GroupGraphPattern
( <ARROW>
Conclusion
| ) |
GraphPatternElements
) <RBRACE>
GraphPatternElements
::=
(
TriplesBlock
)? (
GraphPatternNotTriples
( <DOT> )?
GraphPatternElements
|
filter
( <DOT> )?
GraphPatternElements
|
LetBinding
( <DOT>
GraphPatternElements
)? )?
TriplesBlock
::=
TriplesSameSubject
( <DOT> (
TriplesSameSubject
)? )*
GraphPatternNotTriples
::=
(
GroupOrUnionGraphPattern
| <UNLESS>
UnlessQualifier
GroupGraphPattern
| <OPTIONAL>
GroupGraphPattern
| <GRAPH>
VarOrIRIref
GroupGraphPattern
)
UnlessQualifier
::=
<ALREADY>
|
<DERIVED>
|
<GIVEN>
GroupOrUnionGraphPattern
::=
GroupGraphPattern
( <UNION>
GroupGraphPattern
)*
filter
::=
<FILTER>
Constraint
LetBinding
::=
<LET>
Var
<EQ>
Expression
<DOT>
Constraint
::=
(
Expression
)
FunctionCall
::=
<CALLING>
ArgList
ArgList
::=
( <NIL> | <LPAREN>
Expression
( <COMMA>
Expression
|
IRIrefOrFunction
|
Var
|
RDFLiteral
|
NumericLiteral
)* <RPAREN> )
TriplesSameSubject
::=
VarOrTerm
PropertyListNotEmpty
|
TriplesNode
PropertyList
PropertyList
::=
(
PropertyListNotEmpty
)?
PropertyListNotEmpty
::=
Verb
ObjectList
( <SEMICOLON>
PropertyList
)?
ObjectList
::=
GraphNode
( <COMMA>
ObjectList
)?
Verb
::=
(
VarOrIRIref
| <KW_A> )
TriplesNode
::=
(
Collection
|
BlankNodePropertyList
)
BlankNodePropertyList
::=
<LBRACKET>
PropertyListNotEmpty
<RBRACKET>
Collection
::=
<LPAREN> (
GraphNode
)+ <RPAREN>
GraphNode
::=
VarOrTerm
|
TriplesNode
|
<DOLLAR> <CALLING>
ArgList
|
<CALLING>
ArgList
VarOrTerm
::=
(
Var
|
GraphTerm
)
VarOrIRIref
::=
(
Var
|
IRIref
)
Var
::=
<VAR>
GraphTerm
::=
IRIref
|
RDFLiteral
|
NumericLiteral
|
BooleanLiteral
|
BlankNode
|
<NIL>
Expression
::=
ConditionalOrExpression
ConditionalOrExpression
::=
ConditionalAndExpression
( <SC_OR>
ConditionalAndExpression
)*
ConditionalAndExpression
::=
ValueLogical
( <SC_AND>
ValueLogical
)*
ValueLogical
::=
RelationalExpression
RelationalExpression
::=
NumericExpression
( ( <EQ> | <NE> | <LT> | <GT> | <LE> | <GE> )
NumericExpression
)?
NumericExpression
::=
AdditiveExpression
AdditiveExpression
::=
MultiplicativeExpression
( ( <PLUS> | <MINUS> )
MultiplicativeExpression
)*
MultiplicativeExpression
::=
UnaryExpression
( ( <STAR> | <SLASH> )
UnaryExpression
)*
UnaryExpression
::=
( <BANG> | <PLUS> | <MINUS> )
PrimaryExpression
|
PrimaryExpression
PrimaryExpression
::=
(
BrackettedExpression
|
IRIrefOrFunction
|
RDFLiteral
|
NumericLiteral
|
BooleanLiteral
|
Var
)
BrackettedExpression
::=
<LPAREN>
Expression
<RPAREN>
IRIrefOrFunction
::=
FunctionCall
|
IRIrefOrName
IRIrefOrName
::=
(
IRIref
| <NAME> )
RDFLiteral
::=
String
( <LANGTAG> | <DATATYPE>
IRIref
)?
NumericLiteral
::=
<INTEGER>
|
<DECIMAL>
|
<DOUBLE>
BooleanLiteral
::=
<TRUE>
|
<FALSE>
String
::=
( <STRING_LITERAL1> | <STRING_LITERAL2> | <STRING_LITERAL_LONG1> | <STRING_LITERAL_LONG2> )
IRIref
::=
(
Q_IRI_REF
|
QName
)
QName
::=
( <QNAME_LN> | <QNAME_NS> )
BlankNode
::=
<BLANK_NODE_LABEL>
|
<ANON>
Q_IRI_REF
::=
<Q_IRIref>