public void queryProcessor(Moederbord moederbordNode, CPU processorNode, GeheugenKaart geheugenNode, List <CPU> listProcessor) { // Example query to check how the system takes in the nodes and work with it. //To do, change //Create stopwatch to measure performance var watch = Stopwatch.StartNew(); initClientConnection(); var result = this.client.Cypher .Match(" (m:Moederbord)-[a]-(p:Processor), (m)-[c]->(g:Geheugen)") .Where((Moederbord m) => m.Geheugenslots == moederbordNode.Geheugenslots) .AndWhere((CPU p) => p.Model == processorNode.Model && p.Cores == processorNode.Cores) .AndWhere((GeheugenKaart g) => g.Geheugen == geheugenNode.Geheugen) .AndWhere("p.Kloksnelheid >= " + processorNode.MinimumKloksnelheid + " AND p.Kloksnelheid <= " + processorNode.MaximumKloksnelheid) .ReturnDistinct((p) => new { listP = p.As <CPU>(), }) .Results; foreach (var a in result) { listProcessor.Add(a.listP); } watch.Stop(); var elapsedMs = watch.ElapsedMilliseconds; Console.WriteLine("queryProcessor ElapsedMS: " + elapsedMs); }
public void queryBehuizing(Moederbord moederbordNode, List <Behuizing> listBehuizing) { // Example query to check how the system takes in the nodes and work with it. //Create stopwatch to measure performance var watch = Stopwatch.StartNew(); initClientConnection(); var result = this.client.Cypher .Match(" (m:Moederbord)-[a]-(b:Behuizing)") .Where((Moederbord m) => m.Geheugenslots == moederbordNode.Geheugenslots) .ReturnDistinct((b) => new { listB = b.As <Behuizing>(), }) .Limit(500) .Results; foreach (var a in result) { listBehuizing.Add(a.listB); } watch.Stop(); var elapsedMs = watch.ElapsedMilliseconds; Console.WriteLine("queryBehuizing ElapsedMS: " + elapsedMs); }
public void runAllQuery(SearchPropertiesModel searchPropertiesModel, List <Moederbord> ListNodeMoederbord, List <CPU> listProcessor, List <GeheugenKaart> listGeheugenkaart, List <Optischedrives> listNOptischedrives, List <Hardeschijf> listHardeschijf, List <GrafischeKaart> listGrafischekaart, List <CPUKoeler> listCPUKoeler, List <Voeding> listVoeding, List <Behuizing> listBehuizing) { //Create stopwatch to measure performance var watch = Stopwatch.StartNew(); //Create objects to pass in the followings function Moederbord moederbordNode = new Moederbord(); CPU processorNode = new CPU(); processorNode.Cores = "4"; processorNode.Model = "i5"; processorNode.MinimumKloksnelheid = 2; processorNode.MaximumKloksnelheid = 4; GeheugenKaart geheugenNode = new GeheugenKaart(); //geheugenNode.Geheugenslots; //geheugenNode.Geheugensnelheid; Hardeschijf hardeschijfNode = new Hardeschijf(); //hardeschijfNode.Soort; //hardeschijfNode.MinimumOpslag; //hardeschijfNode.MaximumOpslag; GrafischeKaart grafischekaartNode = new GrafischeKaart(); //grafischekaartNode.Videogeheugen; //grafischekaartNode.Typegeheugen; queryMoederbord(moederbordNode, processorNode, geheugenNode, ListNodeMoederbord); queryProcessor(moederbordNode, processorNode, geheugenNode, listProcessor); queryGeheugenKaart(moederbordNode, processorNode, geheugenNode, listGeheugenkaart); queryHardeschijf(hardeschijfNode, listHardeschijf); queryGrafischekaart(grafischekaartNode, listGrafischekaart); queryOptischedrive(listNOptischedrives); queryKoeler(processorNode, listCPUKoeler); queryVoeding(listVoeding); queryBehuizing(moederbordNode, listBehuizing); watch.Stop(); var elapsedMs = watch.ElapsedMilliseconds; Console.WriteLine("runAllQuery ElapsedMS: " + elapsedMs); }