示例#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);
 }
示例#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));
        }
示例#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);
        }
示例#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));
                    }
                }
            }
        }
示例#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));
                    }
                }
            }
        }
示例#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));
                    }
                }
            }
        }
示例#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);
        }
示例#8
0
 public void Assert(string s, string p, TripleObject o)
 {
     Assert(_spo, s, p, o);
 }
示例#9
0
 public IEnumerable <Triple> OS(TripleObject o, string s, Triple continuation)
 {
     throw new System.NotImplementedException();
 }
示例#10
0
 public IEnumerable <Triple> PO(string p, TripleObject o)
 {
     return(_read.PO(p, o).Concat(_write.PO(p, o)));
 }
示例#11
0
 public IEnumerable <Triple> OS(TripleObject o, string s)
 {
     return(_read.OS(o, s).Concat(_write.OS(o, s)));
 }
示例#12
0
 public IEnumerable <Triple> O(TripleObject o)
 {
     return(_read.O(o).Concat(_write.O(o)));
 }
示例#13
0
 public bool Retract(string s, string p, TripleObject o)
 {
     throw new NotImplementedException();
 }
示例#14
0
 public Triple(string s, string p, TripleObject o)
 {
     Subject   = s;
     Predicate = p;
     Object    = o;
 }