Package com.hp.hpl.jena.query

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


   
    Query query = QueryFactory.create(Req) ;
        QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
        ResultSet results = qexec.execSelect();
        while(results.hasNext()){
          QuerySolution rs = results.nextSolution();
          Resource dipl = rs.getResource("dipl");
          Resource niv = rs.getResource("niv");
          if(!niv.getLocalName().equals(("NamedIndividual"))){
            String temp[] = new String[2];
            temp[0] = dipl.getLocalName();
View Full Code Here


   
    Query query = QueryFactory.create(Req) ;
        QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
        ResultSet results = qexec.execSelect();
        while(results.hasNext()){
          QuerySolution rs = results.nextSolution();
          Resource prof = rs.getResource("prof");
          if(!professeur.equals(prof.getLocalName())){
            res.add(prof.getLocalName());
          }
        }
View Full Code Here

      System.out.println(SparqlType);
      Query query = QueryFactory.create(SparqlType) ;
          QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
          ResultSet results = qexec.execSelect();
          while(results.hasNext()){
          QuerySolution rs = results.nextSolution();
          Resource type = rs.getResource("type");
          if(!type.getLocalName().equals("NamedIndividual") && !type.getLocalName().equals("ObjectProperty")){
            //System.out.println("* "+type.getLocalName());
            lt.addLtuples(mot, type.getLocalName());
           
View Full Code Here

    //System.out.println(SparqlClass);
    Query query = QueryFactory.create(SparqlClass) ;
        QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
        ResultSet results = qexec.execSelect();
        if(results.hasNext()){
          QuerySolution rs = results.nextSolution();
          Resource classa = rs.getResource("classa");
          if(classa.getLocalName().contains("Composante")){
            return "Composante";
          }
          else if(classa.getLocalName().contains("Personnel")){
View Full Code Here

        insertPrefixesInto(model) ;
        if ( qRes != null )
        {
            for ( ; qRes.hasNext() ; )
            {
                QuerySolution rb = qRes.nextSolution() ;
                for ( String varName : query.getResultVars() )
                {
                    RDFNode n = rb.get(varName) ;
                    set.add(n) ;
                }
View Full Code Here

    ResultSet results = getResults() ;
   
    if (results != null) {
      while ( results.hasNext() ) {
       
        Map<String,String> valueMap = getValueMap(results.nextSolution()) ;
       
        String language = valueMap.get("language") ;
     
        // Retrieving a Crop record automatically creates it...
        Crop crop = getCrop( valueMap.get("taxon"), valueMap.get("scientificName") ) ;
View Full Code Here

    execSelect();

    ResultSet results = getResults() ;
    if (results != null) {
      while ( results.hasNext() ) {
        QuerySolution soln = results.nextSolution() ;
        String   uri = soln.get("category").toString();
        RDFNode node = soln.get("name");
       
        if(!categories.containsKey(uri)) {
          categories.put(uri, new HashMap<String,String>()) ;
View Full Code Here

    execSelect();

    ResultSet results = getResults() ;
    if (results != null) {
      while ( results.hasNext() ) {
        QuerySolution soln = results.nextSolution() ;
        String cropName      = soln.get("crop").toString();
        String language_code = soln.get("language").toString();       
        if(!cropMap.containsKey(cropName)) {
          cropMap.put(cropName, new HashSet<String>()) ;
        }
View Full Code Here

   
    QueryExecution qexec = QueryExecutionFactory.create(query, csv);
    ResultSet results = qexec.execSelect();
   
    assertTrue(results.hasNext());
    QuerySolution soln = results.nextSolution();
    assertEquals( "Northville", soln.getLiteral("townName").getString());
    assertTrue( 654000 == soln.getLiteral("pop").getInt());
   
    assertFalse(results.hasNext());
  }
View Full Code Here

   
    QueryExecution qexec = QueryExecutionFactory.create(query, csv);
    ResultSet results = qexec.execSelect();
   
    assertTrue(results.hasNext());
    QuerySolution soln = results.nextSolution();
    assertEquals( "David Sweeney", soln.getLiteral("name").getString());
    assertEquals( "Research, Innovation and Skills", soln.getLiteral("unit").getString());
   
    assertFalse(results.hasNext());
  }
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.