Package com.hp.hpl.jena.query

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


        return Iter.toList(rIter) ;
    }

    private static void addServiceEP(String label, String name, List<String> output, 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() ;
            output.add(epName) ;
            log.info("  "+label+" = /"+name+"/"+epName) ;
        }
    }
View Full Code Here


        Query query = QueryFactory.create(prefixes+string) ;
        QuerySolutionMap initValues = null ;
        if ( varName != null )
            initValues = querySolution(varName, value) ;
        QueryExecution qExec = QueryExecutionFactory.create(query, m, initValues) ;
        ResultSet rs = ResultSetFactory.copyResults(qExec.execSelect()) ;
        qExec.close() ;
        return rs ;
    }
View Full Code Here

        QueryExecution qexec = createQueryExecution(query, dataset) ;
        setAnyTimeouts(qexec, action);

        if ( query.isSelectType() )
        {
            ResultSet rs = qexec.execSelect() ;
           
            // Force some query execution now.
            // Do this to force the query to do something that should touch any underlying database,
            // and hence ensure the communications layer is working.
            // MySQL can time out after 8 hours of an idle connection
            rs.hasNext() ;

//            // Not necessary if we are inside a read lock until the end of sending results.
//            rs = ResultSetFactory.copyResults(rs) ;

            log.info(format("[%d] OK/select", action.id)) ;
View Full Code Here

    ArrayList<VariableDetailsLight> variableDetailsLight = new ArrayList<VariableDetailsLight>();
    int i = 1;
   
    for(OntologyTermData termData: modelSearch.getTermList()){     
      ResultSet results = rdfHandler.getVariableQuery(modelSearch.getModelURL(), termData.getMiriamURN());
      while (results.hasNext()) {
        QuerySolution solution = results.next();
        String variableName = "";
        String predicate = "";
       
        if (solution.getResource("?s") != null) {
          variableName = solution.getResource("?s").getURI();
View Full Code Here

 
  public ArrayList<VariableDetailsLight> getVariableListForAnnotation(VariableSearch variableSearch){
 
    ArrayList<VariableDetailsLight> variableDetailsLight = new ArrayList<VariableDetailsLight>();
     
    ResultSet results = rdfHandler.getVariableQuery(variableSearch.getModelUrl());
    int i=0;
    while (results.hasNext()) {
      QuerySolution solution = results.next();
      String variableName = "";
      String predicate = "";
     
      if (solution.getResource("?s") != null) {
        variableName = solution.getResource("?s").getURI();
View Full Code Here

   
    HashMap<String, ModelDetails> modelDetailsList = new HashMap<String, ModelDetails>();
   
    int i = 1;
    for (OntologyTermData term : modelSearch.getTermList()) {
      ResultSet results = rdfHandler.getModelQuery(term.getMiriamURN());
      while (results.hasNext()) {
    
        QuerySolution solution = results.next();
        String modelName = "";
        int frequency = 0;

        if (solution.getResource("?m") != null) {
          modelName = solution.getResource("?m").getURI();
View Full Code Here

  }
   
 
  public ArrayList<VariableDetailsLight> getVariableAnnotationList(VariableSearch variableSearch){   
    ArrayList<VariableDetailsLight> variableDetailsLight = new ArrayList<VariableDetailsLight>();
    ResultSet results = rdfHandler.getVariableAnnotationQuery(variableSearch.getVariableUrl());
   
    int i=0;
    while (results.hasNext()) {
      QuerySolution solution = results.next();
      String predicate = "";
      String annotation = "";
     
      if (solution.getResource("?p") != null) {
        predicate = solution.getResource("?p").getLocalName();
View Full Code Here

  protected void setUp() {
    rdfHandler = new RDFHandler();
  }
 
  public void testGetModelQuery(){
    ResultSet results = rdfHandler.getModelQuery("urn:miriam:obo.fma:FMA%3A9557");
   
    while (results.hasNext()) {
        
      QuerySolution solution = results.next();
      String modelName = "";
      int frequency = 0;

      if (solution.getResource("?m") != null) {
        modelName = solution.getResource("?m").getURI();
View Full Code Here

    final Date a = new Date();
    final QueryExecution qe = QueryExecutionFactory.create(query, model);
    if (query.isAskType()) {
      qe.execAsk();
    } else if (query.isSelectType()) {
      final ResultSet results = qe.execSelect();
      ResultSetFormatter.consume(results);
    }
    qe.close();
    return ((new Date()).getTime() - a.getTime());
  }
View Full Code Here

        final QueryResult qr = new BooleanResult();
        qe.close();
        return qr;
      }
    } else if (query.isSelectType()) {
      final ResultSet results = qe.execSelect();
      final QueryResult list = resultSetToBindingsList(results);
      qe.close();
      return list;
    } else if (query.isConstructType()) {
      final Model model = qe.execConstruct();
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.