2using System.Collections.Generic;
15 private readonly
string[] variables;
16 private readonly
string[] alias;
19 private readonly
bool[] calculated;
20 private readonly
bool[] hasAlias;
21 private readonly
bool[] hasCalculatedAlias;
22 private readonly
int count;
34 this.count = GroupBy.
Length;
35 if (Names.
Length !=
this.count)
36 throw new ArgumentException(
"Array size mismatch.", nameof(Names));
38 this.expression = GroupBy;
39 this.aliasExpression = Names;
41 this.variables =
new string[this.count];
42 this.alias =
new string[this.count];
43 this.calculated =
new bool[this.count];
44 this.hasAlias =
new bool[this.count];
45 this.hasCalculatedAlias =
new bool[this.count];
47 for (i = 0; i < this.count; i++)
51 this.variables[i] = Ref.VariableName;
52 this.calculated[i] =
false;
55 this.calculated[i] =
true;
57 if (this.aliasExpression[i] is
null)
58 this.hasAlias[i] =
false;
61 this.alias[i] = Ref2.VariableName;
62 this.hasCalculatedAlias[i] =
false;
65 this.hasCalculatedAlias[i] =
true;
84 for (i = 0; i < this.count; i++)
86 e1 = this.GetValue(x, i);
87 e2 = this.GetValue(y, i);
109 if (!this.calculated[Index])
110 return Record[this.variables[Index]];
116 if (this.hasAlias[Index])
118 if (this.hasCalculatedAlias[Index])
123 Alias = EvaluateValue(this.aliasExpression[Index],
ObjectProperties)?.ToString();
126 Alias = this.alias[Index];
128 if (!(Alias is
null))
131 if (!(Result is
null))
139 Result = OrderResultSet.EvaluateElement(this.expression[Index],
ObjectProperties);
Script runtime exception.
IElement ReturnValue
Return value.
Class managing a script expression.
object Evaluate(Variables Variables)
Evaluates the expression, using the variables provided in the Variables collection....
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
Represents a variable reference.
Comparer for grouping a SPARQL result set.
int Compare(ISparqlResultRecord x, ISparqlResultRecord y)
Compares two records.
GroupResultSet(ScriptNode[] GroupBy, ScriptNode[] Names)
Comparer for grouping a SPARQL result set.
Interface for semantic nodes.
Interface for result records of a SPARQL query.