ToString() 공개 메소드

Gives the string representation of the variable
public ToString ( ) : String
리턴 String
예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <summary>
 /// Adds the given variable to the results of the query
 /// </summary>
 public RDFSelectQuery AddProjectionVariable(RDFVariable projectionVariable)
 {
     if (projectionVariable != null)
     {
         if (!this.ProjectionVars.Any(pv => pv.Key.ToString().Equals(projectionVariable.ToString(), StringComparison.OrdinalIgnoreCase)))
         {
             this.ProjectionVars.Add(projectionVariable, this.ProjectionVars.Count);
         }
     }
     return(this);
 }
예제 #3
0
 /// <summary>
 /// Adds the given variable to the results of the query
 /// </summary>
 public RDFSelectQuery AddProjectionVariable(RDFVariable projectionVariable)
 {
     if (projectionVariable != null) {
         if (!this.ProjectionVars.Any(pv => pv.Key.ToString().Equals(projectionVariable.ToString(), StringComparison.OrdinalIgnoreCase))) {
              this.ProjectionVars.Add(projectionVariable, this.ProjectionVars.Count);
         }
     }
     return this;
 }