Exemple #1
0
        /// <summary>Determines whether two PlainLiteralNode instances are equal.</summary>
        /// <returns>True if the two PlainLiteralNodes are equal, False otherwise</returns>
        /// <remarks>Two plain literal nodes are equal if they represent the same node. Two instances may be equivalent but not represent the same node</remarks>
        public override bool Equals(object other)
        {
            if (other == null)
            {
                return(false);
            }

            if (this.GetType() != other.GetType())
            {
                return(false);
            }
            if (GetHashCode() != other.GetHashCode())
            {
                return(false);
            }

            PlainLiteral specific = (PlainLiteral)other;

            if (!itsLexicalValue.Equals(specific.itsLexicalValue))
            {
                return(false);
            }

            if (itsLanguage == null && specific.itsLanguage != null)
            {
                return(false);
            }

            if (itsLanguage != null)
            {
                if (specific.itsLanguage == null)
                {
                    return(false);
                }

                if (!itsLanguage.Equals(specific.itsLanguage))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
 public virtual Statement MakeStatement(BlankNode subject, UriRef predicate, PlainLiteral value)
 {
     return(new Statement(subject, predicate, value));
 }