Package com.hp.hpl.jena.query

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


            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


            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() )
            {
                QuerySolution qs2 = rs.next();
                RDFNode r2 = qs2.get(varname) ;
View Full Code Here

    ResultSet results = qe.execSelect();
   
    WDSingleTest one = null;
    Resource last = null;
    while (results.hasNext()) {
      QuerySolution s = results.nextSolution();
      Resource in = s.getResource("in");
      Resource out = s.getResource("out");
      Resource test = s.getResource("test");
     
      Property approval = m.createProperty(
View Full Code Here

        QueryExecution qexec = QueryExecutionFactory.create(
            queryString, model);
        try {
          ResultSet results = qexec.execSelect();
          while (results.hasNext()) {
            QuerySolution soln = results.nextSolution();
            try {
              Literal u = soln.getLiteral("user");
//              System.err.println("user: "+u.getString());
              Literal s = soln.getLiteral("software");
//              System.err.println("software: "+s);
View Full Code Here

    VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (sparql, _graph);

    ResultSet results = vqe.execSelect();
    System.out.println("RESULT:");
    while (results.hasNext()) {
      QuerySolution result = results.nextSolution();
        RDFNode s = result.get("s");
        RDFNode o = result.get("o");
        System.out.println("  " + s + " " + "skos:exactMatch" + " " + o);
    }
   
View Full Code Here

//       http://example.org/vocres/DDD
        
    ResultSet results = vqe.execSelect();
    System.out.println("RESULT:");
    while (results.hasNext()) {
      QuerySolution result = results.nextSolution();
      RDFNode o = result.get("o");
      System.out.println(" "+ o );
    }
   
    vqe.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

            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() ;
            assertTrue(rs.hasNext()) ;
            qExec.abort();
           
            assertTrue(rs.hasNext()) ;
            rs.nextSolution();
            assertFalse("Results not expected after cancel.", rs.hasNext()) ;
        } finally { qExec.close() ; }
    }
   
    @Test(expected=QueryCancelledException.class)
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.