public void DrawProfilesModule()
        {
            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO dataIO = new Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO();

            // Get concept publication timeline
            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vil = dataIO.GetGoogleTimeline(base.RDFTriple, "[Profile.Module].[NetworkAuthorshipTimeline.Concept.GetData]");
            timeline.Src          = vil.src;
            timeline.Alt          = vil.alt;
            litTimelineTable.Text = vil.asText;


            /* Reader returns multiple result sets in the following order
             * 1) Cited publications
             * 2) Newest publication
             * 3) Oldest publications
             */
            using (var reader = dataIO.GetConceptPublications(base.RDFTriple))
            {
                List <string> htmlList     = new List <string>();
                StringBuilder html         = null;
                int           resultsetCnt = 0;
                do
                {
                    resultsetCnt++;
                    html = new StringBuilder();
                    while (reader.Read())
                    {
                        if (resultsetCnt == 3)                                                                                  // cited
                        {
                            html.AppendFormat(@"
								<li>
								<div>{0}</div>
								<div class='viewIn'>View in: <a href='//www.ncbi.nlm.nih.gov/pubmed/{1}' target='_new'>PubMed</a></div>	
								<div>Cited: {2}</div>						
								</li>
							"                            ,
                                              reader["reference"].ToString(),
                                              reader["pmid"].ToString(),
                                              reader["n"].ToString()
                                              );
                        }
                        else if (resultsetCnt == 1 || resultsetCnt == 2)                                // newest and oldest
                        {
                            html.AppendFormat(@"
								<li>
								<div>{0}</div>
								<div class='viewIn'>View in: <a href='//www.ncbi.nlm.nih.gov/pubmed/{1}' target='_new'>PubMed</a></div>							
								</li>
							"                            ,
                                              reader["reference"].ToString(),
                                              reader["pmid"].ToString()
                                              );
                        }
                    }
                    htmlList.Add(html.ToString());
                } while(reader.NextResult());                 // Next resultset

                reader.Close();

                if (htmlList.Count == 1)
                {
                    ShowOtherPub = false;
                    newest.Text  = htmlList[0];
                }
                else
                {
                    // For Catalyst site only until speed issue is resolved
                    ShowOtherPub = true;
                    newest.Text  = htmlList[0];
                    oldest.Text  = htmlList[1];
                    cited.Text   = htmlList[2];
                }
            }
        }
Exemple #2
0
        private void DrawProfilesModule()
        {
            DateTime d = DateTime.Now;

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO data = new Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO();
            List <Publication> publication = new List <Publication>();

            Utilities.DataIO.ClassType    type         = Utilities.DataIO.ClassType.Unknown;
            Framework.Utilities.Namespace xmlnamespace = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces   = xmlnamespace.LoadNamespaces(BaseData);

            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            //    type = Utilities.DataIO.ClassType.Person;
            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            type = Utilities.DataIO.ClassType.Group;

            using (SqlDataReader reader = data.GetPublications(base.RDFTriple, type))
            {
                while (reader.Read())
                {
                    publication.Add(new Publication(reader["bibo_pmid"].ToString(), reader["vivo_pmcid"].ToString(),
                                                    reader["prns_informationResourceReference"].ToString(), reader["vivo_webpage"].ToString(), Convert.ToInt32(reader["PMCCitations"]),
                                                    reader["Fields"].ToString(), Convert.ToInt32(reader["TranslationHumans"]), Convert.ToInt32(reader["TranslationAnimals"]),
                                                    Convert.ToInt32(reader["TranslationCells"]), Convert.ToInt32(reader["TranslationPublicHealth"]), Convert.ToInt32(reader["TranslationClinicalTrial"])));
                }

                rpPublication.DataSource = publication;
                rpPublication.DataBind();
            }

            // Get timeline bar chart
            string storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Person.GetData]";

            if (type == Utilities.DataIO.ClassType.Group)
            {
                storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Group.GetData]";
            }

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vil = data.GetGoogleTimeline(new RDFTriple(Convert.ToInt64(System.Configuration.ConfigurationManager.AppSettings["Search.PublicationsNodeID2"].ToString())), storedproc);
            timelineBar.Src       = vil.src;
            timelineBar.Alt       = vil.alt;
            litTimelineTable.Text = vil.asText;

            if (timelineBar.Src == "")
            {
                timelineBar.Visible = false;
            }


            // Login link
            //loginLiteral.Text = String.Format("<a href='{0}'>login</a>", Root.Domain + "/login/default.aspx?pin=send&method=login&edit=true");

            //if (type == Utilities.DataIO.ClassType.Group) divPubHeaderText.Visible = false;

            Framework.Utilities.DebugLogging.Log("PUBLICATION MODULE end Milliseconds:" + (DateTime.Now - d).TotalSeconds);
        }
        public void DrawProfilesModule()
        {
            string    countrycodes = string.Empty;
            DataIOMap dataIO       = new Search.Utilities.DataIOMap();

            string researchers = Newtonsoft.Json.JsonConvert.SerializeObject(dataIO.GetTopGeoResearchers());
            string countries   = Newtonsoft.Json.JsonConvert.SerializeObject(dataIO.GetCountryCounts());



            using (StreamReader sr = new StreamReader(Server.MapPath("~/Search/Modules/SearchMap/countries.json")))
            {
                countrycodes = sr.ReadToEnd();
            }

            litJS.Text = string.Format("<script>var countries = {0}; var researchers = {1};var countrycodes = {2};</script>", countries, researchers, countrycodes);

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO data = new Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO();
            List <Publication> publication = new List <Publication>();

            Profiles.Profile.Utilities.DataIO.ClassType type = Profiles.Profile.Utilities.DataIO.ClassType.Unknown;
            Framework.Utilities.Namespace xmlnamespace       = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces         = xmlnamespace.LoadNamespaces(BaseData);

            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            //    type = Utilities.DataIO.ClassType.Person;
            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            type = Profiles.Profile.Utilities.DataIO.ClassType.Group;

            using (SqlDataReader reader = data.GetPublications(base.RDFTriple, type))
            {
                while (reader.Read())
                {
                    publication.Add(new Publication(reader["bibo_pmid"].ToString(), reader["vivo_pmcid"].ToString(),
                                                    reader["prns_informationResourceReference"].ToString(), reader["vivo_webpage"].ToString(), Convert.ToInt32(reader["PMCCitations"]),
                                                    reader["Fields"].ToString(), Convert.ToInt32(reader["TranslationHumans"]), Convert.ToInt32(reader["TranslationAnimals"]),
                                                    Convert.ToInt32(reader["TranslationCells"]), Convert.ToInt32(reader["TranslationPublicHealth"]), Convert.ToInt32(reader["TranslationClinicalTrial"])));
                }

                rpPublication.DataSource = publication;
                rpPublication.DataBind();
            }

            // Get timeline bar chart
            string storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Person.GetData]";

            if (type == Profiles.Profile.Utilities.DataIO.ClassType.Group)
            {
                storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Group.GetData]";
            }

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vil      = data.GetGoogleTimeline(new RDFTriple(Convert.ToInt64(System.Configuration.ConfigurationManager.AppSettings["Search.PublicationsNodeID2"].ToString())), storedproc);
            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vilCOVID = data.GetGoogleTimelineCOVID(new RDFTriple(Convert.ToInt64(System.Configuration.ConfigurationManager.AppSettings["Search.PublicationsNodeID2"].ToString())), storedproc);
            timelineBarCOVID.Src  = vilCOVID.src;
            timelineBarCOVID.Alt  = vilCOVID.alt;
            timelineBar.Src       = vil.src;
            timelineBar.Alt       = vil.alt;
            litTimelineTable.Text = vil.asText;

            if (timelineBar.Src == "")
            {
                timelineBar.Visible = false;
            }


            // Login link
            //loginLiteral.Text = String.Format("<a href='{0}'>login</a>", Root.Domain + "/login/default.aspx?pin=send&method=login&edit=true");

            //if (type == Utilities.DataIO.ClassType.Group) divPubHeaderText.Visible = false;
        }