public void ProcessCommunicationToGraphDBTest() { var testEmail = JsonConvert.DeserializeObject <TagsSearchByTagStartTokenOrdinal>(File.ReadAllText(@"[REPO_ROOT]\CELA-Tagulous_Parsing_Service\CELA-Tags_Parsing_ServiceTests\TestRequests\TestRequest11.json")); var result = CommunicationProcessingBusinessLogic.ProcessCommunicationToGraphDB(testEmail, KnowledgeManagementDataServicesTestSettings.GraphDBHostName, KnowledgeManagementDataServicesTestSettings.GraphDBPort, KnowledgeManagementDataServicesTestSettings.GraphDBAuthKey, KnowledgeManagementDataServicesTestSettings.GraphDBDatabaseName, KnowledgeManagementDataServicesTestSettings.GraphDBCollectionName); if (!result) { Assert.Fail(); } }
public CommunicationGraphModel(EmailSearch Communication) { if (Communication.EmailSender != null && Communication.EmailSender.Length > 0) { CommunicationSender = Communication.EmailSender.ToLower(); } if (Communication.EmailToRecipients != null && Communication.EmailToRecipients.Length > 0) { ToRecipients = CommunicationProcessingBusinessLogic.ParseConcatenatedString(Communication.EmailToRecipients, CommunicationAddressDelimiter); } if (Communication.EmailCcRecipients != null && Communication.EmailCcRecipients.Length > 0) { CcRecipients = CommunicationProcessingBusinessLogic.ParseConcatenatedString(Communication.EmailCcRecipients, CommunicationAddressDelimiter); } if (Communication.EmailTagCluster != null && Communication.EmailTagCluster.Length > 0) { Tags = CommunicationProcessingBusinessLogic.ParseConcatenatedString(Communication.EmailTagCluster, TagDelimiter); } }
public void CommunicatorInsertionTest() { using (var gremlinClient = CommunicationProcessingBusinessLogic.CreateGremlinClient(KnowledgeManagementDataServicesTestSettings.GraphDBHostName, KnowledgeManagementDataServicesTestSettings.GraphDBPort, KnowledgeManagementDataServicesTestSettings.GraphDBAuthKey, KnowledgeManagementDataServicesTestSettings.GraphDBDatabaseName, KnowledgeManagementDataServicesTestSettings.GraphDBCollectionName)) { string emailAddress = "*****@*****.**"; //string deletionQuery = string.Format("g.V().hasLabel('communicator').has('name', '{0}').drop()", emailAddress); string ID1 = CommunicationProcessingBusinessLogic.AddCommunicatorAndOrganization(emailAddress, gremlinClient); string ID2 = CommunicationProcessingBusinessLogic.AddCommunicatorAndOrganization(emailAddress, gremlinClient); //We should not have duplicate insertions, so the first insertion should succeed, and the second query should return the ID of the first as an existing if (ID1.CompareTo(ID2) != 0) { Assert.Fail(); } } }
// Starts a console application that executes every Gremlin query in the gremlinQueries dictionary. static void Main(string[] args) { Console.WriteLine(string.Format("Retrieving tagged communications from {0}.", CommunicationProcessingBusinessLogic.GetStorageEndpoint())); var communications = CommunicationProcessingBusinessLogic.RetrieveEmailsAsync().Result; Console.WriteLine(string.Format("Processing communications to {0}", StorageUtility.GetInstance().GetHostname())); int counter = 1; foreach (var communication in communications) { Console.WriteLine(String.Format("Processing communication {0} of {1}.", counter, communications.Count)); StorageUtility.GetInstance().StoreEmailToGraphStorage(communication); counter++; } // Exit program Console.WriteLine("Done. Press any key to exit..."); Console.ReadLine(); }
public void StoreDocumentToGraphStorage(Document document) { var communicationProcessor = CommunicationProcessingBusinessLogic.ProcessDocumentToGraphDB(document, graphDBHostName, graphDBPort, graphDBAccessKey, graphDBDatabaseName, graphDBCollectionName); }
public void StoreEmailToGraphStorage(EmailSearch communication) { var communicationProcessor = CommunicationProcessingBusinessLogic.ProcessCommunicationToGraphDB(communication, graphDBHostName, graphDBPort, graphDBAccessKey, graphDBDatabaseName, graphDBCollectionName); }