public bool Exists(string s, string p, TripleObject o) { if (_read.Exists(s, p, o) || _write.Exists(s, p, o)) { return(true); } return(false); }
public bool Assert(string s, string p, TripleObject o) { if (_read.Exists(s, p, o)) { return(false); } return(_write.Assert(s, p, o)); }
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); }
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)); } } } }
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)); } } } }
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)); } } } }
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); }
public void Assert(string s, string p, TripleObject o) { Assert(_spo, s, p, o); }
public IEnumerable <Triple> OS(TripleObject o, string s, Triple continuation) { throw new System.NotImplementedException(); }
public IEnumerable <Triple> PO(string p, TripleObject o) { return(_read.PO(p, o).Concat(_write.PO(p, o))); }
public IEnumerable <Triple> OS(TripleObject o, string s) { return(_read.OS(o, s).Concat(_write.OS(o, s))); }
public IEnumerable <Triple> O(TripleObject o) { return(_read.O(o).Concat(_write.O(o))); }
public bool Retract(string s, string p, TripleObject o) { throw new NotImplementedException(); }
public Triple(string s, string p, TripleObject o) { Subject = s; Predicate = p; Object = o; }