Package lupos.datastructures.items

Examples of lupos.datastructures.items.Variable


            }
          }
        }
      }
      if (this.hypernodes[0].size() > 1) {
        final Variable varS = CondensedViewToolBar.this.getVariable(this.hypernodes[0]);
        this.hypernodes[0].addFirst(varS);
      }
      if (this.hypernodes[2].size() > 1) {
        final Variable varO = CondensedViewToolBar.this.getVariable(this.hypernodes[2]);
        this.hypernodes[2].addFirst(varO);
      }
    }
View Full Code Here


      for (int j = 0; j < rowButtonsRename.length; j++) {
        final int row = j;
        final JButton buttonRename = new JButton("Rename");
        buttonRename.addActionListener(new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            final Variable toBeRenamed = (Variable) (variables
                .toArray()[row]);

            final String newName = JOptionPane.showInputDialog(
                AdvancedQueryEditor.this,
                "Please enter a new variable name for "
                + toBeRenamed.toString() + ":",
                toBeRenamed.toString());

            statusBar.setText("Rename variable " + toBeRenamed
                + "...");
            final String newQuery = determineNewQueryRenamedVariable(
                currentBrowserQuery, toBeRenamed, newName);
            System.out.println(newQuery);
            updateAll(newQuery);
            statusBar.clear();
          }
        });

        final JPanel panelRename = new JPanel(new FlowLayout());
        panelRename.add(buttonRename);
        panelRename.setBackground(Color.WHITE);

        rowButtonsRename[j] = panelRename;
      }
      rows[0] = rowButtonsRename;

      final Object[] rowButtonsSort = new Object[variables.size()];
      for (int j = 0; j < rowButtonsSort.length; j++) {
        final int row = j;
        final JButton buttonSort = new JButton("Sort");
        buttonSort.addActionListener(new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            final Variable toBeSorted = (Variable) (variables
                .toArray()[row]);
            statusBar.setText("Sort according to variable "
                + toBeSorted + "...");
            final String newQuery = determineNewQuerySortAccordingToVariable(
                currentBrowserQuery, toBeSorted);
            System.out.println(newQuery);
            updateAll(newQuery);
            statusBar.clear();
          }
        });

        final JPanel panelSort = new JPanel(new FlowLayout());
        panelSort.add(buttonSort);
        panelSort.setBackground(Color.WHITE);

        rowButtonsSort[j] = panelSort;
      }
      rows[1] = rowButtonsSort;

      final Object[] rowButtonsExclude = new Object[variables.size()];
      for (int j = 0; j < rowButtonsExclude.length; j++) {
        final int row = j;
        final JButton buttonExclude = new JButton("Exclude");
        buttonExclude.addActionListener(new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            final Variable toBeExcluded = (Variable) (variables
                .toArray()[row]);
            statusBar.setText("Exclude variable " + toBeExcluded
                + "...");
            final String newQuery = determineNewQueryProjectionWithoutVariable(
                currentBrowserQuery, toBeExcluded);
            System.out.println(newQuery);
            updateAll(newQuery);
            statusBar.clear();
          }
        });

        final JPanel panelExclude = new JPanel(new FlowLayout());
        panelExclude.add(buttonExclude);
        panelExclude.setBackground(Color.WHITE);

        rowButtonsExclude[j] = panelExclude;
      }
      rows[2] = rowButtonsExclude;

      final Object[] rowButtonsRefine = new Object[variables.size()];
      for (int j = 0; j < rowButtonsRefine.length; j++) {
        final int row = j;
        final JButton buttonRefine = new JButton("Refine");
        buttonRefine.addActionListener(new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            final Variable toBeRefined = (Variable) (variables
                .toArray()[row]);
            statusBar.setText("Refine variable " + toBeRefined
                + "...");
            refineQuery(currentBrowserQuery, toBeRefined);
            statusBar.clear();
View Full Code Here

            this.add(item);
          }
        }
      }
      if (this.size() > 1) {
        final Variable var = CondensedViewToolBar.this.getVariable(this);
        this.addFirst(var);
      }
    }
View Full Code Here

        e.printStackTrace();
      }
    }

    if (child instanceof ASTVar) {
      item = new Variable(((ASTVar) child).getName());
    }


    final Graph g = new Graph(this.prefix, item);
View Full Code Here

        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTVars){
          for(int j=0; j<child.jjtGetNumChildren(); j++){
            final Node childchild = child.jjtGetChild(j);
            if(childchild instanceof ASTVar){
              vars.add(new Variable(((ASTVar)childchild).getName()));
            }
          }
        }
      }
      for(int i=0; i<root.jjtGetNumChildren(); i++){
        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTOneResult){
          final Bindings bindings = bindingsFactory.createInstance();
          final Iterator<Variable> varIt = vars.iterator();
          for(int j=0; j<child.jjtGetNumChildren() && varIt.hasNext(); j++){
            final Variable var = varIt.next();
            final Node childchild = child.jjtGetChild(j);
            if(childchild instanceof ASTValue && childchild.jjtGetNumChildren()>0){
              bindings.add(var, CSVParser.getLiteral(childchild.jjtGetChild(0)));
            }
          }
View Full Code Here

    final Bindings luposResult = bindingsFactory.createInstance();
    final Iterator<String> keysIt = oneResult.keys();
    while(keysIt.hasNext()){
      final String var = keysIt.next();
      if(var.compareTo("<Query-Triples>")!=0){
        luposResult.add(new Variable(var), getLiteral(oneResult.getJSONObject(var)));
      } else {
        // This JSONObject contains the query-triples!
        // This is no standard and a proprietary feature of LUPOSDATE!
        final JSONArray triples = oneResult.getJSONArray(var);
        for(int i=0; i<triples.length(); i++){
View Full Code Here

        BufferedOutputStream(
            new FileOutputStream(
                filename+((triplesInOneFile<=0)?"":currentRunNumber)+".n3")));
    final QueryResult queryResult=this.getResult("SELECT * WHERE {?s ?p ?o.}");

    final Variable s=new Variable("s");
    final Variable p=new Variable("p");
    final Variable o=new Variable("o");

    int tripleNumber=0;

    final Iterator<Bindings> it=queryResult.oneTimeIterator();
    Bindings lastBindings=null;
View Full Code Here

    final Object[] filterVars = filter.getUsedVariables().toArray();
    final LinkedList<Variable> replaceLitLeft = replaceLit
        .getSubstitutionsLiteralLeft();
    final LinkedList<Literal> replaceLitRight = replaceLit
        .getSubstitutionsLiteralRight();
    Variable var;
    Literal lit;
    for (int i = replaceLitLeft.size() - 1; i >= 0; i--) {
      var = replaceLitLeft.get(i);
      // Split ReplaceLit and pull only not intersection variables
      // downwards
View Full Code Here

    final LinkedList<Variable> replaceVarRight = replaceVar
        .getSubstitutionsVariableRight();
    final Object[] projVars = proj.getProjectedVariables().toArray();
    final Item[] patItems = pat.getItems();

    Variable var;
    Variable newTripleVar;

    // Before transformation: TriplePattern generates (p,lit) ,
    // ReplaceVar makes (y,lit) [because it has the tupel (y,p)] and
    // the Projection deletes (p,lit)
    // => Transformation replaces p by y in TriplePattern directly
View Full Code Here

  private Variable valueVar2;
 
  public XYChartModel(ChartTyp type){
    super(type);
   
    valueVar = new Variable("");
    valueVar2 = new Variable("");
    dataset = new MatrixSeriesCollection();
   
  }
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.Variable

Copyright © 2018 www.massapicom. 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.