|
|
@ -35,8 +35,8 @@ pub struct Query { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct QueryContent { |
|
|
|
struct QueryContent { |
|
|
|
// [1] QueryUnit ::= Query
|
|
|
|
// [1] QueryUnit ::= Query
|
|
|
|
// [2] Query ::= Prologue ( SelectQuery | ConstructQuery | DescribeQuery | AskQuery ) ValuesClause
|
|
|
|
// [2] Query ::= Prologue ( SelectQuery | ConstructQuery | DescribeQuery | AskQuery ) ValuesClause
|
|
|
|
variant: QueryVariant, |
|
|
|
variant: QueryVariant, |
|
|
|
values_clause: ValuesClause, |
|
|
|
values_clause: ValuesClause, |
|
|
|
} |
|
|
|
} |
|
|
@ -82,7 +82,7 @@ impl fmt::Debug for Query { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct SelectQuery { |
|
|
|
struct SelectQuery { |
|
|
|
// [7] SelectQuery ::= SelectClause DatasetClause* WhereClause SolutionModifier
|
|
|
|
// [7] SelectQuery ::= SelectClause DatasetClause* WhereClause SolutionModifier
|
|
|
|
select_clause: SelectClause, |
|
|
|
select_clause: SelectClause, |
|
|
|
where_clause: WhereClause, |
|
|
|
where_clause: WhereClause, |
|
|
|
solution_modifier: SolutionModifier, |
|
|
|
solution_modifier: SolutionModifier, |
|
|
@ -100,7 +100,7 @@ impl fmt::Display for SelectQuery { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct SubSelect { |
|
|
|
struct SubSelect { |
|
|
|
// [8] SubSelect ::= SelectClause WhereClause SolutionModifier ValuesClause
|
|
|
|
// [8] SubSelect ::= SelectClause WhereClause SolutionModifier ValuesClause
|
|
|
|
select_clause: SelectClause, |
|
|
|
select_clause: SelectClause, |
|
|
|
where_clause: WhereClause, |
|
|
|
where_clause: WhereClause, |
|
|
|
solution_modifier: SolutionModifier, |
|
|
|
solution_modifier: SolutionModifier, |
|
|
@ -119,7 +119,7 @@ impl fmt::Display for SubSelect { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct SelectClause { |
|
|
|
struct SelectClause { |
|
|
|
// [9] SelectClause ::= 'SELECT' ( 'DISTINCT' | 'REDUCED' )? ( ( Var | ( '(' Expression 'AS' Var ')' ) )+ | '*' )
|
|
|
|
// [9] SelectClause ::= 'SELECT' ( 'DISTINCT' | 'REDUCED' )? ( ( Var | ( '(' Expression 'AS' Var ')' ) )+ | '*' )
|
|
|
|
option: Option<SelectOption>, |
|
|
|
option: Option<SelectOption>, |
|
|
|
values: SelectValues, |
|
|
|
values: SelectValues, |
|
|
|
} |
|
|
|
} |
|
|
@ -171,7 +171,7 @@ impl fmt::Display for SelectClause { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct WhereClause { |
|
|
|
struct WhereClause { |
|
|
|
// [17] WhereClause ::= 'WHERE'? GroupGraphPattern
|
|
|
|
// [17] WhereClause ::= 'WHERE'? GroupGraphPattern
|
|
|
|
with_where: bool, |
|
|
|
with_where: bool, |
|
|
|
group_graph_pattern: GroupGraphPattern, |
|
|
|
group_graph_pattern: GroupGraphPattern, |
|
|
|
} |
|
|
|
} |
|
|
@ -187,7 +187,7 @@ impl fmt::Display for WhereClause { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct SolutionModifier { |
|
|
|
struct SolutionModifier { |
|
|
|
// [18] SolutionModifier ::= GroupClause? HavingClause? OrderClause? LimitOffsetClauses?
|
|
|
|
// [18] SolutionModifier ::= GroupClause? HavingClause? OrderClause? LimitOffsetClauses?
|
|
|
|
group: Option<GroupClause>, |
|
|
|
group: Option<GroupClause>, |
|
|
|
having: Option<HavingClause>, |
|
|
|
having: Option<HavingClause>, |
|
|
|
#[cfg(feature = "order")] |
|
|
|
#[cfg(feature = "order")] |
|
|
@ -218,7 +218,7 @@ impl fmt::Display for SolutionModifier { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct GroupClause { |
|
|
|
struct GroupClause { |
|
|
|
// [19] GroupClause ::= 'GROUP' 'BY' GroupCondition+
|
|
|
|
// [19] GroupClause ::= 'GROUP' 'BY' GroupCondition+
|
|
|
|
start: GroupCondition, |
|
|
|
start: GroupCondition, |
|
|
|
others: Vec<GroupCondition>, |
|
|
|
others: Vec<GroupCondition>, |
|
|
|
} |
|
|
|
} |
|
|
@ -235,7 +235,7 @@ impl fmt::Display for GroupClause { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum GroupCondition { |
|
|
|
enum GroupCondition { |
|
|
|
// [20] GroupCondition ::= BuiltInCall | FunctionCall | '(' Expression ( 'AS' Var )? ')' | Var
|
|
|
|
// [20] GroupCondition ::= BuiltInCall | FunctionCall | '(' Expression ( 'AS' Var )? ')' | Var
|
|
|
|
BuiltInCall(BuiltInCall), |
|
|
|
BuiltInCall(BuiltInCall), |
|
|
|
// TODO FunctionCall(FunctionCall)
|
|
|
|
// TODO FunctionCall(FunctionCall)
|
|
|
|
Projection(Expression, Option<Var>), |
|
|
|
Projection(Expression, Option<Var>), |
|
|
@ -261,7 +261,7 @@ impl fmt::Display for GroupCondition { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct HavingClause { |
|
|
|
struct HavingClause { |
|
|
|
// [21] HavingClause ::= 'HAVING' HavingCondition+
|
|
|
|
// [21] HavingClause ::= 'HAVING' HavingCondition+
|
|
|
|
start: HavingCondition, |
|
|
|
start: HavingCondition, |
|
|
|
others: Vec<HavingCondition>, |
|
|
|
others: Vec<HavingCondition>, |
|
|
|
} |
|
|
|
} |
|
|
@ -276,13 +276,13 @@ impl fmt::Display for HavingClause { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// [22] HavingCondition ::= Constraint
|
|
|
|
// [22] HavingCondition ::= Constraint
|
|
|
|
type HavingCondition = Constraint; |
|
|
|
type HavingCondition = Constraint; |
|
|
|
|
|
|
|
|
|
|
|
#[cfg(feature = "order")] |
|
|
|
#[cfg(feature = "order")] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct OrderClause { |
|
|
|
struct OrderClause { |
|
|
|
// [23] OrderClause ::= 'ORDER' 'BY' OrderCondition+
|
|
|
|
// [23] OrderClause ::= 'ORDER' 'BY' OrderCondition+
|
|
|
|
start: OrderCondition, |
|
|
|
start: OrderCondition, |
|
|
|
others: Vec<OrderCondition>, |
|
|
|
others: Vec<OrderCondition>, |
|
|
|
} |
|
|
|
} |
|
|
@ -301,7 +301,7 @@ impl fmt::Display for OrderClause { |
|
|
|
#[cfg(feature = "order")] |
|
|
|
#[cfg(feature = "order")] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum OrderCondition { |
|
|
|
enum OrderCondition { |
|
|
|
// [24] OrderCondition ::= ( ( 'ASC' | 'DESC' ) BrackettedExpression ) | ( Constraint | Var )
|
|
|
|
// [24] OrderCondition ::= ( ( 'ASC' | 'DESC' ) BrackettedExpression ) | ( Constraint | Var )
|
|
|
|
BrackettedExpression { |
|
|
|
BrackettedExpression { |
|
|
|
is_asc: bool, |
|
|
|
is_asc: bool, |
|
|
|
inner: BrackettedExpression, |
|
|
|
inner: BrackettedExpression, |
|
|
@ -330,7 +330,7 @@ impl fmt::Display for OrderCondition { |
|
|
|
#[cfg(feature = "limit-offset")] |
|
|
|
#[cfg(feature = "limit-offset")] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum LimitOffsetClauses { |
|
|
|
enum LimitOffsetClauses { |
|
|
|
// [25] LimitOffsetClauses ::= LimitClause OffsetClause? | OffsetClause LimitClause?
|
|
|
|
// [25] LimitOffsetClauses ::= LimitClause OffsetClause? | OffsetClause LimitClause?
|
|
|
|
LimitOffset(LimitClause, Option<OffsetClause>), |
|
|
|
LimitOffset(LimitClause, Option<OffsetClause>), |
|
|
|
OffsetLimit(OffsetClause, Option<LimitClause>), |
|
|
|
OffsetLimit(OffsetClause, Option<LimitClause>), |
|
|
|
} |
|
|
|
} |
|
|
@ -350,7 +350,7 @@ impl fmt::Display for LimitOffsetClauses { |
|
|
|
#[cfg(feature = "limit-offset")] |
|
|
|
#[cfg(feature = "limit-offset")] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct LimitClause { |
|
|
|
struct LimitClause { |
|
|
|
// [26] LimitClause ::= 'LIMIT' INTEGER
|
|
|
|
// [26] LimitClause ::= 'LIMIT' INTEGER
|
|
|
|
value: u8, |
|
|
|
value: u8, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -364,7 +364,7 @@ impl fmt::Display for LimitClause { |
|
|
|
#[cfg(feature = "limit-offset")] |
|
|
|
#[cfg(feature = "limit-offset")] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct OffsetClause { |
|
|
|
struct OffsetClause { |
|
|
|
// [27] OffsetClause ::= 'OFFSET' INTEGER
|
|
|
|
// [27] OffsetClause ::= 'OFFSET' INTEGER
|
|
|
|
value: u8, |
|
|
|
value: u8, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -377,7 +377,7 @@ impl fmt::Display for OffsetClause { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct ValuesClause { |
|
|
|
struct ValuesClause { |
|
|
|
// [28] ValuesClause ::= ( 'VALUES' DataBlock )?
|
|
|
|
// [28] ValuesClause ::= ( 'VALUES' DataBlock )?
|
|
|
|
value: Option<DataBlock>, |
|
|
|
value: Option<DataBlock>, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -393,7 +393,7 @@ impl fmt::Display for ValuesClause { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum GroupGraphPattern { |
|
|
|
enum GroupGraphPattern { |
|
|
|
// [53] GroupGraphPattern ::= '{' ( SubSelect | GroupGraphPatternSub ) '}'
|
|
|
|
// [53] GroupGraphPattern ::= '{' ( SubSelect | GroupGraphPatternSub ) '}'
|
|
|
|
GroupGraphPatternSub(GroupGraphPatternSub), |
|
|
|
GroupGraphPatternSub(GroupGraphPatternSub), |
|
|
|
SubSelect(Box<SubSelect>), |
|
|
|
SubSelect(Box<SubSelect>), |
|
|
|
} |
|
|
|
} |
|
|
@ -411,7 +411,7 @@ impl fmt::Display for GroupGraphPattern { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct GroupGraphPatternSub { |
|
|
|
struct GroupGraphPatternSub { |
|
|
|
// [54] GroupGraphPatternSub ::= TriplesBlock? ( GraphPatternNotTriples '.'? TriplesBlock? )*
|
|
|
|
// [54] GroupGraphPatternSub ::= TriplesBlock? ( GraphPatternNotTriples '.'? TriplesBlock? )*
|
|
|
|
start: Option<TriplesBlock>, |
|
|
|
start: Option<TriplesBlock>, |
|
|
|
others: Vec<GroupGraphPatternSubOtherBlock>, |
|
|
|
others: Vec<GroupGraphPatternSubOtherBlock>, |
|
|
|
} |
|
|
|
} |
|
|
@ -443,7 +443,7 @@ impl fmt::Display for GroupGraphPatternSub { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct TriplesBlock { |
|
|
|
struct TriplesBlock { |
|
|
|
// [55] TriplesBlock ::= TriplesSameSubjectPath ( '.' TriplesBlock? )?
|
|
|
|
// [55] TriplesBlock ::= TriplesSameSubjectPath ( '.' TriplesBlock? )?
|
|
|
|
start: TriplesSameSubjectPath, |
|
|
|
start: TriplesSameSubjectPath, |
|
|
|
end: Option<Option<Box<TriplesBlock>>>, |
|
|
|
end: Option<Option<Box<TriplesBlock>>>, |
|
|
|
} |
|
|
|
} |
|
|
@ -463,7 +463,7 @@ impl fmt::Display for TriplesBlock { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum GraphPatternNotTriples { |
|
|
|
enum GraphPatternNotTriples { |
|
|
|
// [56] GraphPatternNotTriples ::= GroupOrUnionGraphPattern | OptionalGraphPattern | MinusGraphPattern | GraphGraphPattern | ServiceGraphPattern | Filter | Bind | InlineData
|
|
|
|
// [56] GraphPatternNotTriples ::= GroupOrUnionGraphPattern | OptionalGraphPattern | MinusGraphPattern | GraphGraphPattern | ServiceGraphPattern | Filter | Bind | InlineData
|
|
|
|
GroupOrUnion(GroupOrUnionGraphPattern), |
|
|
|
GroupOrUnion(GroupOrUnionGraphPattern), |
|
|
|
Optional(OptionalGraphPattern), |
|
|
|
Optional(OptionalGraphPattern), |
|
|
|
Minus(MinusGraphPattern), |
|
|
|
Minus(MinusGraphPattern), |
|
|
@ -493,7 +493,7 @@ impl fmt::Display for GraphPatternNotTriples { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct OptionalGraphPattern { |
|
|
|
struct OptionalGraphPattern { |
|
|
|
// [57] OptionalGraphPattern ::= 'OPTIONAL' GroupGraphPattern
|
|
|
|
// [57] OptionalGraphPattern ::= 'OPTIONAL' GroupGraphPattern
|
|
|
|
inner: GroupGraphPattern, |
|
|
|
inner: GroupGraphPattern, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -505,7 +505,7 @@ impl fmt::Display for OptionalGraphPattern { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct LateralGraphPattern { |
|
|
|
struct LateralGraphPattern { |
|
|
|
// [] LateralGraphPattern ::= 'LATERAL' GroupGraphPattern
|
|
|
|
// [] LateralGraphPattern ::= 'LATERAL' GroupGraphPattern
|
|
|
|
inner: GroupGraphPattern, |
|
|
|
inner: GroupGraphPattern, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -517,7 +517,7 @@ impl fmt::Display for LateralGraphPattern { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct GraphGraphPattern { |
|
|
|
struct GraphGraphPattern { |
|
|
|
// [58] GraphGraphPattern ::= 'GRAPH' VarOrIri GroupGraphPattern
|
|
|
|
// [58] GraphGraphPattern ::= 'GRAPH' VarOrIri GroupGraphPattern
|
|
|
|
graph: VarOrIri, |
|
|
|
graph: VarOrIri, |
|
|
|
inner: GroupGraphPattern, |
|
|
|
inner: GroupGraphPattern, |
|
|
|
} |
|
|
|
} |
|
|
@ -530,7 +530,7 @@ impl fmt::Display for GraphGraphPattern { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct Bind { |
|
|
|
struct Bind { |
|
|
|
// [60] Bind ::= 'BIND' '(' Expression 'AS' Var ')'
|
|
|
|
// [60] Bind ::= 'BIND' '(' Expression 'AS' Var ')'
|
|
|
|
expression: Expression, |
|
|
|
expression: Expression, |
|
|
|
var: Var, |
|
|
|
var: Var, |
|
|
|
} |
|
|
|
} |
|
|
@ -543,7 +543,7 @@ impl fmt::Display for Bind { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct InlineData { |
|
|
|
struct InlineData { |
|
|
|
// [61] InlineData ::= 'VALUES' DataBlock
|
|
|
|
// [61] InlineData ::= 'VALUES' DataBlock
|
|
|
|
inner: DataBlock, |
|
|
|
inner: DataBlock, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -555,7 +555,7 @@ impl fmt::Display for InlineData { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum DataBlock { |
|
|
|
enum DataBlock { |
|
|
|
// [62] DataBlock ::= InlineDataOneVar | InlineDataFull
|
|
|
|
// [62] DataBlock ::= InlineDataOneVar | InlineDataFull
|
|
|
|
OneVar(InlineDataOneVar), |
|
|
|
OneVar(InlineDataOneVar), |
|
|
|
Full(InlineDataFull), |
|
|
|
Full(InlineDataFull), |
|
|
|
} |
|
|
|
} |
|
|
@ -571,7 +571,7 @@ impl fmt::Display for DataBlock { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct InlineDataOneVar { |
|
|
|
struct InlineDataOneVar { |
|
|
|
// [63] InlineDataOneVar ::= Var '{' DataBlockValue* '}'
|
|
|
|
// [63] InlineDataOneVar ::= Var '{' DataBlockValue* '}'
|
|
|
|
var: Var, |
|
|
|
var: Var, |
|
|
|
values: Vec<DataBlockValue>, |
|
|
|
values: Vec<DataBlockValue>, |
|
|
|
} |
|
|
|
} |
|
|
@ -587,7 +587,7 @@ impl fmt::Display for InlineDataOneVar { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct InlineDataFull { |
|
|
|
struct InlineDataFull { |
|
|
|
// [64] InlineDataFull ::= ( NIL | '(' Var* ')' ) '{' ( '(' DataBlockValue* ')' | NIL )* '}'
|
|
|
|
// [64] InlineDataFull ::= ( NIL | '(' Var* ')' ) '{' ( '(' DataBlockValue* ')' | NIL )* '}'
|
|
|
|
vars: Vec<Var>, |
|
|
|
vars: Vec<Var>, |
|
|
|
values: Vec<Vec<DataBlockValue>>, |
|
|
|
values: Vec<Vec<DataBlockValue>>, |
|
|
|
} |
|
|
|
} |
|
|
@ -635,7 +635,7 @@ impl fmt::Display for InlineDataFull { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum DataBlockValue { |
|
|
|
enum DataBlockValue { |
|
|
|
// [65] DataBlockValue ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF'
|
|
|
|
// [65] DataBlockValue ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF'
|
|
|
|
Iri(Iri), |
|
|
|
Iri(Iri), |
|
|
|
Literal(Literal), |
|
|
|
Literal(Literal), |
|
|
|
Undef, |
|
|
|
Undef, |
|
|
@ -653,7 +653,7 @@ impl fmt::Display for DataBlockValue { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct MinusGraphPattern { |
|
|
|
struct MinusGraphPattern { |
|
|
|
// [66] MinusGraphPattern ::= 'MINUS' GroupGraphPattern
|
|
|
|
// [66] MinusGraphPattern ::= 'MINUS' GroupGraphPattern
|
|
|
|
inner: GroupGraphPattern, |
|
|
|
inner: GroupGraphPattern, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -665,7 +665,7 @@ impl fmt::Display for MinusGraphPattern { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct GroupOrUnionGraphPattern { |
|
|
|
struct GroupOrUnionGraphPattern { |
|
|
|
// [67] GroupOrUnionGraphPattern ::= GroupGraphPattern ( 'UNION' GroupGraphPattern )*
|
|
|
|
// [67] GroupOrUnionGraphPattern ::= GroupGraphPattern ( 'UNION' GroupGraphPattern )*
|
|
|
|
start: GroupGraphPattern, |
|
|
|
start: GroupGraphPattern, |
|
|
|
others: Vec<GroupGraphPattern>, |
|
|
|
others: Vec<GroupGraphPattern>, |
|
|
|
} |
|
|
|
} |
|
|
@ -682,7 +682,7 @@ impl fmt::Display for GroupOrUnionGraphPattern { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct Filter { |
|
|
|
struct Filter { |
|
|
|
// [68] Filter ::= 'FILTER' Constraint
|
|
|
|
// [68] Filter ::= 'FILTER' Constraint
|
|
|
|
constraint: Constraint, |
|
|
|
constraint: Constraint, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -694,7 +694,7 @@ impl fmt::Display for Filter { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum Constraint { |
|
|
|
enum Constraint { |
|
|
|
// [69] Constraint ::= BrackettedExpression | BuiltInCall | FunctionCall
|
|
|
|
// [69] Constraint ::= BrackettedExpression | BuiltInCall | FunctionCall
|
|
|
|
BrackettedExpression(BrackettedExpression), |
|
|
|
BrackettedExpression(BrackettedExpression), |
|
|
|
BuiltInCall(BuiltInCall), |
|
|
|
BuiltInCall(BuiltInCall), |
|
|
|
// TODO FunctionCall(FunctionCall),
|
|
|
|
// TODO FunctionCall(FunctionCall),
|
|
|
@ -712,7 +712,7 @@ impl fmt::Display for Constraint { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct FunctionCall { |
|
|
|
struct FunctionCall { |
|
|
|
// [70] FunctionCall ::= iri ArgList
|
|
|
|
// [70] FunctionCall ::= iri ArgList
|
|
|
|
iri: Iri, |
|
|
|
iri: Iri, |
|
|
|
args: ArgList, |
|
|
|
args: ArgList, |
|
|
|
} |
|
|
|
} |
|
|
@ -725,7 +725,7 @@ impl fmt::Display for FunctionCall { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum ArgList { |
|
|
|
enum ArgList { |
|
|
|
// [71] ArgList ::= NIL | '(' 'DISTINCT'? Expression ( ',' Expression )* ')'
|
|
|
|
// [71] ArgList ::= NIL | '(' 'DISTINCT'? Expression ( ',' Expression )* ')'
|
|
|
|
Nil, |
|
|
|
Nil, |
|
|
|
NotNil { |
|
|
|
NotNil { |
|
|
|
// TODO: DISTINCT
|
|
|
|
// TODO: DISTINCT
|
|
|
@ -749,7 +749,7 @@ impl fmt::Display for ArgList { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct ExpressionList { |
|
|
|
struct ExpressionList { |
|
|
|
// [72] ExpressionList ::= NIL | '(' Expression ( ',' Expression )* ')'
|
|
|
|
// [72] ExpressionList ::= NIL | '(' Expression ( ',' Expression )* ')'
|
|
|
|
inner: Vec<Expression>, |
|
|
|
inner: Vec<Expression>, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -768,7 +768,7 @@ impl fmt::Display for ExpressionList { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct PropertyListNotEmpty { |
|
|
|
struct PropertyListNotEmpty { |
|
|
|
// [77] PropertyListNotEmpty ::= Verb ObjectList ( ';' ( Verb ObjectList )? )*
|
|
|
|
// [77] PropertyListNotEmpty ::= Verb ObjectList ( ';' ( Verb ObjectList )? )*
|
|
|
|
start_predicate: Verb, |
|
|
|
start_predicate: Verb, |
|
|
|
start_object: Box<ObjectList>, |
|
|
|
start_object: Box<ObjectList>, |
|
|
|
others: Vec<Option<PropertyListElement>>, |
|
|
|
others: Vec<Option<PropertyListElement>>, |
|
|
@ -795,7 +795,7 @@ impl fmt::Display for PropertyListNotEmpty { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum Verb { |
|
|
|
enum Verb { |
|
|
|
// [78] Verb ::= VarOrIri | 'a'
|
|
|
|
// [78] Verb ::= VarOrIri | 'a'
|
|
|
|
VarOrIri(VarOrIri), |
|
|
|
VarOrIri(VarOrIri), |
|
|
|
A, |
|
|
|
A, |
|
|
|
} |
|
|
|
} |
|
|
@ -811,7 +811,7 @@ impl fmt::Display for Verb { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct ObjectList { |
|
|
|
struct ObjectList { |
|
|
|
// [79] ObjectList ::= Object ( ',' Object )*
|
|
|
|
// [79] ObjectList ::= Object ( ',' Object )*
|
|
|
|
start: Object, |
|
|
|
start: Object, |
|
|
|
others: Vec<Object>, |
|
|
|
others: Vec<Object>, |
|
|
|
} |
|
|
|
} |
|
|
@ -827,12 +827,12 @@ impl fmt::Display for ObjectList { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// [80] Object ::= GraphNode
|
|
|
|
// [80] Object ::= GraphNode
|
|
|
|
type Object = GraphNode; |
|
|
|
type Object = GraphNode; |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum TriplesSameSubjectPath { |
|
|
|
enum TriplesSameSubjectPath { |
|
|
|
// [81] TriplesSameSubjectPath ::= VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath
|
|
|
|
// [81] TriplesSameSubjectPath ::= VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath
|
|
|
|
Atomic { |
|
|
|
Atomic { |
|
|
|
subject: VarOrTerm, |
|
|
|
subject: VarOrTerm, |
|
|
|
predicate_object: PropertyListPathNotEmpty, |
|
|
|
predicate_object: PropertyListPathNotEmpty, |
|
|
@ -864,7 +864,7 @@ impl fmt::Display for TriplesSameSubjectPath { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct PropertyListPath { |
|
|
|
struct PropertyListPath { |
|
|
|
// [82] PropertyListPath ::= PropertyListPathNotEmpty?
|
|
|
|
// [82] PropertyListPath ::= PropertyListPathNotEmpty?
|
|
|
|
inner: Option<PropertyListPathNotEmpty>, |
|
|
|
inner: Option<PropertyListPathNotEmpty>, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -880,7 +880,7 @@ impl fmt::Display for PropertyListPath { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct PropertyListPathNotEmpty { |
|
|
|
struct PropertyListPathNotEmpty { |
|
|
|
// [83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectListPath ( ';' ( ( VerbPath | VerbSimple ) ObjectListPath )? )*
|
|
|
|
// [83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectListPath ( ';' ( ( VerbPath | VerbSimple ) ObjectListPath )? )*
|
|
|
|
start_predicate: PropertyListPathNotEmptyVerb, |
|
|
|
start_predicate: PropertyListPathNotEmptyVerb, |
|
|
|
start_object: Box<ObjectListPath>, |
|
|
|
start_object: Box<ObjectListPath>, |
|
|
|
others: Vec<Option<PropertyListPathElement>>, |
|
|
|
others: Vec<Option<PropertyListPathElement>>, |
|
|
@ -919,15 +919,15 @@ impl fmt::Display for PropertyListPathNotEmpty { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// [84] VerbPath ::= Path
|
|
|
|
// [84] VerbPath ::= Path
|
|
|
|
type VerbPath = Path; |
|
|
|
type VerbPath = Path; |
|
|
|
|
|
|
|
|
|
|
|
// [85] VerbSimple ::= Var
|
|
|
|
// [85] VerbSimple ::= Var
|
|
|
|
type VerbSimple = Var; |
|
|
|
type VerbSimple = Var; |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct ObjectListPath { |
|
|
|
struct ObjectListPath { |
|
|
|
// [86] ObjectListPath ::= ObjectPath ( ',' ObjectPath )*
|
|
|
|
// [86] ObjectListPath ::= ObjectPath ( ',' ObjectPath )*
|
|
|
|
start: ObjectPath, |
|
|
|
start: ObjectPath, |
|
|
|
others: Vec<ObjectPath>, |
|
|
|
others: Vec<ObjectPath>, |
|
|
|
} |
|
|
|
} |
|
|
@ -942,15 +942,15 @@ impl fmt::Display for ObjectListPath { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// [87] ObjectPath ::= GraphNodePath
|
|
|
|
// [87] ObjectPath ::= GraphNodePath
|
|
|
|
type ObjectPath = GraphNodePath; |
|
|
|
type ObjectPath = GraphNodePath; |
|
|
|
|
|
|
|
|
|
|
|
// [88] Path ::= PathAlternative
|
|
|
|
// [88] Path ::= PathAlternative
|
|
|
|
type Path = PathAlternative; |
|
|
|
type Path = PathAlternative; |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct PathAlternative { |
|
|
|
struct PathAlternative { |
|
|
|
// [89] PathAlternative ::= PathSequence ( '|' PathSequence )*
|
|
|
|
// [89] PathAlternative ::= PathSequence ( '|' PathSequence )*
|
|
|
|
start: PathSequence, |
|
|
|
start: PathSequence, |
|
|
|
others: Vec<PathSequence>, |
|
|
|
others: Vec<PathSequence>, |
|
|
|
} |
|
|
|
} |
|
|
@ -967,7 +967,7 @@ impl fmt::Display for PathAlternative { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct PathSequence { |
|
|
|
struct PathSequence { |
|
|
|
// [90] PathSequence ::= PathEltOrInverse ( '/' PathEltOrInverse )*
|
|
|
|
// [90] PathSequence ::= PathEltOrInverse ( '/' PathEltOrInverse )*
|
|
|
|
start: PathEltOrInverse, |
|
|
|
start: PathEltOrInverse, |
|
|
|
others: Vec<PathEltOrInverse>, |
|
|
|
others: Vec<PathEltOrInverse>, |
|
|
|
} |
|
|
|
} |
|
|
@ -984,7 +984,7 @@ impl fmt::Display for PathSequence { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct PathElt { |
|
|
|
struct PathElt { |
|
|
|
// [91] PathElt ::= PathPrimary PathMod?
|
|
|
|
// [91] PathElt ::= PathPrimary PathMod?
|
|
|
|
path: PathPrimary, |
|
|
|
path: PathPrimary, |
|
|
|
mode: Option<PathMod>, |
|
|
|
mode: Option<PathMod>, |
|
|
|
} |
|
|
|
} |
|
|
@ -1001,7 +1001,7 @@ impl fmt::Display for PathElt { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum PathEltOrInverse { |
|
|
|
enum PathEltOrInverse { |
|
|
|
// [92] PathEltOrInverse ::= PathElt | '^' PathElt
|
|
|
|
// [92] PathEltOrInverse ::= PathElt | '^' PathElt
|
|
|
|
PathElt(PathElt), |
|
|
|
PathElt(PathElt), |
|
|
|
Inverse(PathElt), |
|
|
|
Inverse(PathElt), |
|
|
|
} |
|
|
|
} |
|
|
@ -1017,7 +1017,7 @@ impl fmt::Display for PathEltOrInverse { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum PathMod { |
|
|
|
enum PathMod { |
|
|
|
// [93] PathMod ::= '?' | '*' | '+'
|
|
|
|
// [93] PathMod ::= '?' | '*' | '+'
|
|
|
|
ZeroOrOne, |
|
|
|
ZeroOrOne, |
|
|
|
ZeroOrMore, |
|
|
|
ZeroOrMore, |
|
|
|
OneOrMore, |
|
|
|
OneOrMore, |
|
|
@ -1035,7 +1035,7 @@ impl fmt::Display for PathMod { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum PathPrimary { |
|
|
|
enum PathPrimary { |
|
|
|
// [94] PathPrimary ::= iri | 'a' | '!' PathNegatedPropertySet | '(' Path ')'
|
|
|
|
// [94] PathPrimary ::= iri | 'a' | '!' PathNegatedPropertySet | '(' Path ')'
|
|
|
|
Iri(Iri), |
|
|
|
Iri(Iri), |
|
|
|
A, |
|
|
|
A, |
|
|
|
Negated(PathNegatedPropertySet), |
|
|
|
Negated(PathNegatedPropertySet), |
|
|
@ -1055,7 +1055,7 @@ impl fmt::Display for PathPrimary { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum PathNegatedPropertySet { |
|
|
|
enum PathNegatedPropertySet { |
|
|
|
// [95] PathNegatedPropertySet ::= PathOneInPropertySet | '(' ( PathOneInPropertySet ( '|' PathOneInPropertySet )* )? ')'
|
|
|
|
// [95] PathNegatedPropertySet ::= PathOneInPropertySet | '(' ( PathOneInPropertySet ( '|' PathOneInPropertySet )* )? ')'
|
|
|
|
Single(PathOneInPropertySet), |
|
|
|
Single(PathOneInPropertySet), |
|
|
|
Multiple { |
|
|
|
Multiple { |
|
|
|
start: PathOneInPropertySet, |
|
|
|
start: PathOneInPropertySet, |
|
|
@ -1080,7 +1080,7 @@ impl fmt::Display for PathNegatedPropertySet { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum PathOneInPropertySet { |
|
|
|
enum PathOneInPropertySet { |
|
|
|
// [96] PathOneInPropertySet ::= iri | 'a' | '^' ( iri | 'a' )
|
|
|
|
// [96] PathOneInPropertySet ::= iri | 'a' | '^' ( iri | 'a' )
|
|
|
|
Iri(Iri), |
|
|
|
Iri(Iri), |
|
|
|
A, |
|
|
|
A, |
|
|
|
NegatedIri(Iri), |
|
|
|
NegatedIri(Iri), |
|
|
@ -1100,7 +1100,7 @@ impl fmt::Display for PathOneInPropertySet { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum TriplesNode { |
|
|
|
enum TriplesNode { |
|
|
|
// [98] TriplesNode ::= Collection | BlankNodePropertyList
|
|
|
|
// [98] TriplesNode ::= Collection | BlankNodePropertyList
|
|
|
|
Collection(Collection), |
|
|
|
Collection(Collection), |
|
|
|
BlankNodePropertyList(BlankNodePropertyList), |
|
|
|
BlankNodePropertyList(BlankNodePropertyList), |
|
|
|
} |
|
|
|
} |
|
|
@ -1116,7 +1116,7 @@ impl fmt::Display for TriplesNode { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct BlankNodePropertyList { |
|
|
|
struct BlankNodePropertyList { |
|
|
|
// [99] BlankNodePropertyList ::= '[' PropertyListNotEmpty ']'
|
|
|
|
// [99] BlankNodePropertyList ::= '[' PropertyListNotEmpty ']'
|
|
|
|
inner: PropertyListNotEmpty, |
|
|
|
inner: PropertyListNotEmpty, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1128,7 +1128,7 @@ impl fmt::Display for BlankNodePropertyList { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum TriplesNodePath { |
|
|
|
enum TriplesNodePath { |
|
|
|
// [100] TriplesNodePath ::= CollectionPath | BlankNodePropertyListPath
|
|
|
|
// [100] TriplesNodePath ::= CollectionPath | BlankNodePropertyListPath
|
|
|
|
CollectionPath(CollectionPath), |
|
|
|
CollectionPath(CollectionPath), |
|
|
|
BlankNodePropertyListPath(BlankNodePropertyListPath), |
|
|
|
BlankNodePropertyListPath(BlankNodePropertyListPath), |
|
|
|
} |
|
|
|
} |
|
|
@ -1144,7 +1144,7 @@ impl fmt::Display for TriplesNodePath { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct BlankNodePropertyListPath { |
|
|
|
struct BlankNodePropertyListPath { |
|
|
|
// [101] BlankNodePropertyListPath ::= '[' PropertyListPathNotEmpty ']'
|
|
|
|
// [101] BlankNodePropertyListPath ::= '[' PropertyListPathNotEmpty ']'
|
|
|
|
inner: PropertyListPathNotEmpty, |
|
|
|
inner: PropertyListPathNotEmpty, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1156,7 +1156,7 @@ impl fmt::Display for BlankNodePropertyListPath { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct Collection { |
|
|
|
struct Collection { |
|
|
|
// [102] Collection ::= '(' GraphNode+ ')'
|
|
|
|
// [102] Collection ::= '(' GraphNode+ ')'
|
|
|
|
start: Box<GraphNode>, |
|
|
|
start: Box<GraphNode>, |
|
|
|
others: Vec<GraphNode>, |
|
|
|
others: Vec<GraphNode>, |
|
|
|
} |
|
|
|
} |
|
|
@ -1173,7 +1173,7 @@ impl fmt::Display for Collection { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct CollectionPath { |
|
|
|
struct CollectionPath { |
|
|
|
// [103] CollectionPath ::= '(' GraphNodePath+ ')'
|
|
|
|
// [103] CollectionPath ::= '(' GraphNodePath+ ')'
|
|
|
|
start: Box<GraphNodePath>, |
|
|
|
start: Box<GraphNodePath>, |
|
|
|
others: Vec<GraphNodePath>, |
|
|
|
others: Vec<GraphNodePath>, |
|
|
|
} |
|
|
|
} |
|
|
@ -1190,7 +1190,7 @@ impl fmt::Display for CollectionPath { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum GraphNode { |
|
|
|
enum GraphNode { |
|
|
|
// [104] GraphNode ::= VarOrTerm | TriplesNode
|
|
|
|
// [104] GraphNode ::= VarOrTerm | TriplesNode
|
|
|
|
VarOrTerm(VarOrTerm), |
|
|
|
VarOrTerm(VarOrTerm), |
|
|
|
TriplesNode(TriplesNode), |
|
|
|
TriplesNode(TriplesNode), |
|
|
|
} |
|
|
|
} |
|
|
@ -1206,7 +1206,7 @@ impl fmt::Display for GraphNode { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum GraphNodePath { |
|
|
|
enum GraphNodePath { |
|
|
|
// [105] GraphNodePath ::= VarOrTerm | TriplesNodePath
|
|
|
|
// [105] GraphNodePath ::= VarOrTerm | TriplesNodePath
|
|
|
|
VarOrTerm(VarOrTerm), |
|
|
|
VarOrTerm(VarOrTerm), |
|
|
|
TriplesNodePath(TriplesNodePath), |
|
|
|
TriplesNodePath(TriplesNodePath), |
|
|
|
} |
|
|
|
} |
|
|
@ -1222,7 +1222,7 @@ impl fmt::Display for GraphNodePath { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum VarOrTerm { |
|
|
|
enum VarOrTerm { |
|
|
|
// [106] VarOrTerm ::= Var | GraphTerm
|
|
|
|
// [106] VarOrTerm ::= Var | GraphTerm
|
|
|
|
Var(Var), |
|
|
|
Var(Var), |
|
|
|
GraphTerm(GraphTerm), |
|
|
|
GraphTerm(GraphTerm), |
|
|
|
} |
|
|
|
} |
|
|
@ -1238,7 +1238,7 @@ impl fmt::Display for VarOrTerm { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum VarOrIri { |
|
|
|
enum VarOrIri { |
|
|
|
// [107] VarOrIri ::= Var | iri
|
|
|
|
// [107] VarOrIri ::= Var | iri
|
|
|
|
Var(Var), |
|
|
|
Var(Var), |
|
|
|
Iri(Iri), |
|
|
|
Iri(Iri), |
|
|
|
} |
|
|
|
} |
|
|
@ -1253,7 +1253,7 @@ impl fmt::Display for VarOrIri { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct Var { |
|
|
|
struct Var { |
|
|
|
// [108] Var ::= VAR1 | VAR2
|
|
|
|
// [108] Var ::= VAR1 | VAR2
|
|
|
|
value: u8, |
|
|
|
value: u8, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1277,7 +1277,7 @@ impl fmt::Display for Var { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum GraphTerm { |
|
|
|
enum GraphTerm { |
|
|
|
// [109] GraphTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL
|
|
|
|
// [109] GraphTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL
|
|
|
|
Iri(Iri), |
|
|
|
Iri(Iri), |
|
|
|
Literal(Literal), |
|
|
|
Literal(Literal), |
|
|
|
Nil, |
|
|
|
Nil, |
|
|
@ -1294,12 +1294,12 @@ impl fmt::Display for GraphTerm { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// [110] Expression ::= ConditionalOrExpression
|
|
|
|
// [110] Expression ::= ConditionalOrExpression
|
|
|
|
type Expression = ConditionalOrExpression; |
|
|
|
type Expression = ConditionalOrExpression; |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct ConditionalOrExpression { |
|
|
|
struct ConditionalOrExpression { |
|
|
|
// [111] ConditionalOrExpression ::= ConditionalAndExpression ( '||' ConditionalAndExpression )*
|
|
|
|
// [111] ConditionalOrExpression ::= ConditionalAndExpression ( '||' ConditionalAndExpression )*
|
|
|
|
start: ConditionalAndExpression, |
|
|
|
start: ConditionalAndExpression, |
|
|
|
others: Vec<ConditionalAndExpression>, |
|
|
|
others: Vec<ConditionalAndExpression>, |
|
|
|
} |
|
|
|
} |
|
|
@ -1316,7 +1316,7 @@ impl fmt::Display for ConditionalOrExpression { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct ConditionalAndExpression { |
|
|
|
struct ConditionalAndExpression { |
|
|
|
// [112] ConditionalAndExpression ::= ValueLogical ( '&&' ValueLogical )*
|
|
|
|
// [112] ConditionalAndExpression ::= ValueLogical ( '&&' ValueLogical )*
|
|
|
|
start: ValueLogical, |
|
|
|
start: ValueLogical, |
|
|
|
others: Vec<ValueLogical>, |
|
|
|
others: Vec<ValueLogical>, |
|
|
|
} |
|
|
|
} |
|
|
@ -1331,12 +1331,12 @@ impl fmt::Display for ConditionalAndExpression { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// [113] ValueLogical ::= RelationalExpression
|
|
|
|
// [113] ValueLogical ::= RelationalExpression
|
|
|
|
type ValueLogical = RelationalExpression; |
|
|
|
type ValueLogical = RelationalExpression; |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum RelationalExpression { |
|
|
|
enum RelationalExpression { |
|
|
|
// [114] RelationalExpression ::= NumericExpression ( '=' NumericExpression | '!=' NumericExpression | '<' NumericExpression | '>' NumericExpression | '<=' NumericExpression | '>=' NumericExpression | 'IN' ExpressionList | 'NOT' 'IN' ExpressionList )?
|
|
|
|
// [114] RelationalExpression ::= NumericExpression ( '=' NumericExpression | '!=' NumericExpression | '<' NumericExpression | '>' NumericExpression | '<=' NumericExpression | '>=' NumericExpression | 'IN' ExpressionList | 'NOT' 'IN' ExpressionList )?
|
|
|
|
Base(NumericExpression), |
|
|
|
Base(NumericExpression), |
|
|
|
Equal(NumericExpression, NumericExpression), |
|
|
|
Equal(NumericExpression, NumericExpression), |
|
|
|
NotEqual(NumericExpression, NumericExpression), |
|
|
|
NotEqual(NumericExpression, NumericExpression), |
|
|
@ -1364,12 +1364,12 @@ impl fmt::Display for RelationalExpression { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// [115] NumericExpression ::= AdditiveExpression
|
|
|
|
// [115] NumericExpression ::= AdditiveExpression
|
|
|
|
type NumericExpression = AdditiveExpression; |
|
|
|
type NumericExpression = AdditiveExpression; |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum AdditiveExpression { |
|
|
|
enum AdditiveExpression { |
|
|
|
// [116] AdditiveExpression ::= MultiplicativeExpression ( '+' MultiplicativeExpression | '-' MultiplicativeExpression | ( NumericLiteralPositive | NumericLiteralNegative ) ( ( '*' UnaryExpression ) | ( '/' UnaryExpression ) )* )*
|
|
|
|
// [116] AdditiveExpression ::= MultiplicativeExpression ( '+' MultiplicativeExpression | '-' MultiplicativeExpression | ( NumericLiteralPositive | NumericLiteralNegative ) ( ( '*' UnaryExpression ) | ( '/' UnaryExpression ) )* )*
|
|
|
|
Base(MultiplicativeExpression), |
|
|
|
Base(MultiplicativeExpression), |
|
|
|
Plus(MultiplicativeExpression, MultiplicativeExpression), |
|
|
|
Plus(MultiplicativeExpression, MultiplicativeExpression), |
|
|
|
Minus(MultiplicativeExpression, MultiplicativeExpression), // TODO: Prefix + and -
|
|
|
|
Minus(MultiplicativeExpression, MultiplicativeExpression), // TODO: Prefix + and -
|
|
|
@ -1387,7 +1387,7 @@ impl fmt::Display for AdditiveExpression { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum MultiplicativeExpression { |
|
|
|
enum MultiplicativeExpression { |
|
|
|
// [117] MultiplicativeExpression ::= UnaryExpression ( '*' UnaryExpression | '/' UnaryExpression )*
|
|
|
|
// [117] MultiplicativeExpression ::= UnaryExpression ( '*' UnaryExpression | '/' UnaryExpression )*
|
|
|
|
Base(UnaryExpression), |
|
|
|
Base(UnaryExpression), |
|
|
|
Mul(UnaryExpression, UnaryExpression), |
|
|
|
Mul(UnaryExpression, UnaryExpression), |
|
|
|
Div(UnaryExpression, UnaryExpression), |
|
|
|
Div(UnaryExpression, UnaryExpression), |
|
|
@ -1405,7 +1405,7 @@ impl fmt::Display for MultiplicativeExpression { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum UnaryExpression { |
|
|
|
enum UnaryExpression { |
|
|
|
// [118] UnaryExpression ::= '!' PrimaryExpression | '+' PrimaryExpression | '-' PrimaryExpression | PrimaryExpression
|
|
|
|
// [118] UnaryExpression ::= '!' PrimaryExpression | '+' PrimaryExpression | '-' PrimaryExpression | PrimaryExpression
|
|
|
|
Not(PrimaryExpression), |
|
|
|
Not(PrimaryExpression), |
|
|
|
Plus(PrimaryExpression), |
|
|
|
Plus(PrimaryExpression), |
|
|
|
Minus(PrimaryExpression), |
|
|
|
Minus(PrimaryExpression), |
|
|
@ -1425,7 +1425,7 @@ impl fmt::Display for UnaryExpression { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum PrimaryExpression { |
|
|
|
enum PrimaryExpression { |
|
|
|
// [119] PrimaryExpression ::= BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var
|
|
|
|
// [119] PrimaryExpression ::= BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var
|
|
|
|
Bracketted(BrackettedExpression), |
|
|
|
Bracketted(BrackettedExpression), |
|
|
|
BuiltInCall(BuiltInCall), |
|
|
|
BuiltInCall(BuiltInCall), |
|
|
|
IriOrFunction(IriOrFunction), |
|
|
|
IriOrFunction(IriOrFunction), |
|
|
@ -1447,7 +1447,7 @@ impl fmt::Display for PrimaryExpression { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct BrackettedExpression { |
|
|
|
struct BrackettedExpression { |
|
|
|
// [120] BrackettedExpression ::= '(' Expression ')'
|
|
|
|
// [120] BrackettedExpression ::= '(' Expression ')'
|
|
|
|
inner: Box<Expression>, |
|
|
|
inner: Box<Expression>, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1459,61 +1459,61 @@ impl fmt::Display for BrackettedExpression { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
enum BuiltInCall { |
|
|
|
enum BuiltInCall { |
|
|
|
// [121] BuiltInCall ::= Aggregate
|
|
|
|
// [121] BuiltInCall ::= Aggregate
|
|
|
|
// | 'STR' '(' Expression ')'
|
|
|
|
// | 'STR' '(' Expression ')'
|
|
|
|
// | 'LANG' '(' Expression ')'
|
|
|
|
// | 'LANG' '(' Expression ')'
|
|
|
|
// | 'LANGMATCHES' '(' Expression ',' Expression ')'
|
|
|
|
// | 'LANGMATCHES' '(' Expression ',' Expression ')'
|
|
|
|
// | 'DATATYPE' '(' Expression ')'
|
|
|
|
// | 'DATATYPE' '(' Expression ')'
|
|
|
|
// | 'BOUND' '(' Var ')'
|
|
|
|
// | 'BOUND' '(' Var ')'
|
|
|
|
// | 'IRI' '(' Expression ')'
|
|
|
|
// | 'IRI' '(' Expression ')'
|
|
|
|
// | 'URI' '(' Expression ')'
|
|
|
|
// | 'URI' '(' Expression ')'
|
|
|
|
// | 'BNODE' ( '(' Expression ')' | NIL )
|
|
|
|
// | 'BNODE' ( '(' Expression ')' | NIL )
|
|
|
|
// | 'RAND' NIL
|
|
|
|
// | 'RAND' NIL
|
|
|
|
// | 'ABS' '(' Expression ')'
|
|
|
|
// | 'ABS' '(' Expression ')'
|
|
|
|
// | 'CEIL' '(' Expression ')'
|
|
|
|
// | 'CEIL' '(' Expression ')'
|
|
|
|
// | 'FLOOR' '(' Expression ')'
|
|
|
|
// | 'FLOOR' '(' Expression ')'
|
|
|
|
// | 'ROUND' '(' Expression ')'
|
|
|
|
// | 'ROUND' '(' Expression ')'
|
|
|
|
// | 'CONCAT' ExpressionList
|
|
|
|
// | 'CONCAT' ExpressionList
|
|
|
|
// | SubstringExpression
|
|
|
|
// | SubstringExpression
|
|
|
|
// | 'STRLEN' '(' Expression ')'
|
|
|
|
// | 'STRLEN' '(' Expression ')'
|
|
|
|
// | StrReplaceExpression
|
|
|
|
// | StrReplaceExpression
|
|
|
|
// | 'UCASE' '(' Expression ')'
|
|
|
|
// | 'UCASE' '(' Expression ')'
|
|
|
|
// | 'LCASE' '(' Expression ')'
|
|
|
|
// | 'LCASE' '(' Expression ')'
|
|
|
|
// | 'ENCODE_FOR_URI' '(' Expression ')'
|
|
|
|
// | 'ENCODE_FOR_URI' '(' Expression ')'
|
|
|
|
// | 'CONTAINS' '(' Expression ',' Expression ')'
|
|
|
|
// | 'CONTAINS' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRSTARTS' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRSTARTS' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRENDS' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRENDS' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRBEFORE' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRBEFORE' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRAFTER' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRAFTER' '(' Expression ',' Expression ')'
|
|
|
|
// | 'YEAR' '(' Expression ')'
|
|
|
|
// | 'YEAR' '(' Expression ')'
|
|
|
|
// | 'MONTH' '(' Expression ')'
|
|
|
|
// | 'MONTH' '(' Expression ')'
|
|
|
|
// | 'DAY' '(' Expression ')'
|
|
|
|
// | 'DAY' '(' Expression ')'
|
|
|
|
// | 'HOURS' '(' Expression ')'
|
|
|
|
// | 'HOURS' '(' Expression ')'
|
|
|
|
// | 'MINUTES' '(' Expression ')'
|
|
|
|
// | 'MINUTES' '(' Expression ')'
|
|
|
|
// | 'SECONDS' '(' Expression ')'
|
|
|
|
// | 'SECONDS' '(' Expression ')'
|
|
|
|
// | 'TIMEZONE' '(' Expression ')'
|
|
|
|
// | 'TIMEZONE' '(' Expression ')'
|
|
|
|
// | 'TZ' '(' Expression ')'
|
|
|
|
// | 'TZ' '(' Expression ')'
|
|
|
|
// | 'NOW' NIL
|
|
|
|
// | 'NOW' NIL
|
|
|
|
// | 'UUID' NIL
|
|
|
|
// | 'UUID' NIL
|
|
|
|
// | 'STRUUID' NIL
|
|
|
|
// | 'STRUUID' NIL
|
|
|
|
// | 'MD5' '(' Expression ')'
|
|
|
|
// | 'MD5' '(' Expression ')'
|
|
|
|
// | 'SHA1' '(' Expression ')'
|
|
|
|
// | 'SHA1' '(' Expression ')'
|
|
|
|
// | 'SHA256' '(' Expression ')'
|
|
|
|
// | 'SHA256' '(' Expression ')'
|
|
|
|
// | 'SHA384' '(' Expression ')'
|
|
|
|
// | 'SHA384' '(' Expression ')'
|
|
|
|
// | 'SHA512' '(' Expression ')'
|
|
|
|
// | 'SHA512' '(' Expression ')'
|
|
|
|
// | 'COALESCE' ExpressionList
|
|
|
|
// | 'COALESCE' ExpressionList
|
|
|
|
// | 'IF' '(' Expression ',' Expression ',' Expression ')'
|
|
|
|
// | 'IF' '(' Expression ',' Expression ',' Expression ')'
|
|
|
|
// | 'STRLANG' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRLANG' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRDT' '(' Expression ',' Expression ')'
|
|
|
|
// | 'STRDT' '(' Expression ',' Expression ')'
|
|
|
|
// | 'sameTerm' '(' Expression ',' Expression ')'
|
|
|
|
// | 'sameTerm' '(' Expression ',' Expression ')'
|
|
|
|
// | 'isIRI' '(' Expression ')'
|
|
|
|
// | 'isIRI' '(' Expression ')'
|
|
|
|
// | 'isURI' '(' Expression ')'
|
|
|
|
// | 'isURI' '(' Expression ')'
|
|
|
|
// | 'isBLANK' '(' Expression ')'
|
|
|
|
// | 'isBLANK' '(' Expression ')'
|
|
|
|
// | 'isLITERAL' '(' Expression ')'
|
|
|
|
// | 'isLITERAL' '(' Expression ')'
|
|
|
|
// | 'isNUMERIC' '(' Expression ')'
|
|
|
|
// | 'isNUMERIC' '(' Expression ')'
|
|
|
|
// | RegexExpression
|
|
|
|
// | RegexExpression
|
|
|
|
// | ExistsFunc
|
|
|
|
// | ExistsFunc
|
|
|
|
// | NotExistsFunc
|
|
|
|
// | NotExistsFunc
|
|
|
|
Str(Box<Expression>), |
|
|
|
Str(Box<Expression>), |
|
|
|
Lang(Box<Expression>), |
|
|
|
Lang(Box<Expression>), |
|
|
|
Datatype(Box<Expression>), |
|
|
|
Datatype(Box<Expression>), |
|
|
@ -1559,7 +1559,7 @@ impl fmt::Display for BuiltInCall { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct ExistsFunc { |
|
|
|
struct ExistsFunc { |
|
|
|
// [125] ExistsFunc ::= 'EXISTS' GroupGraphPattern
|
|
|
|
// [125] ExistsFunc ::= 'EXISTS' GroupGraphPattern
|
|
|
|
pattern: GroupGraphPattern, |
|
|
|
pattern: GroupGraphPattern, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1571,7 +1571,7 @@ impl fmt::Display for ExistsFunc { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct NotExistsFunc { |
|
|
|
struct NotExistsFunc { |
|
|
|
// [126] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern
|
|
|
|
// [126] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern
|
|
|
|
pattern: GroupGraphPattern, |
|
|
|
pattern: GroupGraphPattern, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1583,7 +1583,7 @@ impl fmt::Display for NotExistsFunc { |
|
|
|
|
|
|
|
|
|
|
|
#[derive(Arbitrary)] |
|
|
|
#[derive(Arbitrary)] |
|
|
|
struct IriOrFunction { |
|
|
|
struct IriOrFunction { |
|
|
|
// [128] iriOrFunction ::= iri ArgList?
|
|
|
|
// [128] iriOrFunction ::= iri ArgList?
|
|
|
|
iri: Iri, |
|
|
|
iri: Iri, |
|
|
|
// TODO args: Option<ArgList>,
|
|
|
|
// TODO args: Option<ArgList>,
|
|
|
|
} |
|
|
|
} |
|
|
@ -1599,12 +1599,12 @@ impl fmt::Display for IriOrFunction { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct Literal { |
|
|
|
struct Literal { |
|
|
|
// [129] RDFLiteral ::= String ( LANGTAG | ( '^^' iri ) )?
|
|
|
|
// [129] RDFLiteral ::= String ( LANGTAG | ( '^^' iri ) )?
|
|
|
|
// [130] NumericLiteral ::= NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative
|
|
|
|
// [130] NumericLiteral ::= NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative
|
|
|
|
// [131] NumericLiteralUnsigned ::= INTEGER | DECIMAL | DOUBLE
|
|
|
|
// [131] NumericLiteralUnsigned ::= INTEGER | DECIMAL | DOUBLE
|
|
|
|
// [132] NumericLiteralPositive ::= INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE
|
|
|
|
// [132] NumericLiteralPositive ::= INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE
|
|
|
|
// [133] NumericLiteralNegative ::= INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE
|
|
|
|
// [133] NumericLiteralNegative ::= INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE
|
|
|
|
// [134] BooleanLiteral ::= 'true' | 'false'
|
|
|
|
// [134] BooleanLiteral ::= 'true' | 'false'
|
|
|
|
value: &'static str, |
|
|
|
value: &'static str, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1627,7 +1627,7 @@ impl fmt::Display for Literal { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct Iri { |
|
|
|
struct Iri { |
|
|
|
// [136] iri ::= IRIREF | PrefixedName
|
|
|
|
// [136] iri ::= IRIREF | PrefixedName
|
|
|
|
value: u8, |
|
|
|
value: u8, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|