Package com.hp.hpl.jena.query

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


            pw.print('=') ;
        pw.println() ;

        for ( ; resultSetRewindable.hasNext() ; )
        {
            QuerySolution rBind = resultSetRewindable.nextSolution() ;
            for ( int col = 0 ; col < numCols ; col++ )
            {
                String rVar = resultSet.getResultVars().get(col) ;
                row[col] = this.getVarValueAsString(rBind, rVar );
            }
View Full Code Here


    ResultSet results = exec.execSelect();
    List<String> found = new ArrayList<>();
    int count = 0;
    while (results.hasNext()) {
      count++;
      QuerySolution sln = results.next();
      found.add(sln.get("s").toString());
    }
   
    boolean dumped = false;
    if (expectedCount != count) {
      //If incorrect dump output for debugging
View Full Code Here

       
        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) ;
        }
       
        // TODO Properties for the other fields.
View Full Code Here

    private static void addServiceEP(String label, String name, ServiceRef service, Resource svc, String property)
    {
        ResultSet rs = query("SELECT * { ?svc "+property+" ?ep}", svc.getModel(), "svc", svc) ;
        for ( ; rs.hasNext() ; )
        {
            QuerySolution soln = rs.next() ;
            String epName = soln.getLiteral("ep").getLexicalForm() ;
            service.endpoints.add(epName) ;
            log.info("  "+label+" = /"+name+"/"+epName) ;
        }
    }
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

        Query query = QueryFactory.create(preamble+"\n"+qs, Syntax.syntaxARQ) ;
        QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
        ResultSet rs = qexec.execSelect() ;
        for ( ; rs.hasNext() ; )
        {
            QuerySolution soln= rs.next() ;
            Node x = soln.get("x").asNode() ;
            Node y = soln.get("y").asNode() ;
            if ( ! multimap.containsKey(x) )
                multimap.put(x, new ArrayList<Node>()) ;
            multimap.get(x).add(y) ;
        }
    }
View Full Code Here

    {
        // feature suggested by James Howison
        List<RDFNode> items = new ArrayList<>() ;
        while (rs.hasNext())
        {
            QuerySolution qs = rs.nextSolution() ;
            RDFNode n = qs.get(selectElement) ;
            items.add(n) ;
        }
        return items ;
    }
View Full Code Here

    {
        // feature suggested by James Howison
        List<String> items = new ArrayList<>() ;
        while (rs.hasNext())
        {
            QuerySolution qs = rs.nextSolution() ;
            RDFNode rn = qs.get(selectElement) ;
            if ( rn.isLiteral() )
                items.add( ((Literal)rn).getLexicalForm() ) ;
            else if ( rn.isURIResource() )
                items.add( ((Resource)rn).getURI() ) ;
            else if ( rn.isAnon() )
View Full Code Here

      "    ?author foaf:name ?authorName ." +
      "}";
    Query q = QueryFactory.create(sparql);
    ResultSet rs = QueryExecutionFactory.create(q, m).execSelect();
    while (rs.hasNext()) {
      QuerySolution row = rs.nextSolution();
      System.out.println("Title: " + row.getLiteral("paperTitle").getString());
      System.out.println("Author: " + row.getLiteral("authorName").getString());
    }
    m.close();
  }
View Full Code Here

    Query query = QueryFactory.create(sparql);
    QueryExecution qe = QueryExecutionFactory.create(query, this.model);
    this.results = new HashSet<Map<String,RDFNode>>();
    ResultSet resultSet = qe.execSelect();
    while (resultSet.hasNext()) {
      QuerySolution solution = resultSet.nextSolution();
      addSolution(solution);
    }
  }
View Full Code Here

TOP

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

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.