Package org.ontoware.rdf2go.model

Examples of org.ontoware.rdf2go.model.QueryResultTable


   
   
    //String query2 = SparqlQuery.SELECT_ALL.getQuery();
    String query2 = SparqlQuery.SELECT_ALL_BOOKS.getQuery();
   
    QueryResultTable sparqlSelect = md.sparqlSelect(query2);
    ClosableIterator<QueryRow> rows = sparqlSelect.iterator();
    while(rows.hasNext()){
      QueryRow row = rows.next();
      String sURI = row.getValue("uri").toString();
      URI termURI = new URIImpl(sURI);
      books.add(termURI);
View Full Code Here


    String queryFilterOut = SscfRdfQuery.RDF_GET_RECOM_BY_PERSON_FILTEROUT.toString(this.person);
    //this.searchType.getWordNetQuery(this.person,wncOne.getURI());
 
    System.out.println(query);
   
    QueryResultTable results = null;
    QueryResultTable resTmp = null;
   
    List<String> filterOut = new ArrayList<String>();
    List<String> inserted = new ArrayList<String>();
    try
    {
      results = DbFace.getModel().querySelect(query,"SPARQL");
      resTmp = DbFace.getModel().querySelect(queryFilterOut,"SPARQL");   
     
      for(QueryRow qr:resTmp)
        filterOut.add(qr.getValue(resTmp.getVariables().get(0)).toString());
    }
    catch (Exception e1)
    {
      //do nothing
    }
   
    if(getNew)
    {
      String prolog,trustPolicies;
      //properties set by the SSCFTrustSampleServlet
      prolog = System.getProperty("RealTrust.XSBEnginePath");
      trustPolicies = System.getProperty("sscftrust.policies");
     
      SSCFTrustEngineExecuter stee = new SSCFTrustEngineExecuter(prolog,trustPolicies,null);
     
      stee.execute(person);
     
      //QueryResultsTable resultsAfter = SesameDbFace.getDbFace().performTableQuery(query);
      QueryResultTable resultsAfter=null;
      try
      {
        resultsAfter = DbFace.getModel().querySelect(query,"SPARQL");
      }
      catch (Exception e1)
      {
        //
      }
     
      if(resultsAfter!=null&&(results==null || getIteratorLength(resultsAfter.iterator())!=getIteratorLength(results.iterator())))
      {
        for(QueryRow qr : resultsAfter) {
         
          FilterResult fr = new FilterResult();
         
          String uriTmp = qr.getValue(resultsAfter.getVariables().get(0)).toString();
         
          if(!filterOut.contains(uriTmp)&&!inserted.contains(uriTmp))
          {
            fr.setResourceUri(uriTmp);
            inserted.add(uriTmp);
            fr.setResourceType(S3B_SSCF.Directory);
            fr.setLabel(qr.getLiteralValue(resultsAfter.getVariables().get(1)));
            try {
              fr.setContent(qr.getLiteralValue(resultsAfter.getVariables().get(2)));
            } catch (Exception e) {
              fr.setContent(null);
            }
            try  {
              fr.setCreator(qr.getValue(resultsAfter.getVariables().get(3)).toString());
            } catch (Exception e) {
              fr.setCreator(null);
            }
            newResults.put(fr.getResourceUri(),fr);
          }
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.QueryResultTable

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.