1using System.Collections;
2using System.Collections.Generic;
20 : this(VariableName,
Value, null)
32 this.Name = VariableName;
40 public string Name {
get; }
60 set => this.
SetValue(VariableName, value);
70 if (this.
Name == VariableName)
74 while (!(Loop is
null))
76 if (Loop.
Name == VariableName)
92 if (this.
Name == VariableName)
104 Loop.NextVariable.Value =
Value;
125 SortedDictionary<string, ISemanticElement> Sorted =
new SortedDictionary<string, ISemanticElement>();
133 StringBuilder sb =
new StringBuilder();
136 foreach (KeyValuePair<string, ISemanticElement> P2
in Sorted)
145 sb.Append(P2.Value.ToString());
148 return sb.ToString();
157 return new PossibilityEnumerator(
this);
164 IEnumerator IEnumerable.GetEnumerator()
166 return new PossibilityEnumerator(
this);
169 private class PossibilityEnumerator : IEnumerator<ISparqlResultItem>
171 private readonly Possibility first;
172 private Possibility current;
174 public PossibilityEnumerator(Possibility First)
181 object IEnumerator.Current => this.current;
183 public void Dispose() { }
185 public bool MoveNext()
187 if (this.current is
null)
188 this.current = this.first;
190 this.current = this.current.NextVariable;
192 return !(this.current is
null);
Represents a possible solution during SPARQL evaluation.
IEnumerator< ISparqlResultItem > GetEnumerator()
Gets an enumerator for all items in the possibility.
ISemanticElement GetValue(string VariableName)
Access to possible variable values, given a variable name.
string Name
Name of variable.
static string GetSortedDescription(Possibility P)
Gets a text description of the sorted set of possibilities, starting with a given possibility P .
void SetValue(string VariableName, ISemanticElement Value)
Sets a variable value, given its variable name.
ISemanticElement Value
Variable value.
Possibility NextVariable
Previous possiblity
override string ToString()
Shows the collection of possible values as a string.
Possibility(string VariableName, ISemanticElement Value, Possibility NextVariable)
Represents a possible solution during SPARQL evaluation.
Possibility(string VariableName, ISemanticElement Value)
Represents a possible solution during SPARQL evaluation.
Interface for semantic nodes.
Interface for items in a record from the results of a SPARQL query.
Interface for result records of a SPARQL query.