Пример #1
0
 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));
     }
 }
Пример #2
0
        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;
        }
Пример #3
0
        public bool Assert(Triple t)
        {
            bool previouslyRetracted = Retracted.Remove(t);

            if (_innerGraph.Assert(t))
            {
                if (!previouslyRetracted)
                {
                    Asserted.Add(t);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }