public void Assert(IGraph graph) { foreach (var t in graph.Triples) { Asserted.Add(new Tuple <INode, INode, INode, Uri>(t.Subject, t.Predicate, t.Object, graph.BaseUri)); } }
public void Assert(INode subject, INode predicate, INode obj, Uri graph) { Asserted.Add(new Tuple <INode, INode, INode, Uri>(subject, predicate, obj, graph)); var t = new Triple(subject, predicate, obj, graph); if (_triplesBySubject.TryGetValue(subject, out var triples)) { triples.Add(t); } else { _triplesBySubject.Add(t.Subject, new List <Triple> { t }); } if (_triplesByObject.TryGetValue(obj, out var triples2)) { triples2.Add(t); } else { _triplesByObject.Add(t.Object, new List <Triple> { t }); } Flushed = false; }
public bool Assert(Triple t) { bool previouslyRetracted = Retracted.Remove(t); if (_innerGraph.Assert(t)) { if (!previouslyRetracted) { Asserted.Add(t); } return(true); } else { return(false); } }