1using System.Collections.Generic;
2using System.Threading.Tasks;
13 private readonly
string[] variables;
22 : this(new string[] {
Variable }, ToRecords(Values))
28 List<ISemanticElement[]> Records =
new List<ISemanticElement[]>();
33 return Records.ToArray();
44 this.records = Records;
63 LinkedList<Possibility> Result =
new LinkedList<Possibility>();
65 int i, c = this.variables.Length;
67 if (ExistingMatches is
null)
71 for (i = 0; i < c; i++)
74 if (!(Element is
null))
75 Result.AddLast(
new Possibility(this.variables[i], Element));
90 for (i = 0; i < c; i++)
96 s = this.variables[i];
100 else if (!Element0.Equals(Element))
107 if (!(Extended is
null))
108 Result.AddLast(Extended);
113 return Task.FromResult<IEnumerable<Possibility>>(Result);
156 this.
ForAll(Callback, State, Order);
191 for (i = 0; i < c; i++)
200 if (!(NewNode is
null))
215 (c = this.variables.Length) != Typed.variables.Length ||
216 (d =
this.records.Length) != Typed.records.Length)
223 for (i = 0; i < c; i++)
225 if (!this.variables[i].
Equals(Typed.variables[i]))
229 for (j = 0; j < d; j++)
234 for (i = 0; i < c; i++)
239 if ((E1 is
null) ^ (E2 is
null))
242 if (!(E1 is
null) && !Rec1[i].
Equals(Rec2[i]))
253 int Result = base.GetHashCode();
255 foreach (
string s
in this.variables)
256 Result ^= Result << 5 ^ s.GetHashCode();
262 if (!(Element is
null))
263 Result ^= Result << 5 ^ Element.GetHashCode();
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.
A collection of predefined values
void SetParent(ScriptNode Parent)
Sets the parent node. Can only be used when expression is being parsed.
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