예제 #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;
 }