/// <summary>
/// Adds the given column of bindings to the SPARQL values
/// </summary>
public RDFValues AddColumn(RDFVariable variable, List <RDFPatternMember> bindings)
{
if (variable != null)
{
//Initialize bindings of the given variable
if (!this.Bindings.ContainsKey(variable.ToString()))
{
this.Bindings.Add(variable.ToString(), new List <RDFPatternMember>());
}
//Populate bindings of the given variable
//(null indicates the special UNDEF binding)
if (bindings?.Any() ?? false)
{
bindings.ForEach(b => this.Bindings[variable.ToString()].Add((b is RDFResource || b is RDFLiteral) ? b : null));
}
else
{
this.Bindings[variable.ToString()].Add(null);
}
//Mark the SPARQL values as evaluable
this.IsEvaluable = true;
}
return(this);
}