Examples of varNames()


Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

    ResultSet resultSet = queryCkan();
    while (resultSet.hasNext()) {
      JSONObject endpointObject = new JSONObject();
     
      QuerySolution querySolution = resultSet.next();
      Iterator<String> varNames = querySolution.varNames();
      while (varNames.hasNext()) {
        String varName = varNames.next();
        endpointObject.put(varName, EndpointsFetcher.getBindingValueAsString(querySolution.get(varName)));
      }
      endpoints.put(endpointObject);
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

            results.addProperty(ResultSetGraphVocab.solution, thisSolution) ;
            if ( false )
                results.addLiteral(ResultSetGraphVocab.index, count) ;

            Iterator<String> iter = getAllVars() ?
                                    rBind.varNames() :
                                    resultSet.getResultVars().iterator() ;
           
            for ( ; iter.hasNext() ; )
            {
                Resource thisBinding = model.createResource() ;
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

    QueryExecution qe = QueryExecutionFactory.create(QueryFactory.create(sparql), model);
    try {
      ResultSet rs = qe.execSelect();
      while (rs.hasNext()) {
        QuerySolution sol = rs.nextSolution();
        for (Iterator<String> varNames = sol.varNames(); varNames.hasNext(); ) {
          String varName = varNames.next();
          result.put(varName, sol.get(varName).toString());
        }
      }
    } finally {
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

    QueryExecution qe = QueryExecutionFactory.create(QueryFactory.create(sparql, Syntax.syntaxARQ), model);
    try {
      ResultSet rs = qe.execSelect();
      while (rs.hasNext()) {
        QuerySolution sol = rs.nextSolution();
        for (Iterator<String> varNames = sol.varNames(); varNames.hasNext(); ) {
          String varName = varNames.next();
          result = sol.get(varName).toString();
        }
      }
    } finally {
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

   */
  class mapSolutionMapper implements SolutionMapper<Map<String, String>> {
    public Map<String, String> mapSelect(ResultSet rs, int number) {
      QuerySolution sol = rs.nextSolution();
      Map<String, String> row = new HashMap<String, String>();
      for (Iterator<String> varNames = sol.varNames(); varNames.hasNext(); ) {
        String varName = varNames.next();
        row.put(varName, sol.get(varName).toString());
      }
      return row;
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

   */
  class genericMapSolutionMapper implements SolutionMapper<Map<String, Object>> {
    public Map<String, Object> mapSelect(ResultSet rs, int number) {
      QuerySolution sol = rs.nextSolution();
      Map<String, Object> row = new HashMap<String, Object>();
      for (Iterator<String> varNames = sol.varNames(); varNames.hasNext(); ) {
        String varName = varNames.next();
        RDFNode varNode = sol.get(varName);
        row.put(varName, (varNode.isLiteral() ? varNode.asLiteral().getValue() : varNode.toString()));
      }
      return row;
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

       
        while ((results != null) && (results.hasNext())) {
            QuerySolution qs = results.next();
            if (cols.size() == 0) {
                // columns are not defined yet
                Iterator<String> varNames = qs.varNames();
                while (varNames.hasNext()) {
                    cols.add(varNames.next());
                }
                result.setColumnNames(cols);
            }
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

      sparqlResult = new SparqlResult(results.getResultVars());

      while (results.hasNext()) {
        QuerySolution soln = results.nextSolution();
        List<RDFNode> result = new ArrayList<RDFNode>();
        Iterator<String> varNamesIter = soln.varNames();
        while (varNamesIter.hasNext()) {
          String varName = varNamesIter.next();
          result.add(soln.get(varName));
        }
        sparqlResult.addResult(result);
View Full Code Here

Examples of com.hp.hpl.jena.query.QuerySolution.varNames()

       
        while ((results != null) && (results.hasNext())) {
            QuerySolution qs = results.next();
            if (cols.size() == 0) {
                // columns are not defined yet
                Iterator<String> varNames = qs.varNames();
                while (varNames.hasNext()) {
                    cols.add(varNames.next());
                }
                result.setColumnNames(cols);
            }
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.