Package com.hp.hpl.jena.query

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


    }
   
    Query query = QueryFactory.create(CLASSES_QUERY);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
      QuerySolution sol = results.nextSolution();
      Iterator<?> varNames = sol.varNames();
      while ( varNames.hasNext() ) {
        String varName = String.valueOf(varNames.next());
       
        RDFNode rdfNode = sol.get(varName);
View Full Code Here


      throw ex;
    }
   
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
      QuerySolution sol = results.nextSolution();
      Iterator<?> varNames = sol.varNames();
     
      String propName = null, propUri = null;
      String valueName = null, valueUri = null;
     
View Full Code Here

    }
   
    Query query = QueryFactory.create(SKOS_QUERY);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
     
      QuerySolution sol = results.nextSolution();
     
      String left = null;
      String rel = null;
      String right = null;
     
View Full Code Here

            QueryExecution qexec = QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query);
            // Set the DBpedia specific timeout.
            ((QueryEngineHTTP)qexec).addParam("timeout", "10000") ;

            // Execute.
            ResultSet rs = qexec.execSelect();
            ResultSetFormatter.out(System.out, rs, query);
            qexec.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

        return 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) ;
    }
View Full Code Here

        ResultSet rs2 = ResultSetFactory.fromXML(in) ;
    }

    @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) ;
    }
View Full Code Here

        ResultSet rs2 = ResultSetFactory.fromJSON(in) ;
    }
   
    @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) ;
    }
View Full Code Here

        ResultSet rs2 = ResultSetFactory.fromTSV(in) ;
    }

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

        // This is illegal
        // Two vars, row of 3 values.
        String x = "?x\t?y\n'a'\t'b'\t'c'" ;
        byte[] b = StrUtils.asUTF8bytes(x) ;
        ByteArrayInputStream in = new ByteArrayInputStream(b) ;
        ResultSet rs2 = ResultSetFactory.fromTSV(in) ;
    }
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.