|
|
@ -280,7 +280,8 @@ impl fmt::Display for Expression { |
|
|
|
Expression::DatatypeFunctionCall(e) => write!(f, "DATATYPE({})", e), |
|
|
|
Expression::DatatypeFunctionCall(e) => write!(f, "DATATYPE({})", e), |
|
|
|
Expression::BoundFunctionCall(v) => write!(f, "BOUND({})", v), |
|
|
|
Expression::BoundFunctionCall(v) => write!(f, "BOUND({})", v), |
|
|
|
Expression::IRIFunctionCall(e) => write!(f, "IRI({})", e), |
|
|
|
Expression::IRIFunctionCall(e) => write!(f, "IRI({})", e), |
|
|
|
Expression::BNodeFunctionCall(v) => v.as_ref() |
|
|
|
Expression::BNodeFunctionCall(v) => v |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|id| write!(f, "BOUND({})", id)) |
|
|
|
.map(|id| write!(f, "BOUND({})", id)) |
|
|
|
.unwrap_or_else(|| write!(f, "BOUND()")), |
|
|
|
.unwrap_or_else(|| write!(f, "BOUND()")), |
|
|
|
Expression::RandFunctionCall() => write!(f, "RAND()"), |
|
|
|
Expression::RandFunctionCall() => write!(f, "RAND()"), |
|
|
@ -296,11 +297,13 @@ impl fmt::Display for Expression { |
|
|
|
.collect::<Vec<String>>() |
|
|
|
.collect::<Vec<String>>() |
|
|
|
.join(", ") |
|
|
|
.join(", ") |
|
|
|
), |
|
|
|
), |
|
|
|
Expression::SubStrFunctionCall(a, b, c) => c.as_ref() |
|
|
|
Expression::SubStrFunctionCall(a, b, c) => c |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|cv| write!(f, "SUBSTR({}, {}, {})", a, b, cv)) |
|
|
|
.map(|cv| write!(f, "SUBSTR({}, {}, {})", a, b, cv)) |
|
|
|
.unwrap_or_else(|| write!(f, "SUBSTR({}, {})", a, b)), |
|
|
|
.unwrap_or_else(|| write!(f, "SUBSTR({}, {})", a, b)), |
|
|
|
Expression::StrLenFunctionCall(e) => write!(f, "STRLEN({})", e), |
|
|
|
Expression::StrLenFunctionCall(e) => write!(f, "STRLEN({})", e), |
|
|
|
Expression::ReplaceFunctionCall(a, b, c, d) => d.as_ref() |
|
|
|
Expression::ReplaceFunctionCall(a, b, c, d) => d |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|dv| write!(f, "REPLACE({}, {}, {}, {})", a, b, c, dv)) |
|
|
|
.map(|dv| write!(f, "REPLACE({}, {}, {}, {})", a, b, c, dv)) |
|
|
|
.unwrap_or_else(|| write!(f, "REPLACE({}, {}, {})", a, b, c)), |
|
|
|
.unwrap_or_else(|| write!(f, "REPLACE({}, {}, {})", a, b, c)), |
|
|
|
Expression::UCaseFunctionCall(e) => write!(f, "UCASE({})", e), |
|
|
|
Expression::UCaseFunctionCall(e) => write!(f, "UCASE({})", e), |
|
|
@ -342,7 +345,8 @@ impl fmt::Display for Expression { |
|
|
|
Expression::IsBlankFunctionCall(e) => write!(f, "isBLANK({})", e), |
|
|
|
Expression::IsBlankFunctionCall(e) => write!(f, "isBLANK({})", e), |
|
|
|
Expression::IsLiteralFunctionCall(e) => write!(f, "isLITERAL({})", e), |
|
|
|
Expression::IsLiteralFunctionCall(e) => write!(f, "isLITERAL({})", e), |
|
|
|
Expression::IsNumericFunctionCall(e) => write!(f, "isNUMERIC({})", e), |
|
|
|
Expression::IsNumericFunctionCall(e) => write!(f, "isNUMERIC({})", e), |
|
|
|
Expression::RegexFunctionCall(a, b, c) => c.as_ref() |
|
|
|
Expression::RegexFunctionCall(a, b, c) => c |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|cv| write!(f, "REGEX({}, {}, {})", a, b, cv)) |
|
|
|
.map(|cv| write!(f, "REGEX({}, {}, {})", a, b, cv)) |
|
|
|
.unwrap_or_else(|| write!(f, "REGEX({}, {})", a, b)), |
|
|
|
.unwrap_or_else(|| write!(f, "REGEX({}, {})", a, b)), |
|
|
|
Expression::CustomFunctionCall(iri, args) => write!( |
|
|
|
Expression::CustomFunctionCall(iri, args) => write!( |
|
|
@ -471,7 +475,8 @@ impl<'a> fmt::Display for SparqlExpression<'a> { |
|
|
|
Expression::DatatypeFunctionCall(e) => write!(f, "DATATYPE({})", SparqlExpression(&*e)), |
|
|
|
Expression::DatatypeFunctionCall(e) => write!(f, "DATATYPE({})", SparqlExpression(&*e)), |
|
|
|
Expression::BoundFunctionCall(v) => write!(f, "BOUND({})", v), |
|
|
|
Expression::BoundFunctionCall(v) => write!(f, "BOUND({})", v), |
|
|
|
Expression::IRIFunctionCall(e) => write!(f, "IRI({})", SparqlExpression(&*e)), |
|
|
|
Expression::IRIFunctionCall(e) => write!(f, "IRI({})", SparqlExpression(&*e)), |
|
|
|
Expression::BNodeFunctionCall(v) => v.as_ref() |
|
|
|
Expression::BNodeFunctionCall(v) => v |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|id| write!(f, "BOUND({})", SparqlExpression(&*id))) |
|
|
|
.map(|id| write!(f, "BOUND({})", SparqlExpression(&*id))) |
|
|
|
.unwrap_or_else(|| write!(f, "BOUND()")), |
|
|
|
.unwrap_or_else(|| write!(f, "BOUND()")), |
|
|
|
Expression::RandFunctionCall() => write!(f, "RAND()"), |
|
|
|
Expression::RandFunctionCall() => write!(f, "RAND()"), |
|
|
@ -487,7 +492,8 @@ impl<'a> fmt::Display for SparqlExpression<'a> { |
|
|
|
.collect::<Vec<String>>() |
|
|
|
.collect::<Vec<String>>() |
|
|
|
.join(", ") |
|
|
|
.join(", ") |
|
|
|
), |
|
|
|
), |
|
|
|
Expression::SubStrFunctionCall(a, b, c) => c.as_ref() |
|
|
|
Expression::SubStrFunctionCall(a, b, c) => c |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|cv| { |
|
|
|
.map(|cv| { |
|
|
|
write!( |
|
|
|
write!( |
|
|
|
f, |
|
|
|
f, |
|
|
@ -506,7 +512,8 @@ impl<'a> fmt::Display for SparqlExpression<'a> { |
|
|
|
) |
|
|
|
) |
|
|
|
}), |
|
|
|
}), |
|
|
|
Expression::StrLenFunctionCall(e) => write!(f, "STRLEN({})", SparqlExpression(&*e)), |
|
|
|
Expression::StrLenFunctionCall(e) => write!(f, "STRLEN({})", SparqlExpression(&*e)), |
|
|
|
Expression::ReplaceFunctionCall(a, b, c, d) => d.as_ref() |
|
|
|
Expression::ReplaceFunctionCall(a, b, c, d) => d |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|dv| { |
|
|
|
.map(|dv| { |
|
|
|
write!( |
|
|
|
write!( |
|
|
|
f, |
|
|
|
f, |
|
|
@ -617,7 +624,8 @@ impl<'a> fmt::Display for SparqlExpression<'a> { |
|
|
|
Expression::IsNumericFunctionCall(e) => { |
|
|
|
Expression::IsNumericFunctionCall(e) => { |
|
|
|
write!(f, "isNUMERIC({})", SparqlExpression(&*e)) |
|
|
|
write!(f, "isNUMERIC({})", SparqlExpression(&*e)) |
|
|
|
} |
|
|
|
} |
|
|
|
Expression::RegexFunctionCall(a, b, c) => c.as_ref() |
|
|
|
Expression::RegexFunctionCall(a, b, c) => c |
|
|
|
|
|
|
|
.as_ref() |
|
|
|
.map(|cv| { |
|
|
|
.map(|cv| { |
|
|
|
write!( |
|
|
|
write!( |
|
|
|
f, |
|
|
|
f, |
|
|
|