예제 #1
0
 public IEnumerable <int> GetObjBySubjPred0(int subj, int pred)
 {
     return(spo_o_index.GetAll(ent =>
     {
         int su = (int)ent.Field(0).Get();
         int cmp = su.CompareTo(subj);
         if (cmp != 0)
         {
             return cmp;
         }
         int pr = (int)ent.Field(1).Get();
         return pr.CompareTo(pred);
     })
            .Select(en => (int)en.Field(2).Get()));
 }
예제 #2
0
 public IEnumerable <int> GetSubjectByObjPred0(int obj, int pred)
 {
     return(op_o_index.GetAll(ent =>
     {
         int ob = (int)ent.Field(2).Get();
         int cmp = ob.CompareTo(obj);
         if (cmp != 0)
         {
             return cmp;
         }
         int pr = (int)ent.Field(1).Get();
         return pr.CompareTo(pred);
     })
            .Select(en => (int)en.Field(0).Get()));
 }
예제 #3
0
 public IEnumerable <string> GetObjBySubjPred(string subj, string pred)
 {
     return(spo_o_index.GetAll(ent =>
     {
         string su = (string)ent.Field(0).Get();
         int cmp = su.CompareTo(subj);
         if (cmp != 0)
         {
             return cmp;
         }
         string pr = (string)ent.Field(1).Get();
         return pr.CompareTo(pred);
     })
            .Select(en => (string)en.Field(2).Get()));
 }
예제 #4
0
 public IEnumerable <string> GetSubjectByObjPred(string obj, string pred)
 {
     return(op_o_index.GetAll(ent =>
     {
         string ob = (string)ent.Field(2).Get();
         int cmp = ob.CompareTo(obj);
         if (cmp != 0)
         {
             return cmp;
         }
         string pr = (string)ent.Field(1).Get();
         return pr.CompareTo(pred);
     })
            .Select(en => (string)en.Field(0).Get()));
 }
예제 #5
0
 public IEnumerable <Literal> GetDataBySubjPred0(int subj, int pred)
 {
     return(sp_d_index.GetAll(ent =>
     {
         int su = (int)ent.Field(0).Get();
         int cmp = su.CompareTo(subj);
         if (cmp != 0)
         {
             return cmp;
         }
         int pr = (int)ent.Field(1).Get();
         return pr.CompareTo(pred);
     })
            .Select(en =>
     {
         return PObjToLiteral(en.Field(2).Get());
     }));
 }
예제 #6
0
 public IEnumerable <Literal> GetDataBySubjPred(string subj, string pred)
 {
     return(sp_d_index.GetAll(ent =>
     {
         string su = (string)ent.Field(0).Get();
         int cmp = su.CompareTo(subj);
         if (cmp != 0)
         {
             return cmp;
         }
         string pr = (string)ent.Field(1).Get();
         return pr.CompareTo(pred);
     })
            .Select(en =>
     {
         object[] uni = (object[])en.Field(2).Get();
         Literal lit = new Literal();
         int vid = (int)uni[0];
         if (vid == 1)
         {
             lit.vid = LiteralVidEnumeration.integer; lit.value = (int)uni[1];
         }
         if (vid == 3)
         {
             lit.vid = LiteralVidEnumeration.date; lit.value = (long)uni[1];
         }
         else if (vid == 2)
         {
             lit.vid = LiteralVidEnumeration.text;
             object[] txt = (object[])uni[1];
             lit.value = new Text()
             {
                 s = (string)txt[0], l = (string)txt[1]
             };
         }
         return lit;
     }));
 }