GetProfileConnection() public method

public GetProfileConnection ( Profiles.Framework.Utilities.RDFTriple request, string storedproc ) : System.Data.SqlClient.SqlDataReader
request Profiles.Framework.Utilities.RDFTriple
storedproc string
return System.Data.SqlClient.SqlDataReader
示例#1
0
        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();
            }
        }
        protected virtual void SetConnectionData()
        {
            var dataIO = new Profiles.Profile.Utilities.DataIO();

            this.ConnectionDetails = new List <Publication>();

            // 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());
                    }

                    this.ConnectionDetails.Add(new Publication
                    {
                        PMID        = long.Parse(rdr["PMID"].ToString()),
                        Description = rdr["Reference"].ToString(),
                        Score       = double.Parse(rdr["OverallWeight"].ToString())
                    });

                    headerLoaded = true;
                }
            }
        }
        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());
                    }

                    this.ConnectionDetails.Add(new Publication
                    {
                        PMID = long.Parse(rdr["PMID"].ToString()),
                        Description = rdr["Reference"].ToString(),
                        Score = double.Parse(rdr["OverallWeight"].ToString())
                    });

                    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;
        }