Examples of QuerySolution


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

            Set<RDFNode> seen=Sets.newHashSet();
            Map<RDFNode,RDFNode> map=Maps.newHashMap();
            List<String> vars=results.getResultVars();

            while(results.hasNext()) {
                QuerySolution row=results.nextSolution();
                RDFNode key=row.get(vars.get(0));
                if(seen.contains(key)) {
                    map.remove(key);
                } else {
                    seen.add(key);
                    map.put(key,row.get(vars.get(1)));
                }
            }
            return map;
        } finally { qe.close(); }
    }
View Full Code Here

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

    out.printf("</tr>%n");
   
    if ( results.hasNext() ) {
      while ( results.hasNext() ) {
        out.printf("<tr>%n");
        QuerySolution sol = results.nextSolution();
        Iterator<?> varNames = sol.varNames();
        while ( varNames.hasNext() ) {
          String varName = String.valueOf(varNames.next());
          String varValue = String.valueOf(sol.get(varName));
         
          String link = Util.getLink(varValue);
          if ( link != null ) {
            out.printf("\t<td><a href=\"%s\">%s</a></td>%n", link, Util.toHtml(varValue));
          }
View Full Code Here

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

    while ( results.hasNext() ) {
     
      String entityUri = null;
      String classUri = null;
     
      QuerySolution sol = results.nextSolution();
      Iterator<?> varNames = sol.varNames();
      while ( varNames.hasNext() ) {
        String varName = String.valueOf(varNames.next());

        RDFNode rdfNode = sol.get(varName);
       
        if ( rdfNode.isAnon() ) {
          continue;
        }
       
View Full Code Here

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

    while ( results.hasNext() ) {
     
      String entityUri = null;
      String domainUri = null;
     
      QuerySolution sol = results.nextSolution();
      Iterator<?> varNames = sol.varNames();
      while ( varNames.hasNext() ) {
        String varName = String.valueOf(varNames.next());

        RDFNode rdfNode = sol.get(varName);
       
        if ( rdfNode.isAnon() ) {
          continue;
        }
       
View Full Code Here

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

    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);
       
        if ( rdfNode.isAnon() ) {
          continue;
        }
       
View Full Code Here

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

    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;
     
      while ( varNames.hasNext() ) {
        String varName = varNames.next().toString();
        RDFNode rdfNode = sol.get(varName);
       
        if ( rdfNode.isAnon() ) {
          continue;
        }
       
View Full Code Here

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

   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
     
      QuerySolution sol = results.nextSolution();
     
      String left = null;
      String rel = null;
      String right = null;
     
      Iterator<?> varNames = sol.varNames();
      while ( varNames.hasNext() ) {
        String varName = String.valueOf(varNames.next());
        RDFNode rdfNode = sol.get(varName);
       
        if ( rdfNode.isAnon() ) {
          continue;
        }
       
View Full Code Here

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

       
        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

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

    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

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

    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();
        }
        if (solution.getResource("?p") != null) {
          predicate = solution.getResource("?p").getLocalName();
        }
 
        VariableDetails variableDetails = new VariableDetails(String.valueOf(i++),modelSearch.getModelURL(),variableName, predicate,termData.getMiriamURN());
       
        variableDetailsLight.add(variableDetails.getLightWeightContact());
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.