2using System.Threading.Tasks;
14 private readonly
string[] variables;
23 : this(new string[] {
Variable }, ToRecords(Values))
45 this.records = Records;
66 int i, c = this.variables.Length;
68 if (ExistingMatches is
null)
72 for (i = 0; i < c; i++)
75 if (!(Element is
null))
91 for (i = 0; i < c; i++)
97 s = this.variables[i];
101 else if (!Element0.Equals(Element))
108 if (!(Extended is
null))
109 Result.
Add(Extended);
114 return Task.FromResult<IEnumerable<Possibility>>(Result);
157 this.
ForAll(Callback, State, Order);
192 for (i = 0; i < c; i++)
201 if (!(NewNode is
null))
216 (c = this.variables.Length) != Typed.variables.Length ||
217 (d =
this.records.Length) != Typed.records.Length)
224 for (i = 0; i < c; i++)
226 if (!this.variables[i].
Equals(Typed.variables[i]))
230 for (j = 0; j < d; j++)
235 for (i = 0; i < c; i++)
240 if ((E1 is
null) ^ (E2 is
null))
243 if (!(E1 is
null) && !Rec1[i].
Equals(Rec2[i]))
254 int Result = base.GetHashCode();
256 foreach (
string s
in this.variables)
257 Result ^= Result << 5 ^ s.GetHashCode();
263 if (!(Element is
null))
264 Result ^= Result << 5 ^ Element.GetHashCode();
A chunked list is a linked list of chunks of objects of type T .
void Add(T Item)
Adds an item to the collection.
T[] ToArray()
Returns an array containing all elements of the collection.
Base class for all nodes in a parsed script tree.
bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, bool DepthFirst)
Calls the callback method for all child nodes.
void SetParent(ScriptNode Parent)
Sets the parent node. Can only be used when expression is being parsed or created.
A collection of predefined values
void SetParent(ScriptNode Parent)
Sets the parent node. Can only be used when expression is being parsed or created.
override bool Equals(object obj)
ValuesPattern(string[] Variables, ISemanticElement[][] Records)
A collection of predefined values
ValuesPattern(string Variable, ISemanticElement[] Values)
A collection of predefined values
bool ForAll(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
override int GetHashCode()
Task< IEnumerable< Possibility > > Search(ISemanticCube Cube, Variables Variables, IEnumerable< Possibility > ExistingMatches, SparqlQuery Query)
Searches for the pattern on information in a semantic cube.
bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
bool IsEmpty
If pattern is empty.
Represents a possible solution during SPARQL evaluation.
ISemanticElement GetValue(string VariableName)
Access to possible variable values, given a variable name.
Semantic element based on script.
Contains information about a variable.
Interface for semantic cubes.
Interface for semantic nodes.
Interface for SPARQL patterns.
delegate bool ScriptNodeEventHandler(ScriptNode Node, out ScriptNode NewNode, object State)
Delegate for ScriptNode callback methods.
SearchMethod
Method to traverse the expression structure