Package com.hp.hpl.jena.query

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


        // This is illegal
        // Two vars, row of 1 value only.
        String x = "?x\t?y\n'a'" ;
        byte[] b = StrUtils.asUTF8bytes(x) ;
        ByteArrayInputStream in = new ByteArrayInputStream(b) ;
        ResultSet rs2 = ResultSetFactory.fromTSV(in) ;
    }   
View Full Code Here


                continue ;
            seen.add(b) ;
            x.add(b) ;
        }
        QueryIterator qIter = new QueryIterPlainWrapper(x.iterator()) ;
        ResultSet rs = new ResultSetStream(results.getResultVars(), ModelFactory.createDefaultModel(), qIter) ;
        return ResultSetFactory.makeRewindable(rs) ;
    }
View Full Code Here

        return ResultSetFactory.makeRewindable(BuilderResultSet.build(item));
    }
   
    @Test public void resultset_01()          
    {
        ResultSet rs = make($rs) ;
        ResultSetFormatter.asText(rs) ;
    }
View Full Code Here

        ResultSetFormatter.asText(rs) ;
    }
   
    @Test public void resultset_02()          
    {
        ResultSet rs = make($rs) ;
        ByteArrayOutputStream out = new ByteArrayOutputStream() ;
        ResultSetFormatter.outputAsXML(out, rs) ;
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()) ;
        ResultSet rs2 = ResultSetFactory.fromXML(in) ;
        areIsomorphic(rs, rs2);
    }
View Full Code Here

        areIsomorphic(rs, rs2);
    }

    @Test public void resultset_03()          
    {
        ResultSet rs = make($rs) ;
        ByteArrayOutputStream out = new ByteArrayOutputStream() ;
        ResultSetFormatter.outputAsJSON(out, rs) ;
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()) ;
        ResultSet rs2 = ResultSetFactory.fromJSON(in) ;
        areIsomorphic(rs, rs2);
    }
View Full Code Here

        areIsomorphic(rs, rs2);
    }
   
    @Test public void resultset_04()          
    {
        ResultSet rs = make($rs) ;
        ByteArrayOutputStream out = new ByteArrayOutputStream() ;
        ResultSetFormatter.outputAsTSV(out, rs) ;
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()) ;
        ResultSet rs2 = ResultSetFactory.fromTSV(in) ;
        areIsomorphic(rs, rs2);
    }
View Full Code Here

        areIsomorphic(rs, rs2);
    }

    @Test public void resultset_05()          
    {
        ResultSet rs = make($rs) ;
        ByteArrayOutputStream out = new ByteArrayOutputStream() ;
        ResultSetFormatter.outputAsCSV(out, rs) ;
    }
View Full Code Here

    public void parseTSV(String x)
    {
        byte[] b = StrUtils.asUTF8bytes(x) ;
        ByteArrayInputStream in = new ByteArrayInputStream(b) ;
        ResultSet rs2 = ResultSetFactory.fromTSV(in) ;
       
        while (rs2.hasNext())
        {
          rs2.nextBinding();
        }
    }
View Full Code Here

        // ---- Server
        Resource server = servers.get(0) ;
        processServer(server) ;

        // ---- Services
        ResultSet rs = query("SELECT * { ?s fu:services [ list:member ?member ] }", m) ;
        if ( ! rs.hasNext() )
            log.warn("No services found") ;
       
        List<DatasetRef> services =  new ArrayList<DatasetRef>() ;
       
        for ( ; rs.hasNext() ; )
        {
            QuerySolution soln = rs.next() ;
            Resource svc = soln.getResource("member") ;
            DatasetRef sd = processService(svc) ;
            services.add(sd) ;
        }
       
View Full Code Here

    }
   
    private static RDFNode getOne(Resource svc, String property)
    {
        String ln = property.substring(property.indexOf(':')+1) ;
        ResultSet rs = query("SELECT * { ?svc "+property+" ?x}", svc.getModel(), "svc", svc) ;
        if ( ! rs.hasNext() )
            throw new FusekiConfigException("No "+ln+" for service "+nodeLabel(svc)) ;
        RDFNode x = rs.next().get("x") ;
        if ( rs.hasNext() )
            throw new FusekiConfigException("Multiple "+ln+" for service "+nodeLabel(svc)) ;
        return x ;
    }
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.