Package org.ontoware.rdf2go.model

Examples of org.ontoware.rdf2go.model.QueryResultTable


   
    String person = personUri;
    if(person!=null&&!personUri.startsWith("mailto:")&&!personUri.startsWith("http"))
      person = "mailto:"+person;
   
    QueryResultTable results=null;
   
    if(person!=null&&entry!=null&&!isTaxonomy)
    {
      String query = FilterModes.ModeWordnet.getQuery(searchType, person, entry.getURI().toString(),0);
      try
      {
        results = DbFace.getModel().querySelect(query,"SPARQL");
      }
      catch (Exception e1)
      {
        //
      }
    }
    if(person!=null&&entry!=null&&isTaxonomy)
    {
      String query = FilterModes.ModeTax.getQuery(searchType, person, entry.getURI().toString(),0);         
      try
      {
        results = DbFace.getModel().querySelect(query,"SPARQL");
      }
      catch (Exception e1)
      {
        //
      }
    } 
   
    if(results!=null)
    {
      int i = 0;
      ClosableIterator<QueryRow> it = results.iterator();
     
      while(it.hasNext()) {
        i++;
      }
      it.close();
View Full Code Here


 
      if (this.mapIsEvaluated.get(person) != null) {
       
        try
        {
          QueryResultTable results = model.querySelect(RdfQuery.RDFQ_EVAL_QUERY.toString(
              this.resource, S3B_SSCF.isEvaluatedWith,
              SIOC.postedBy, person.getResource()),"SPARQL");
         
          for(QueryRow qr: results){
            eval = qr.getValue(results.getVariables().get(0));
          }
        }
        catch (Exception e)
        {
          eval = null;
View Full Code Here

    synchronized (this) {
      if (this.mapIsEvaluated.get(person) != null) {
 
        try
        {
          QueryResultTable results = model.querySelect(RdfQuery.RDFQ_EVAL_QUERY.toString(
            this.resource, S3B_SSCF.isEvaluatedWith,
            SIOC.postedBy, person.getResource()),"SPARQL");
         
         
          for(QueryRow qr: results) {
            Node eval = qr.getValue(results.getVariables().get(0));
            if(eval!=null) {
              removeGraphProperty(new URIImpl(S3B_SSCF.isEvaluatedWith), eval);
              model.removeStatements(null,eval.asBlankNode(), null, null);
              this.mapIsEvaluated.remove(person);
            }
View Full Code Here

    {
      List<XResource> content = new ArrayList<XResource>();
      List<XResource> contentDirs = new ArrayList<XResource>();
 
      // query: SELECT res FROM {res} <XFOAF_SSCF.isIn> {<this.resource>}
      QueryResultTable results;
      try
      {
        System.out.println("-- list content "+this.getLabel());
        results = model.querySelect(RdfQuery.RDFQ_RES_WITH_TYPE_QUERY.toString(
            S3B_SSCF.isIn, this.resource,RDF.type),"SPARQL");
     
        //for (int i = 0; i < results.getRowCount(); i++) {
        for(QueryRow qr: results) {
         
          Object type = qr.getValue(results.getVariables().get(1))// result[1];
          if(type!=null)
          {
            String res = qr.getValue(results.getVariables().get(0)).toString();
            if(type.toString().equals(S3B_SSCF.Resource)||type.toString().equals(S3B_SSCF.Directory))
            {
              XfoafSscfResource xfoafres = XfoafSscfResource.getXfoafSscfResource(res);
              if (xfoafres != null&&type.toString().equals(S3B_SSCF.Resource)) {
                content.add(xfoafres);
View Full Code Here

    {
      List<XfoafSscfResource> content = new ArrayList<XfoafSscfResource>();
 
      try
      {
        QueryResultTable results = model.querySelect(RdfQuery.RDFQ_RES_SSCF_SUGGESTED_WITHOUT_PERM_REMOVED.toString(
            S3B_SSCF.isInSuggested, this.resource,S3B_SSCF.removedSuggested),"SPARQL");
       
        for(QueryRow qr: results)
        {
          String res = qr.getValue(results.getVariables().get(0)).toString();
          XfoafSscfResource xfoafres = XfoafSscfResource.getXfoafSscfResource(res);
          if (xfoafres != null) {
            content.add(xfoafres);
          }
        }
View Full Code Here

          isDir = it.hasNext();
          it.close();
         
          this.tags = BookmarksHelper.listTags(this.getStringURI());
         
          QueryResultTable results = model.querySelect(RdfQuery.RDFQ_PERSON_VALUE_QUERY.toString(
              this.resource, S3B_SSCF.isEvaluatedWith,
              SIOC.postedBy, S3B_SSCF.value),"SPARQL");
         
          for(QueryRow qr : results) {
            try
            {
              Node person = qr.getValue(results.getVariables().get(0));
              //XXX: here may be something wrong
              float val = Float.parseFloat(qr.getValue(results.getVariables().get(1)).toString());
              this.mapIsEvaluated.put(PersonFactory.getPerson(person.asURI()), val);
            }
            catch (Exception e)
            {
              //in case of any error - put nothing
View Full Code Here

    }
  }

  private void initAccessibleTo()
  {
    QueryResultTable results = model.querySelect(RdfQuery.RDFQ_OBJ_QUERY.toString( this.resource,
      S3B_SSCF.accessibleTo),"SPARQL");
    for (QueryRow qr:results) {
      this.setAccessibleTo.add( qr.getValue(results.getVariables().get(0)).toString());
    }
  }
View Full Code Here

      this.setAccessibleTo.add( qr.getValue(results.getVariables().get(0)).toString());
    }
  }
 
  private void initLstIsInSuggested() {
    QueryResultTable results = model.querySelect(RdfQuery.RDFQ_OBJ_SSCF_SUGGESTED_WITHOUT_PERM_REMOVED.toString(
      this.resource,S3B_SSCF.isInSuggested,S3B_SSCF.removedSuggested,S3B_SSCF.isIn),"SPARQL");
    if (lstIsInSuggested == null) {
      lstIsInSuggested = new ArrayList<XfoafSscfResource>();
    }
    for (QueryRow qr:results) {
      Node value = qr.getValue(results.getVariables().get(0));
      XfoafSscfResource x = XfoafSscfResource
          .getXfoafSscfResource(value.asResource().toString());
      this.lstIsInSuggested.add(x);
    }
  }
View Full Code Here

      this.lstIsInSuggested.add(x);
    }
  }
 
  protected void initLstIsIn() {
    QueryResultTable results = model.querySelect(RdfQuery.RDFQ_OBJ_QUERY.toString( this.resource,
      S3B_SSCF.isIn),"SPARQL");
    if (lstIsIn == null) {
      lstIsIn = new ArrayList<XfoafSscfResource>();
    }
    for (QueryRow qr:results) {
      Node value = qr.getValue(results.getVariables().get(0));
      XfoafSscfResource x = XfoafSscfResource
          .getXfoafSscfResource(value.asResource().toString());
      this.lstIsIn.add(x);
    }
  }
View Full Code Here

    if(person != null){
      URI prefsNode = S3BRepository.getInstance().getModel().createURI(person.getUri().toString()+"/recommendationPrefs");
      Model m = person.getGraph(Concepts.HAS_RECOMMENDATION_PREF.get(), prefsNode);
      if(m != null) {
        String q = Queries.LIST_RECOMMENDATION_PREFERENCES.getQuery(prefsNode.toString());
        QueryResultTable table = m.querySelect(q, "SPARQL");
       
        if(table != null){
          ClosableIterator<QueryRow> it = table.iterator();
          Set<UserRecommendationPrefs> sprefs = new HashSet<UserRecommendationPrefs>();
         
          while(it.hasNext()) {
            QueryRow row = it.next();
           
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.