Package lupos.datastructures.items

Examples of lupos.datastructures.items.Triple


    while (pib.hasNext()) {
      final Bindings bind1 = pib.next();
      // TODO Prevent duplicates
      // bind1.getTriples();

      final Triple triple = new Triple();

      for (int i = 0; i < 3; i++) {
        if (valueOrVariable[i].isVariable())
          triple.setPos(i, bind1.get((Variable) valueOrVariable[i]));
        else
          triple.setPos(i, (Literal) valueOrVariable[i]);
      }

      if (triple.getSubject() == null || triple.getPredicate()==null || triple.getObject()==null || !(triple.getPredicate().isURI() && (triple.getSubject().isBlank() || triple.getSubject().isURI()))) {
        System.err.println("Tried to generate triple "
                + triple
                + ", which does not conform to the RDF conventions (B v U) X U X (B v U v L), where B is the set of blank nodes, U the set of URIs and L the set of literals!");
      } else
        for (final OperatorIDTuple oit : succeedingOperators) {
View Full Code Here


        @Override
        public void run() {
            try {
                while (this.bbt.hasNext()) {
                    final Triple t = this.bbt.get();
                    this.ps.put(new TripleKey(t, new TripleComparator(this.order)), t);
                }
            } catch (final InterruptedException e) {
                System.err.println(e);
                e.printStackTrace();
View Full Code Here

    while (pib.hasNext()) {
      final Bindings bind1 = pib.next();
      // TODO Prevent duplicates
      // bind1.getTriples();

      final Triple triple = new Triple();

      for (int i = 0; i < 3; i++) {
        if (valueOrVariable[i].isVariable())
          triple.setPos(i, bind1.get((Variable) valueOrVariable[i]));
        else
          triple.setPos(i, (Literal) valueOrVariable[i]);
      }

      if (triple.getSubject() instanceof TypedLiteral) {
        System.err.println("Tried to generate triple "
            + triple
            + ", which does not conform to the RDF conventions: The subject is a literal!");
      } else if (triple.getPredicate() instanceof TypedLiteral) {
        System.err.println("Tried to generate triple "
            + triple
            + ", which does not conform to the RDF conventions: The predicate is a literal!");
      } else if (triple.getPredicate() instanceof AnonymousLiteral) {
        System.err.println("Tried to generate triple "
            + triple
            + ", which does not conform to the RDF conventions: The predicate is a blank node!");
      } else
        for (final OperatorIDTuple oit : succeedingOperators) {
View Full Code Here

            }
            bbTriples.endOfData();
          }
        };
        thread.start();
        Triple t;
        try {
          while ((t = bbTriples.get()) != null) {
            tc.consume(t);
          }
        } catch (final InterruptedException e) {
View Full Code Here

        literals[i] = (Literal) this.items[i];
      } else {
        literals[i] = k.get((Variable) this.items[i]);
      }
    }
    final TripleKey tk = new TripleKey(new Triple(literals[0], literals[1],
        literals[2]), order);
    return tk;
  }
View Full Code Here

        literals[i] = (Literal) this.items[i];
      } else {
        literals[i] = t[i];
      }
    }
    final TripleKey tk = new TripleKey(new Triple(literals[0], literals[1],
        literals[2]), order);
    return tk;
  }
View Full Code Here

            // under an UNION operator
            final Union union = new Union();
            final TriggerOneTime trigger = new TriggerOneTime();

            while (it.hasNext()) {
              final Triple t = it.next();
              BasicOperator lastOperator = union;
              for (int i = 0; i < 3; i++) {
                if (tp.getPos(i).isVariable()) {
                  final AddBinding add = new AddBinding(
                      (Variable) tp.getPos(i), t
                          .getPos(i));
                  add
                      .addSucceedingOperator(new OperatorIDTuple(
                          lastOperator, 0));
                  // Not completely correct, but for
View Full Code Here

      return null;
    }
  }

  protected static Triple t(final String a, final String b, final String c) {
    return new Triple(u(a), u(b), u(c));
  }
View Full Code Here

      }
      if (number < 0) {
        return;
      }
      for (int j = 0; j < number; j++) {
        final Triple t = InputHelper.readLuposTriple(in);
        b.addTriple(t);
      }
    }
    if (b instanceof BindingsArrayVarMinMax) {
      ((BindingsArrayVarMinMax) b).readPresortingNumbers(in);
View Full Code Here

  public final static TripleKey readLuposTripleKey(final InputStream in) throws IOException, ClassNotFoundException {
    final int order = in.read();
    if (order < 0) {
      return null;
    }
    final Triple t = InputHelper.readLuposTriple(in);
    return new TripleKey(t, new TripleComparator((byte) order));
  }
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.Triple

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.