From 00f063bff856b22241e97b78c375dfa966af4a57 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 9 Oct 2016 18:08:32 +0200 Subject: [PATCH] [TASK] Reduce amount of windows. --- .../lu/jpt/csparqlproject/SimulationContext.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/lu/jpt/csparqlproject/SimulationContext.java b/src/main/java/lu/jpt/csparqlproject/SimulationContext.java index 363fc1a..868da3a 100644 --- a/src/main/java/lu/jpt/csparqlproject/SimulationContext.java +++ b/src/main/java/lu/jpt/csparqlproject/SimulationContext.java @@ -183,12 +183,16 @@ public class SimulationContext { RDFStreamFormatter rdfStreamFormatter = new RDFStreamFormatter(streamUri); engine.registerStream(rdfStreamFormatter); resultProxy.addObserver(rdfStreamFormatter); - Observer resultObserver = this.createResultObserverWindow(queryContainer.name); - resultProxy.addObserver(resultObserver); + if(queryContainer.useObserverWindow) { + Observer resultObserver = this.createResultObserverWindow(queryContainer.name); + resultProxy.addObserver(resultObserver); + } } else { - // If it is a regular query, just attach a fitting observer - Observer resultObserver = this.createResultObserverWindow(queryContainer.name); - resultProxy.addObserver(resultObserver); + // If it is a regular query, just attach a fitting observer, if enabled + if(queryContainer.useObserverWindow) { + Observer resultObserver = this.createResultObserverWindow(queryContainer.name); + resultProxy.addObserver(resultObserver); + } } // Attach custom observers to resultProxy if available // These are used for SPARQL UPDATE queries on local domain knowledge