Package lupos.datastructures.queryresult

Examples of lupos.datastructures.queryresult.QueryResult


  public final static NodeInPartitionTree readLuposNodeInPartitionTree(final InputStream in) throws IOException, ClassNotFoundException {
    final byte type = InputHelper.readLuposByte(in);
    switch (type) {
    case 1:
      final Collection<Bindings> coll = PagedCollection.readAndCreateLuposObject(in);
      return new LeafNodeInPartitionTree(new QueryResult(coll));
    default:
    case 2:
      final PagedCollection<NodeInPartitionTree> pcoll = PagedCollection.readAndCreateLuposObject(in);
      return new InnerNodeInPartitionTree(pcoll);
    }
View Full Code Here


    }
  }

  public void start(final Type type) {
    qr = null;
    final QueryResult qr;
    gr = null;
    br_list = null;
    this.type = type;
  }
View Full Code Here

   * returned...
   *
   * @return
   */
  public QueryResult getResult() {
    QueryResult result = qr;
    if (result == null)
      result = gr;
    if (result == null && br_list != null)
      result = br_list.get(0);

View Full Code Here

      this.evaluator.physicalOptimization();

      System.out.println("Evaluate query ...");

      final QueryResult resultQueryEvaluator = this.evaluator.getResult();

      System.out.println("\nQuery Result:");
      System.out.println(resultQueryEvaluator);
      System.out.println("----------------Done.");
View Full Code Here

    System.out.println();
    System.out.println(query_succeeding);
    System.out.println();

    // evaluate the queries...
    final QueryResult queryResult_preceding = this
    .queryForSuggestions(query_preceding);
    final QueryResult queryResult_succeeding = this
    .queryForSuggestions(query_succeeding);

    if (queryResult_preceding.isEmpty() && queryResult_succeeding.isEmpty()) {
      JOptionPane.showOptionDialog(this, "No suggestions available!",
          "Error", JOptionPane.DEFAULT_OPTION,
          JOptionPane.ERROR_MESSAGE, null, null, null);

      return;
View Full Code Here

    return tripleResultAsQueryResult(triplePattern, foundTriples);
  }

  private QueryResult tripleResultAsQueryResult(TriplePattern triplePattern,
      List<Triple> foundTriples) {
    QueryResult result = QueryResult.createInstance();
    if (foundTriples != null)
      for (Triple t : foundTriples) {
        Bindings b = addVariablesToBindings(triplePattern.getItems(), t);
        if (b != null)
          result.add(b);
      }
    return result;
  }
View Full Code Here

            LiteralFactory
                .setTypeWithoutInitializing(MapType.LAZYLITERALWITHOUTINITIALPREFIXCODEMAP);
            LiteralFactory
                .setType(MapType.LAZYLITERALWITHOUTINITIALPREFIXCODEMAP);
          }
          final QueryResult queryResult = (EndpointNetwork.this.evaluator instanceof CommonCoreQueryEvaluator) ? ((CommonCoreQueryEvaluator<?>) EndpointNetwork.this.evaluator)
              .getResult(q, true)
              : EndpointNetwork.this.evaluator.getResult(q);
          log.debug(String
              .format("[%s on port %d] Evaluation query in local storage: %s: %d items found",
                  EndpointNetwork.this.evaluator.getClass().getSimpleName(), EndpointNetwork.this.port,
                  q, queryResult.size()));

          /*
           * return result
           */
          if (queryResult != null) {
View Full Code Here

  public List<Triple> get(final String key) {
    /*
     * we will not execute this, if using subgraph-submission
     */
    final List<Triple> lst = new LinkedList<Triple>();
    final QueryResult qr = this.sendDirect(key, "SELECT * WHERE {?s ?p ?o}");
    for (final Iterator<Bindings> it = qr.oneTimeIterator(); it.hasNext();) {
      final Bindings bind = it.next();
      final List<Triple> t = bind.getTriples();
      if (t != null) {
        lst.addAll(t);
      }
View Full Code Here

  private final static void evaluateQueryAndPrintOut(
      final QueryEvaluator<Node> evaluator, final String query)
      throws Exception {
    // evaluate query:
    final QueryResult qr = evaluator.getResult(query);

    // use oneTimeIterator() whenever the result need to
    // be iterated only once, otherwise iterator()...
    final Iterator<Bindings> it_query = qr.oneTimeIterator();
    while (it_query.hasNext()) {
      // get next solution of the query...
      final Bindings bindings = it_query.next();
      // print out the bound values of all bindings!
      StringBuilder result=new StringBuilder("{");
View Full Code Here

    return b;
  }

  private QueryResult tripleResultAsQueryResult(TriplePattern triplePattern,
      List<Triple> foundTriples) {
    QueryResult result = QueryResult.createInstance();
    for (Triple t : foundTriples) {
      Bindings b = addVariablesToBindings(triplePattern.getItems(), t);
      if (b != null)
        result.add(b);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of lupos.datastructures.queryresult.QueryResult

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.