/// <summary>
        /// Adds a new triple to the graph.
        /// </summary>
        /// <param name="subject">The triple subject.</param>
        /// <param name="predicate">The triple predicate.</param>
        /// <param name="object">The triple object.</param>
        /// <returns>The newly added triple.</returns>
        /// <exception cref="ArgumentNullException">Any of the arguments is <see langword="null"/>.</exception>
        public Triple AddTriple(PropertyPathEnd subject, TriplePredicate predicate, PropertyPathEnd @object)
        {
            Triple newTriple = new Triple(subject, predicate, @object);

            newTriple.Owner = this;
            statements.Add(newTriple);
            return(newTriple);
        }
Example #2
0
        internal Triple(PropertyPathEnd subject, TriplePredicate predicate, PropertyPathEnd @object)
        {
            if (subject == null)
            {
                throw new ArgumentNullException("subject");
            }
            if (predicate == null)
            {
                throw new ArgumentNullException("predicate");
            }
            if (@object == null)
            {
                throw new ArgumentNullException("object");
            }

            this.tripleSubject   = subject;
            this.triplePredicate = predicate;
            this.tripleObject    = @object;
        }
 /// <summary>
 /// Adds a new triple, whose subject and object are variable references, to the graph.
 /// </summary>
 /// <param name="subject">The triple subject.</param>
 /// <param name="predicate">The triple predicate.</param>
 /// <param name="object">The triple object.</param>
 /// <returns>The newly added triple.</returns>
 /// <exception cref="ArgumentNullException">Any of the arguments is <see langword="null"/>.</exception>
 public Triple AddTriple(Variable subject, TriplePredicate predicate, Variable @object)
 {
     return(AddTriple(new VariableEnd(subject),
                      predicate,
                      new VariableEnd(@object)));
 }
 /// <summary>
 /// Adds a new triple, whose object is a variable reference, to the graph.
 /// </summary>
 /// <param name="subject">The triple subject.</param>
 /// <param name="predicate">The triple predicate.</param>
 /// <param name="object">The triple object.</param>
 /// <returns>The newly added triple.</returns>
 /// <exception cref="ArgumentNullException">Any of the arguments is <see langword="null"/>.</exception>
 public Triple AddTriple(PropertyPathEnd subject, TriplePredicate predicate, Variable @object)
 {
     return(AddTriple(subject,
                      predicate,
                      new VariableEnd(@object)));
 }
 /// <summary>
 /// Adds a new triple, whose subject is a variable reference, to the graph.
 /// </summary>
 /// <param name="subject">The triple subject.</param>
 /// <param name="predicate">The triple predicate.</param>
 /// <param name="object">The triple object.</param>
 /// <returns>The newly added triple.</returns>
 /// <exception cref="ArgumentNullException">Any of the arguments is <see langword="null"/>.</exception>
 public Triple AddTriple(Variable subject, TriplePredicate predicate, PropertyPathEnd @object)
 {
     return(AddTriple(new VariableEnd(subject),
                      predicate,
                      @object));
 }