protected override void SetConnectionData() { var dataIO = new Profiles.Profile.Utilities.DataIO(); // Loop through reader and fill object using (var rdr = dataIO.GetProfileConnection(new RDFTriple(this.Subject.NodeId, 0, this.Object.NodeId), this.StoredProcedureName)) { bool headerLoaded = false; while (rdr.Read()) { // Data is denormalized. Load header object once if (headerLoaded == false) { this.ConnectionStrength = double.Parse(rdr["TotalOverallWeight"].ToString()); } SimilarConcept sim = new SimilarConcept { MeshTerm = rdr["MeshHeader"].ToString(), OverallWeight = double.Parse(rdr["OverallWeight"].ToString()), ConceptProfile = rdr["ObjectURI"].ToString() }; sim.Subject.KeywordWeight = double.Parse(rdr["KeywordWeight1"].ToString()); sim.Subject.ConceptConnectionURI = rdr["ConnectionURI1"].ToString(); sim.Object.KeywordWeight = double.Parse(rdr["KeywordWeight2"].ToString()); sim.Object.ConceptConnectionURI = rdr["ConnectionURI2"].ToString(); this.ConnectionDetails.Add(sim); headerLoaded = true; } rdr.Close(); } }
public override IProfileConnection GetConnection() { var dataIO = new DataIO(); // Loop through reader and fill object using (var rdr = dataIO.GetProfileConnection(new RDFTriple(this.Subject.NodeId, 0, this.Object.NodeId), this.StoredProcedure)) { bool headerLoaded = false; while (rdr.Read()) { // Data is denormalized. Load header object once if (headerLoaded == false) { this.ConnectionStrength = double.Parse(rdr["TotalOverallWeight"].ToString()); } SimilarConcept concept = new SimilarConcept { MeshTerm = rdr["MeshHeader"].ToString(), OverallWeight = double.Parse(rdr["OverallWeight"].ToString()), ConceptProfile = rdr["ObjectURI"].ToString() }; concept.Subject.KeywordWeight = double.Parse(rdr["KeywordWeight1"].ToString()); concept.Subject.ConceptConnectionURI = rdr["ConnectionURI1"].ToString(); concept.Object.KeywordWeight = double.Parse(rdr["KeywordWeight2"].ToString()); concept.Object.ConceptConnectionURI = rdr["ConnectionURI2"].ToString(); this.ConnectionDetails.Add(concept); headerLoaded = true; } } return(this); }
public override IProfileConnection GetConnection() { var dataIO = new DataIO(); // Loop through reader and fill object using (var rdr = dataIO.GetProfileConnection(new RDFTriple(this.Subject.NodeId, 0, this.Object.NodeId), this.StoredProcedure)) { bool headerLoaded = false; while (rdr.Read()) { // Data is denormalized. Load header object once if (headerLoaded == false) { this.ConnectionStrength = double.Parse(rdr["TotalOverallWeight"].ToString()); } SimilarConcept concept = new SimilarConcept { MeshTerm = rdr["MeshHeader"].ToString(), OverallWeight = double.Parse(rdr["OverallWeight"].ToString()), ConceptProfile = rdr["ObjectURI"].ToString() }; concept.Subject.KeywordWeight = double.Parse(rdr["KeywordWeight1"].ToString()); concept.Subject.ConceptConnectionURI = rdr["ConnectionURI1"].ToString(); concept.Object.KeywordWeight = double.Parse(rdr["KeywordWeight2"].ToString()); concept.Object.ConceptConnectionURI = rdr["ConnectionURI2"].ToString(); this.ConnectionDetails.Add(concept); headerLoaded = true; } } return this; }