Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.ResultSet.nextSolution()


   
    QueryExecution qexec = QueryExecutionFactory.create(query, csv);
    ResultSet results = qexec.execSelect();
   
    assertTrue(results.hasNext());
    QuerySolution soln = results.nextSolution();
    assertEquals( "Oshrat Raz,Dorit L Lev,Alexander Battler,Eli I Lev", soln.getLiteral("author").getString());
   
    assertFalse(results.hasNext());
  }
 
View Full Code Here


   
    QueryExecution qexec = QueryExecutionFactory.create(query, csv);
    ResultSet results = qexec.execSelect();
   
    assertTrue(results.hasNext());
    QuerySolution soln = results.nextSolution();
    assertEquals( -122.1566921, soln.getLiteral("longitude").getDouble(), 0);
    assertEquals( 37.4408948, soln.getLiteral("latitude").getDouble(), 0);
   
    assertFalse(results.hasNext());
  }
View Full Code Here

            ResultSet rs = qExec.execSelect() ;
           
            if ( ! rs.hasNext() )
                throw new ARQException("Not found: var ?"+varname) ;

            QuerySolution qs = rs.nextSolution() ;
            RDFNode r = qs.get(varname) ;
            if ( rs.hasNext() )
                throw new ARQException("More than one: var ?"+varname) ;
            return r ;
        } finally { qExec.close() ; }
View Full Code Here

            ResultSet rs = qExec.execSelect() ;
           
            if ( ! rs.hasNext() )
                return null ;

            QuerySolution qs = rs.nextSolution() ;
            RDFNode r = qs.get(varname) ;
            if ( rs.hasNext() )
                throw new ARQException("More than one: var ?"+varname) ;
            return r ;
        } finally { qExec.close() ; }
View Full Code Here

//      ResultSetFormatter.out(System.out, results, query) ;
      
      for ( ; results.hasNext() ; )
      {
        QuerySolution soln = results.nextSolution() ;
       
        RDFNode m = soln.get("model") ;       // Get a result variable by name.

        if (m == null) {
          logger.info("model uri is null.");
View Full Code Here

//      ResultSetFormatter.out(System.out, results, query) ;
      
      for ( ; results.hasNext() ; )
      {
        QuerySolution soln = results.nextSolution() ;
        Map<String, String> attValues =
          new HashMap<String, String>();
       
        for (String arg : argList) {
          RDFNode argNode = soln.get(arg) ;
View Full Code Here

//      ResultSetFormatter.out(System.out, results, query) ;
      
      for ( ; results.hasNext() ; )
      {
        QuerySolution soln = results.nextSolution() ;
       
        RDFNode s = soln.get("s") ;       // Get a result variable by name.
        RDFNode name = soln.get("name") ;       // Get a result variable by name.
        RDFNode address = soln.get("address") ;       // Get a result variable by name.
View Full Code Here

//      ResultSetFormatter.out(System.out, results, query) ;
      
      String serviceURI = "";
      for ( ; results.hasNext() ; )
      {
        QuerySolution soln = results.nextSolution() ;
        RDFNode x = soln.get("s") ;       // Get a result variable by name.
        serviceURI = x.toString();
        logger.info("Service with id " + x.toString() + " has been found with the address " + address);
        break;
      }
View Full Code Here

        final ResultSet results = qexec.execSelect();
        int count = 0;
        for (; results.hasNext();)
        {
          count++;
          final QuerySolution soln = results.nextSolution();
        }
        Assert.assertEquals(8, count);
      }
      finally
      {
View Full Code Here

        final ResultSet results = qexec.execSelect();
        int count = 0;
        for (; results.hasNext();)
        {
          count++;
          results.nextSolution();
        }
        Assert.assertEquals(4, count);
      }
      finally
      {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.