internal static List <ProbTuple> getAllTypleByRelationName(string relationname, int nTriples) { List <ProbTuple> probTuple = new List <ProbTuple>(); DataBase db = new DataBase(); DataTable dtb = db.GetDataTable("Select * From " + relationname); foreach (DataRow tuplerow in dtb.Rows) { ProbTuple NewTuple = new ProbTuple(); for (int i = 0; i < nTriples; i++) { ProbTriple NewTriple = new ProbTriple(tuplerow[i].ToString()); NewTuple.Triples.Add(NewTriple); } probTuple.Add(NewTuple); } return(probTuple); }
internal static List <BLL.ProbRelation> getAllRelation() { //"SELECT * FROM SystemRelation", "system_relation") List <ProbRelation> relations = new List <ProbRelation>(); DataBase db = new DataBase(); DataSet dts = new DataSet(); dts.Tables.Add(db.GetDataTable("SELECT * FROM SystemRelation", "system_relation")); foreach (DataRow row in dts.Tables["system_relation"].Rows) { string relationname = row[1].ToString(); int schemeID = Convert.ToInt16(row[2]); ProbScheme schemeName = new ProbScheme(schemeID).getSchemeById(); List <ProbTuple> probTuples = new List <ProbTuple>(); int nTriples = schemeName.Attributes.Count; probTuples = new ProbTuple().getAllTypleByRelationName(relationname, nTriples); ProbRelation relation = new ProbRelation(Convert.ToInt16(row[0]), relationname, probTuples, schemeName); relations.Add(relation); } return(relations); }
internal static void DeleteTypeById(ProbTuple probTuple) { }