Examples of ViewerPrefix


Examples of lupos.gui.operatorgraph.viewer.ViewerPrefix

    final ActionListener alEvaluate = new ActionListener() {
        @Override
    public void actionPerformed(final ActionEvent ae) {
          DocumentEditorPane.this.bottomPane.setSelectedIndex(2);
        try {
          ResultPanelHelper.appyRIFRules(DocumentEditorPane.this.rifCodeEditor.getTp_rifInput().getText(), DocumentEditorPane.this.rifEvaluator, new BooleanReference(false), new ViewerPrefix(false));
        } catch (final Exception e) {
          DocumentEditorPane.this.console.getTextArea().setText(e.getMessage());
          DocumentEditorPane.this.bottomPane.setSelectedIndex(1);
        }
View Full Code Here

Examples of lupos.gui.operatorgraph.viewer.ViewerPrefix

    final JButton bt_CondensedView = new JButton("Condense Data");
    bt_CondensedView.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {
        if (Demo_Applet.this.prefixInstance == null) {
          Demo_Applet.this.prefixInstance = new ViewerPrefix(Demo_Applet.this.usePrefixes.isTrue(), null);
        }
        final CondensedViewToolBar toolBar = new CondensedViewToolBar(
            Demo_Applet.this.tp_dataInput.getText(),
            Demo_Applet.this.prefixInstance);
        final CondensedViewViewer operatorGraphViewer1 = new CondensedViewViewer(
View Full Code Here

Examples of lupos.gui.operatorgraph.viewer.ViewerPrefix

          this.defaultGraphs = new LinkedList<URILiteral>();
          this.defaultGraphs.add(rdfURL);

          if (mode == EvaluationMode.DEMO
              || mode == EvaluationMode.TIMES) {
            this.prefixInstance = new ViewerPrefix(this.usePrefixes.isTrue());
            final long prepareInputData = evaluation.prepareInputData(this.defaultGraphs, new LinkedList<URILiteral>());

            try {
              System.out.println("Compile query...");
              try {
                final long compileQuery = evaluation.compileQuery(this.query);

                System.out.println("Logical optimization...");
                final long logicalOptimization = evaluator.logicalOptimization();

                System.out.println("Physical optimization...");
                final long physicalOptimization = evaluator.physicalOptimization();

                if (mode == EvaluationMode.DEMO) {
                  final EvaluationDemoToolBar bottomToolBar = new EvaluationDemoToolBar(this.webdemo != DEMO_ENUM.ECLIPSE);

                  final Result result = (evaluator instanceof BasicIndexRuleEvaluator)? ((BasicIndexRuleEvaluator)evaluator).getResultOperator() : ((CommonCoreQueryEvaluator<Node>)evaluator).getResultOperator();

                  final ShowResult sr = new ShowResult(bottomToolBar, result);

                  evaluator.prepareForQueryDebugSteps(bottomToolBar);

                  System.out.println("Evaluate query ...");
                  final Thread thread = new Thread() {
                    @Override
                    public void run() {
                      try {
                        evaluator.evaluateQueryDebugSteps(bottomToolBar, sr);
                        bottomToolBar.endOfEvaluation();
                        Demo_Applet.this.enableOrDisableButtons(evaluation instanceof SPARQLEvaluation);
                      } catch (final Exception e) {
                        System.err
                        .println(e);
                        e.printStackTrace();
                      }
                    }
                  };
                  bottomToolBar.setEvaluationThread(thread);
                  thread.start();

                  final BasicOperator root = (evaluator instanceof BasicIndexRuleEvaluator)? ((BasicIndexRuleEvaluator)evaluator).getRootNode() :((CommonCoreQueryEvaluator<Node>) evaluator).getRootNode();

                  this.operatorGraphViewer = new Viewer(
                      new GraphWrapperBasicOperator(
                          root),
                          this.prefixInstance,
                          "Evaluation Demo",
                          false,
                          this.webdemo != DEMO_ENUM.ECLIPSE,
                          bottomToolBar);
                  bottomToolBar.setOperatorGraphViewer(this.operatorGraphViewer);
                } else {

                  final JTextArea ta_prefixes = new JTextArea();
                  ta_prefixes.setEditable(false);
                  ta_prefixes.setFont(new Font("Courier New", Font.PLAIN, 12));

                  System.out.println("Evaluate query ...");
                  if(evaluator instanceof CommonCoreQueryEvaluator){
                    ((CommonCoreQueryEvaluator)evaluator).getResultOperator().addApplication(new IterateOneTimeThrough());
                  }

                  final long evaluateQuery = evaluator.evaluateQuery();
                  final int times = xpref.datatypes.IntegerDatatype.getFirstValue("repetitionsOfExecution");
                  if(times >1){
                    long compileQueryTime = 0;
                    long logicalOptimizationTime = 0;
                    long physicalOptimizationTime = 0;
                    long evaluateQueryTime = 0;
                    long totalTime = 0;
                    final long[] compileQueryTimeArray = new long[times];
                    final long[] logicalOptimizationTimeArray = new long[times];
                    final long[] physicalOptimizationTimeArray = new long[times];
                    final long[] evaluateQueryTimeArray = new long[times];
                    final long[] totalTimeArray = new long[times];
                    for (int i = 0; i < times; i++) {
                      compileQueryTimeArray[i] = evaluator.compileQuery(this.query);
                      compileQueryTime += compileQueryTimeArray[i];
                      logicalOptimizationTimeArray[i] = evaluator.logicalOptimization();
                      logicalOptimizationTime += logicalOptimizationTimeArray[i];
                      physicalOptimizationTimeArray[i] = evaluator.physicalOptimization();
                      physicalOptimizationTime += physicalOptimizationTimeArray[i];
                      if(evaluator instanceof CommonCoreQueryEvaluator){
                        ((CommonCoreQueryEvaluator)evaluator).getResultOperator().addApplication(new IterateOneTimeThrough());
                      }
                      evaluateQueryTimeArray[i] = evaluator.evaluateQuery();
                      evaluateQueryTime += evaluateQueryTimeArray[i];
                      totalTimeArray[i] = compileQueryTimeArray[i] + logicalOptimizationTimeArray[i] + physicalOptimizationTimeArray[i] + evaluateQueryTimeArray[i];
                      totalTime += totalTimeArray[i];
                    }
                    String result = "Evaluator " + this.cobo_evaluator.getSelectedItem().toString() + "\n\nBuild indices              : " + ((double) prepareInputData / 1000);
                    result += "\n\n(I) Time in seconds to compile query:\nAvg" + QueryEvaluator.toString(compileQueryTimeArray) + "/1000 = " + (((double) compileQueryTime) / times) / 1000;
                    result += "\nStandard deviation of the sample: " + QueryEvaluator.computeStandardDeviationOfTheSample(compileQueryTimeArray) / 1000;
                    result += "\nSample standard deviation       : " + QueryEvaluator.computeSampleStandardDeviation(compileQueryTimeArray) / 1000;
                    result += "\n\n(II) Time in seconds used for logical optimization:\nAvg" + QueryEvaluator.toString(logicalOptimizationTimeArray) + "/1000 = " + (((double) logicalOptimizationTime) / times) / 1000;
                    result += "\nStandard deviation of the sample: " + QueryEvaluator.computeStandardDeviationOfTheSample(logicalOptimizationTimeArray) / 1000;
                    result += "\nSample standard deviation       : " + QueryEvaluator.computeSampleStandardDeviation(logicalOptimizationTimeArray) / 1000;
                    result += "\n\n(III) Time in seconds used for physical optimization:\nAvg" + QueryEvaluator.toString(physicalOptimizationTimeArray) + "/1000 = " + (((double) physicalOptimizationTime) / times) / 1000;
                    result += "\nStandard deviation of the sample: " + QueryEvaluator.computeStandardDeviationOfTheSample(physicalOptimizationTimeArray) / 1000;
                    result += "\nSample standard deviation       : " + QueryEvaluator.computeSampleStandardDeviation(physicalOptimizationTimeArray) / 1000;
                    result += "\n\n(IV) Time in seconds to evaluate query:\nAvg" + QueryEvaluator.toString(evaluateQueryTimeArray) + "/1000 = " + (((double) evaluateQueryTime) / times) / 1000;
                    result += "\nStandard deviation of the sample: " + QueryEvaluator.computeStandardDeviationOfTheSample(evaluateQueryTimeArray) / 1000;
                    result += "\nSample standard deviation       : " + QueryEvaluator.computeSampleStandardDeviation(evaluateQueryTimeArray) / 1000;
                    result += "\n\nTotal time in seconds (I)+(II)+(III)+(IV):\nAvg" + QueryEvaluator.toString(totalTimeArray) + "/1000 = " + (((double) totalTime) / times) / 1000;
                    result += "\nStandard deviation of the sample: " + QueryEvaluator.computeStandardDeviationOfTheSample(totalTimeArray) / 1000;
                    result += "\nSample standard deviation       : " + QueryEvaluator.computeSampleStandardDeviation(totalTimeArray) / 1000;
                    ta_prefixes.setText(result);
                  } else {
                    ta_prefixes.setText("Evaluator "
                        + this.cobo_evaluator.getSelectedItem().toString()
                        + "\n\nBuild indices              : " + ((double) prepareInputData / 1000)
                        + "\n\nTotal time query processing: " + ((double) (compileQuery + logicalOptimization + physicalOptimization + evaluateQuery) / 1000)
                        + ((evaluator instanceof JenaQueryEvaluator || evaluator instanceof SesameQueryEvaluator) ? ""
                            : "\n    - Compile query        : "
                            + ((double) compileQuery / 1000)
                            + "\n    - Logical optimization : "
                            + ((double) logicalOptimization / 1000)
                            + "\n    - Physical optimization: "
                            + ((double) physicalOptimization / 1000)
                            + "\n    - Evaluation           : "
                            + ((double) evaluateQuery / 1000)));
                  }
                  final JFrame frame1 = new JFrame("Execution times in seconds");
                  frame1.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
                  frame1.setLocationRelativeTo(Demo_Applet.this);

                  final JScrollPane scroll = new JScrollPane(ta_prefixes);

                  frame1.add(scroll);
                  frame1.pack();
                  frame1.setVisible(true);
                }
              } catch (final Throwable t) {
                this.dealWithThrowable(t, mode, evaluation instanceof SPARQLEvaluation);
              }
            } catch (final Throwable t) {
              this.dealWithThrowable(t, mode, evaluation instanceof SPARQLEvaluation);
            }
            evaluation.enableButtons();

          } else {

            try {
              this.prefixInstance = new ViewerPrefix(this.usePrefixes.isTrue());
              evaluation.prepareInputData(this.defaultGraphs, new LinkedList<URILiteral>());

              System.out.println("Compile query...");
              try {
                try {
View Full Code Here

Examples of lupos.gui.operatorgraph.viewer.ViewerPrefix

  private void updateBrowserContent(final QueryResult resultQueryEvaluator) {
    if (this.resultpanel == null)
      return;
    this.resultpanel.removeAll();
    if (prefixInstance == null)
      prefixInstance = new ViewerPrefix(usePrefixes);

    if (resultQueryEvaluator instanceof BooleanResult) {

      System.out.println(resultQueryEvaluator.toString());
View Full Code Here

Examples of lupos.gui.operatorgraph.viewer.ViewerPrefix

    bt_opgraph.setEnabled(ruleApplicationsParameter != null);
    if (ruleApplicationsParameter != null) {
      bt_opgraph.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent ae) {
          ViewerPrefix vp = (DebugViewerCreator.this.viewerPrefix==null)? new ViewerPrefix(DebugViewerCreator.this.usePrefixes.isTrue(), null) : DebugViewerCreator.this.viewerPrefix;
          new Viewer(ruleApplicationsParameter, "OperatorGraph", false,
              DebugViewerCreator.this.fromJar, vp);
        }
      });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.