Example #1
0
 public bool Exists(string s, string p, TripleObject o)
 {
     if (_read.Exists(s, p, o) || _write.Exists(s, p, o))
     {
         return(true);
     }
     return(false);
 }
Example #2
0
        public bool Assert(string s, string p, TripleObject o)
        {
            if (_read.Exists(s, p, o))
            {
                return(false);
            }

            return(_write.Assert(s, p, o));
        }
Example #3
0
        public bool Exists(string ts, string tp, TripleObject to)
        {
            IDictionary <string, ISet <TripleObject> > po;

            if (_spo.TryGetValue(ts, out po))
            {
                ISet <TripleObject> o;
                if (po.TryGetValue(tp, out o))
                {
                    return(o.Contains(to));
                }
            }
            return(false);
        }
Example #4
0
        public IEnumerable <Triple> O(TripleObject to)
        {
            IDictionary <string, ISet <string> > sp;

            if (_osp.TryGetValue(to, out sp))
            {
                foreach (var s in sp)
                {
                    foreach (var p in s.Value)
                    {
                        yield return(new Triple(s.Key, p, to));
                    }
                }
            }
        }
Example #5
0
        public IEnumerable <Triple> PO(string tp, TripleObject to)
        {
            IDictionary <TripleObject, ISet <string> > os;

            if (_pos.TryGetValue(tp, out os))
            {
                ISet <string> s;
                if (os.TryGetValue(to, out s))
                {
                    foreach (var ts in s)
                    {
                        yield return(new Triple(ts, tp, to));
                    }
                }
            }
        }
Example #6
0
        public IEnumerable <Triple> OS(TripleObject to, string ts)
        {
            IDictionary <string, ISet <string> > sp;

            if (_osp.TryGetValue(to, out sp))
            {
                ISet <string> p;
                if (sp.TryGetValue(ts, out p))
                {
                    foreach (var tp in p)
                    {
                        yield return(new Triple(ts, tp, to));
                    }
                }
            }
        }
Example #7
0
        public bool Assert(string s, string p, TripleObject o)
        {
            if (s == null || p == null || o == null || o.IsNull)
            {
                return(false);
            }

            if (Assert(_spo, s, p, o))
            {
                if (Assert(_pos, p, o, s))
                {
                    if (Assert(_osp, o, s, p))
                    {
                        Count++;
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #8
0
 public void Assert(string s, string p, TripleObject o)
 {
     Assert(_spo, s, p, o);
 }
Example #9
0
 public IEnumerable <Triple> OS(TripleObject o, string s, Triple continuation)
 {
     throw new System.NotImplementedException();
 }
Example #10
0
 public IEnumerable <Triple> PO(string p, TripleObject o)
 {
     return(_read.PO(p, o).Concat(_write.PO(p, o)));
 }
Example #11
0
 public IEnumerable <Triple> OS(TripleObject o, string s)
 {
     return(_read.OS(o, s).Concat(_write.OS(o, s)));
 }
Example #12
0
 public IEnumerable <Triple> O(TripleObject o)
 {
     return(_read.O(o).Concat(_write.O(o)));
 }
Example #13
0
 public bool Retract(string s, string p, TripleObject o)
 {
     throw new NotImplementedException();
 }
Example #14
0
 public Triple(string s, string p, TripleObject o)
 {
     Subject   = s;
     Predicate = p;
     Object    = o;
 }