Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.ResultSet


    return this.varnames;
  }
 
  @Override
  public ClosableIterator<QueryRow> iterator() {
    ResultSet results = this.qexec.execSelect();
    return new QueryIterator(this, results);
  }
View Full Code Here


    Query query = QueryFactory.create(queryString);   
   
    // Execute the query and obtain results
    QueryExecution qe = QueryExecutionFactory.create(query, model);
    ResultSet results = qe.execSelect();

    // Output query results
    ByteArrayOutputStream debug = new ByteArrayOutputStream();
    ResultSetFormatter.out(debug, results, query);
    logger.debug(debug.toString());
View Full Code Here

            // -------- Or make ResultSet from it (but not both - reading an
            //          iterator consumes the current solution)
            List<String> varNames = new ArrayList<String>() ;
            varNames.add("x") ;
            varNames.add("z") ;
            ResultSet rs = new ResultSetStream(varNames, m, qIter);
            ResultSetFormatter.out(rs) ;
            qIter.close() ;
        }
        System.exit(0) ;
    }
View Full Code Here

        System.out.println("Titles: ") ;
       
        try {
            // Assumption: it's a SELECT query.
            ResultSet rs = qexec.execSelect() ;
           
            // The order of results is undefined.
            for ( ; rs.hasNext() ; )
            {
                QuerySolution rb = rs.nextSolution() ;
               
                // Get title - variable names do not include the '?' (or '$')
                RDFNode x = rb.get("title") ;
               
                // Check the type of the result value
View Full Code Here

        // Read the whole of the results now.
        // Avoids the problems with calling back into the same system e.g.
        // Fuseki+SERVICE <http://localhost:3030/...>

        ResultSet rs = ResultSetFactory.fromXML(in);
        QueryIterator qIter = new QueryIteratorResultSet(rs);
        qIter = QueryIter.materialize(qIter);
        // And close connection now, not when qIter is closed.
        IO.close(in);
View Full Code Here

        if ( model == null )
            model = GraphFactory.makeJenaDefaultModel() ;
        if ( rows != null )
        {
            QueryIterator qIter = new QueryIterPlainWrapper(rows.iterator()) ;
            ResultSet rs = new ResultSetStream(Var.varNames(vars), model, qIter) ;
            super.set(rs) ;
        }
        else
            super.set(booleanResult) ;
        return this ;
View Full Code Here

    private static void dump(Table table)
    {
        System.out.println("Table: "+Utils.className(table)) ;
        QueryIterator qIter = table.iterator(null) ;
        ResultSet rs = new ResultSetStream(table.getVarNames(), null, table.iterator(null)) ;
        ResultSetFormatter.out(rs) ;
    }
View Full Code Here

      // Create a SPARQL-DL query execution for the given query and
      // ontology model
      QueryExecution qe = SparqlDLExecutionFactory.create( q, m );
 
      // We want to execute a SELECT query, do it, and return the result set
      ResultSet rs = qe.execSelect();
 
      // There are different things we can do with the result set, for
      // instance iterate over it and process the query solutions or, what we
      // do here, just print out the results
      ResultSetFormatter.out( rs );
View Full Code Here

    }
   
    public static void printQueryResults( String header, QueryExecution qe, Query query ) throws Exception {
        System.out.println(header);
       
        ResultSet results = qe.execSelect();

    ResultSetFormatter.out( System.out, results, query );
   
    System.out.println();
    }
View Full Code Here

      // Create a SPARQL-DL query execution for the given query and
      // ontology model
      QueryExecution qe = SparqlDLExecutionFactory.create( q, m );
 
      // We want to execute a SELECT query, do it, and return the result set
      ResultSet rs = qe.execSelect();
 
      // Print the query for better understanding
      System.out.println(q.toString());
     
      // There are different things we can do with the result set, for
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.ResultSet

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.