Package lupos.datastructures.items.literal

Examples of lupos.datastructures.items.literal.Literal


      }
      final Bindings b = bindingsFactory.createInstance();
      final BigInteger TWO = BigInteger.valueOf(2);
      for (final Variable v : hm.keySet()) {
        if (usedVars.mod(TWO).compareTo(BigInteger.ONE)==0) {
          final Literal lit = InputHelper.readLuposLiteral(in);
          b.add(v, lit);
        }
        usedVars = usedVars.shiftRight(1);
      }
      InputHelper.addSpecialInformationToBindings(b, in);
View Full Code Here


        return null;
      }
      for (int i = 0; i < number; i++) {
        final String varName = InputHelper.readLuposString(in);
        final Variable v = new Variable(varName);
        final Literal l = InputHelper.readLuposLiteral(in);
        b.add(v, l);
      }
      return (BindingsMap) b;
    }
    return null;
View Full Code Here

    }
  }

  protected void writeLiteral(final OutputStream os, final Literal literal) throws IOException{
    if(literal!=null){
      final Literal materializedLiteral = (literal instanceof LazyLiteral)?((LazyLiteral)literal).getLiteral(): literal;
      if (materializedLiteral.isBlank()){
        this.writeBlankNode(os, (AnonymousLiteral) materializedLiteral);
      } else if(materializedLiteral.isURI()){
        this.writeURI(os, (URILiteral) materializedLiteral);
      } else {
        // literal => <literal>
        if(materializedLiteral instanceof TypedLiteral){
          this.writeTypedLiteral(os, (TypedLiteral)materializedLiteral);
View Full Code Here

   *            the root operator of the stream query
   */
  public void generateStream(final Stream stream) {
    stream.sendMessage(new StartOfEvaluationMessage());
    try {
      final Literal s = LiteralFactory.createURILiteral("<s>");
      final Literal p = LiteralFactory.createURILiteral("<p>");
      int i = 0;
      while (this.loop) {
        final int current = (i >= 100) ? 100 - (i % 100) : i;
        final Literal o = LiteralFactory.createTypedLiteral("\""
            + current + "\"",
            "<http://www.w3.org/2001/XMLSchema#integer>");
        final Triple triple = new Triple(s, p, o);
        stream.consume(triple);

View Full Code Here

    }
    // but not be logged
    if (Parser.maxTriples > 0 && this.counter > Parser.maxTriples) {
      return null;
    }
    Literal nextLiteral;
    nextLiteral = this.nextLiteral();
    if (nextLiteral == null) {
      return null;
    }
    if(this.predicate != null) {
      return new Triple(this.subject, this.predicate, nextLiteral);
    }
    Literal nextLiteral2;
    nextLiteral2 = this.nextLiteral();
    if (this.subject != null) {
      this.predicate = nextLiteral;
      return new Triple(this.subject, nextLiteral, nextLiteral2);
    }
    this.subject = nextLiteral;
    this.predicate = nextLiteral2;
    Literal object;
    object = this.nextLiteral();
    return new Triple(nextLiteral, nextLiteral2, object);
  }
View Full Code Here

        next = this.nextCharacter();
        if (next != '^') {
          log.error("Typed literal not recognized!");
          return null;
        }
        final Literal datatype = this.nextLiteral();
        try {
          return LiteralFactory.createTypedLiteralWithoutLazyLiteral(
              s, (URILiteral) datatype);
        } catch (final URISyntaxException e) {
          log.error(e.toString(),e);
View Full Code Here

      }
      this.currentType = TYPE.undefined;
    }

    private void handleValue(){
      Literal literal = null;
      switch(this.currentType){
      default:
      case undefined:
        break;
      case uri:
View Full Code Here

        // row[j++] = value;
        // }
        // }
        // } else { // result order is not defined...
        for (final Variable variable : variables) {
          final Literal literal = ba.get(variable);
          String value = "";

          if (literal != null) {
            value = literal.toString(this.prefixInstance);
          }

          final JPanel panel = new JPanel(new BorderLayout());
          final LuposDocument document = new LuposDocument();
          final LuposJTextPane textPane = new LuposJTextPane(document);
View Full Code Here

            if (bind != null) {
              final Iterator<HashMap<lupos.sparql1_1.Node, Object>> resultsOfAggregationFunctionsIterator = resultsOfAggregationFunctionsList.iterator();
              for (final Map.Entry<Variable, Filter> entry : Bind.this.projections
                  .entrySet()) {
                final HashMap<lupos.sparql1_1.Node, Object> resultsOfAggregationFunctions = resultsOfAggregationFunctionsIterator.next();
                final Literal boundValue = bind.get(Bind.this.var);
                final Literal toBound = Helper.getLiteral(Filter.staticEvalTree(bind, entry.getValue().getNodePointer(), resultsOfAggregationFunctions, entry.getValue().getUsedEvaluationVisitor()));

                if(boundValue==null){ // variable is not bound => bound with computed value
                  final Bindings bindNew = bind.clone();
                  bindNew.add(Bind.this.var, toBound);
                  return bindNew;
View Full Code Here

    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
      if (!arrayContains(filterVars, var)) {
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.literal.Literal

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.