Package lupos.datastructures.items

Examples of lupos.datastructures.items.Variable


      @Override
      public Variable next() {
        if(this.next==null){
          return null;
        } else {
          final Variable znext = this.next;
          this.next = this.computeNext();
          return znext;
        }
      }

      public Variable computeNext() {
        while(this.it.hasNext()){
          final Variable v = this.it.next();
          if(bindings.getVariableSet().contains(v)){
            return v;
          }
        }
        return null;
View Full Code Here


    } else {
      this.writeStartHead(os);
      boolean firstTime = true;
      final Iterator<Variable> it_v = variables.iterator();
      while(it_v.hasNext()){
        final Variable v = it_v.next();
        if(firstTime){
          this.writeFirstVariableInHead(os, v);
          firstTime = false;
        } else {
          this.writeVariableInHead(os, v);
        }
      }
      if(this.writeQueryTriples){
        this.writeQueryTriplesHead(os);
      }
      this.writeEndHead(os);
      firstTime = true;
      final Iterator<Bindings> it = queryResult.oneTimeIterator();
      while(it.hasNext()){
        if(firstTime){
          this.writeFirstStartResult(os);
          firstTime = false;
        } else {
          this.writeStartResult(os);
        }
        final Bindings bindings = it.next();
        boolean firstTimeBinding = true;
        final Iterator<Variable> it_v2 = this.getVariablesToIterateOnForOneBindings(variables, bindings);
        while(it_v2.hasNext()){
          final Variable v = it_v2.next();
          if(firstTimeBinding){
            this.writeFirstStartBinding(os, v);
            firstTimeBinding = false;
          } else {
            this.writeStartBinding(os, v);
View Full Code Here

      SimpleNode node = SPARQL1_1Parser.parseFilter("FILTER(" + this.filterExpression + ")", this.prefix.getPrefixNames());

      Operator.computeUsedVariables(node, variables);

      if(variables.contains(new Variable(variable)))
        return true;
    } catch (ParseException e) {
      e.printStackTrace();
      return false;
    }
View Full Code Here

   
    Bindings b = bindingsFactory.createInstance();
    for (int i = 0; i < items.length; i++) {
      Item item = items[i];
      if (item.getClass() == Variable.class) {
        Variable v = (Variable) item;
        b.add(v, t.getPos(i));

      } else {
        if (t.getPos(i)
            .compareToNotNecessarilySPARQLSpecificationConform(
View Full Code Here

    this.visualEditor = parent;
    this.queryGraph = queryGraph;
    this.queryResult_preceding = queryResult_preceding;
    this.queryResult_succeeding = queryResult_succeeding;
    this.op = op;
    this.varSO = new Variable(varSOName);
    this.varPred = new Variable(varPredName);

    final JPanel contentPanel = this.createContentPanel(
        new ActionListener() {
          public void actionPerformed(final ActionEvent ae) {
            final Item subjectItem = subjectPanel
View Full Code Here

  private Bindings addVariablesToBindings(Item[] items, Triple t) {
    Bindings b = this.bindings.createInstance();
    for (int i = 0; i < items.length; i++) {
      Item item = items[i];
      if (item.getClass() == Variable.class) {
        Variable v = (Variable) item;
        b.add(v, t.getPos(i));

      } else {
        if (t.getPos(i)
            .compareToNotNecessarilySPARQLSpecificationConform(
View Full Code Here

    for(SortContainer sc : this.sortContainerList) {
      HashSet<Variable> variables = new HashSet<Variable>();

      sc.getUsedVariables(variables);

      if(variables.contains(new Variable(variable))) {
        return true;
      }
    }

    return false;
View Full Code Here

  private Bindings addVariablesToBindings(Item[] items, Triple t) {
    Bindings b = this.bindings.createInstance();
    for (int i = 0; i < items.length; i++) {
      Item item = items[i];
      if (item.getClass() == Variable.class) {
        Variable v = (Variable) item;
        b.add(v, t.getPos(i));

      } else {
        if (t.getPos(i)
            .compareToNotNecessarilySPARQLSpecificationConform(
View Full Code Here

    this.visualEditor = parent;
    this.queryGraph = queryGraph;
    this.queryResult_preceding = queryResult_preceding;
    this.queryResult_succeeding = queryResult_succeeding;
    this.op = op;
    this.varSO = new Variable(varSOName.substring(1));
    this.varPred = new Variable(varPredName.substring(1));

    final JPanel contentPanel = this.createContentPanel(
        new ActionListener() {
          public void actionPerformed(final ActionEvent ae) {
            addPrecedingSuggestion(subjectPanel, predicatePanelS);
View Full Code Here

          if (sol.contains(varname)) {
            if (sol.get(varname).isLiteral()) {
              if (sol.getLiteral(varname).getDatatypeURI() != null)
                binding
                    .add(
                        new Variable(varname),
                        TypedLiteralOriginalContent
                            .createTypedLiteral(
                                "\""
                                    + sol
                                        .getLiteral(
                                            varname)
                                        .getLexicalForm()
                                    + "\"",
                                "<"
                                    + sol
                                        .getLiteral(
                                            varname)
                                        .getDatatypeURI()
                                    + ">"));
              else {
                if (sol.getLiteral(varname).getLanguage() != null
                    && sol.getLiteral(varname)
                        .getLanguage().length() > 0) {
                  binding
                      .add(
                          new Variable(varname),
                          lupos.datastructures.items.literal.LiteralFactory
                              .createLanguageTaggedLiteral(
                                  "\""
                                      + sol
                                          .getLiteral(
                                              varname)
                                          .getLexicalForm()
                                      + "\"",
                                  sol
                                      .getLiteral(
                                          varname)
                                      .getLanguage()));
                } else
                  binding
                      .add(
                          new Variable(varname),
                          lupos.datastructures.items.literal.LiteralFactory
                              .createLiteral("\""
                                  + sol
                                      .getLiteral(
                                          varname)
                                      .getLexicalForm()
                                  + "\""));
              }
            } else {
              if (sol.get(varname).isAnon())
                binding
                    .add(
                        new Variable(varname),
                        new lupos.datastructures.items.literal.AnonymousLiteral(
                            sol
                                .getResource(
                                    varname)
                                .toString()));
              else
                binding
                    .add(
                        new Variable(varname),
                        lupos.datastructures.items.literal.LiteralFactory
                            .createURILiteral("<"
                                + sol
                                    .getResource(varname)
                                + ">"));
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.