Пример #1
0
        public static MatterGraphModel GetMatters(IGraphConfiguration GraphConfiguration)
        {
            using (var tagHiveClient = CommunicationProcessingBusinessLogic.CreateGremlinClient(GraphConfiguration))
            {
                string query   = GraphQueryBusinessLogic.GetMattersGraphQuery();
                var    results = CommunicationProcessingBusinessLogic.SubmitRequest(tagHiveClient, query).Result;

                var jsonString = JsonConvert.SerializeObject(results);
                return(JsonConvert.DeserializeObject <MatterGraphModel>(jsonString));
            }
        }
Пример #2
0
        public static DocumentGraphModelList GetDocumentsForTag(IGraphConfiguration GraphConfiguration, string Tag)
        {
            using (var tagHiveClient = CommunicationProcessingBusinessLogic.CreateGremlinClient(GraphConfiguration))
            {
                string query   = GraphQueryBusinessLogic.GetDocumentsForTagGraphQuery(Tag);
                var    results = CommunicationProcessingBusinessLogic.SubmitRequest(tagHiveClient, query).Result;

                var jsonString = JsonConvert.SerializeObject(results);
                return(JsonConvert.DeserializeObject <DocumentGraphModelList>(jsonString));
            }
        }
Пример #3
0
        public static List <string> GetTopicSenders(string Topic, IGraphConfiguration GraphConfiguration)
        {
            List <string> tagSenders = new List <string>();

            using (var tagHiveClient = CommunicationProcessingBusinessLogic.CreateGremlinClient(GraphConfiguration))
            {
                string query   = GraphQueryBusinessLogic.GetTopicSendersGraphQuery(Topic);
                var    results = CommunicationProcessingBusinessLogic.SubmitRequest(tagHiveClient, query).Result;
                if (results.Count > 0)
                {
                    foreach (var item in results)
                    {
                        //TagSender tagSender = JsonConvert.DeserializeObject<TagSender>(JsonConvert.SerializeObject(item));
                        tagSenders.Add(item);
                    }
                }
            }

            return(tagSenders);
        }
Пример #4
0
        public static List <TagRecipient> GetTopicRecipients(string Topic, IGraphConfiguration GraphConfiguration)
        {
            List <TagRecipient> tagRecipients = new List <TagRecipient>();

            using (var tagHiveClient = CommunicationProcessingBusinessLogic.CreateGremlinClient(GraphConfiguration))
            {
                //TODO Update this query to find most common recipients of the topic
                string query   = string.Format("g.V(\"{0}\").outE(\"recipient\")", Topic);
                var    results = CommunicationProcessingBusinessLogic.SubmitRequest(tagHiveClient, query).Result;
                if (results.Count > 0)
                {
                    foreach (var item in results)
                    {
                        TagRecipient tagRecipient = JsonConvert.DeserializeObject <TagRecipient>(JsonConvert.SerializeObject(item));
                        tagRecipients.Add(tagRecipient);
                    }
                }
            }

            return(tagRecipients);
        }
Пример #5
0
        public static Dictionary <string, int> GetTopicSendersWithSentValues(string Topic, IGraphConfiguration GraphConfiguration)
        {
            Dictionary <string, int> tagSenders = new Dictionary <string, int>();

            using (var tagHiveClient = CommunicationProcessingBusinessLogic.CreateGremlinClient(GraphConfiguration))
            {
                string query   = GraphQueryBusinessLogic.GetTopicSendersGraphQueryWithSentValues(Topic);
                var    results = CommunicationProcessingBusinessLogic.SubmitRequest(tagHiveClient, query).Result;
                if (results.Count > 0)
                {
                    foreach (var resultsetItem in results)
                    {
                        foreach (var item in resultsetItem)
                        {
                            tagSenders.Add(((KeyValuePair <string, object>)item).Key, int.Parse(((KeyValuePair <string, object>)item).Value.ToString()));
                        }
                    }
                }
            }

            return(tagSenders);
        }