Package org.ontoware.rdf2go.model.node

Examples of org.ontoware.rdf2go.model.node.URI


 
  public static UserRecommendationPrefs[] getUserRecommendationPrefs(Person person) {
    UserRecommendationPrefs[] result = null;
   
    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>();
View Full Code Here


   * @param bookmarkingSourceURI <tt>String</tt> uri of the bookmarking source
   * @param loginToStore <tt>String</tt> encrypted login to store
   * @param passwordToStore <tt>String</tt> encrypted password to store
   */
  private void writeToStorage(Person person, String bookmarkingSourceURI, String loginToStore, String passwordToStore) {
    URI usersBookmarkinSourceURI = createCredentialsURI(bookmarkingSourceURI, loginToStore, passwordToStore);
    ClosableIterator<Statement> statements = model.findStatements(null,person.getResource(), new URIImpl(S3B_SYNCHRONIZATION.hasBookmarkingSource), null);
    while(statements.hasNext()){
      Statement statement = statements.next();
      Node value = statement.getObject();
      if(value != null && value.toString().startsWith(bookmarkingSourceURI)){
View Full Code Here

    sb.append("/$");
    sb.append(secretLogin);
    sb.append("$/$");
    sb.append(secretPassword);
    sb.append("$");
    URI uri = new URIImpl(sb.toString());
    return uri;
  }
View Full Code Here

  public static synchronized WebBookmarkResource getWebBookmarkResource(String _uri,String _personUri,String _mbox_sha1sum,String _typeUri,ModelSet model)
  {
    WebBookmarkResource wbr = null;
    String saveUri = null;
    String longUri = null;
    URI url;
   
    String personUri = _personUri;
    if(_personUri!=null&&_personUri.startsWith("mailto:"))
      personUri = _personUri.substring(7);
   
    try
    {
      url = new URIImpl(_uri);
    }
    catch (Exception e) { url = null;}
   
    if(url!=null)
    {
      saveUri = url.toString();
      saveUri = saveUri.replace('&', '_');
      saveUri = saveUri.replace('#', '_');
     
      if(_mbox_sha1sum!=null&&!"".equals(_mbox_sha1sum.trim()))
      {
View Full Code Here

    return null;
  }
 
  public static boolean checkIfExists(Resource res)
  {
    URI type = RDF.type;
   
    ClosableIterator<Statement> results = DbFace.getModel().findStatements(null,res, type, null);
    while(results.hasNext())
    {
      Node val = results.next().getObject();
View Full Code Here

    for (QueryParameter element : elements)
    {
      context = element.getValues();
      for (QueryParameterEntry urinode : context)
      {
        URI uri = new URIImpl("");
        if(urinode.isTaxonomyType())
        {
        uri = urinode.getTaxonomy().getURI();
       
        }
        else if(urinode.isWordnetType())
        {
          uri = urinode.getMeaning().getURI();
         
        }
     
         
          Term tDoc = new Term("content", uri.toString());
       
       

        //--first try to determing if the document already exist
     
View Full Code Here

  /**
   * Unique URI of a user (as handled by FOAFRealm service)
   * @param userUri
   */
  public void saveUserRecommendationPrefs(Person person) {
    URI prefsNode = S3BRepository.getInstance().getModel().createURI(person.getUri().toString()+"/recommendationPrefs");
   
    Model m = person.getGraph(Concepts.HAS_RECOMMENDATION_PREF.get(), prefsNode);
    boolean newmodel = m == null;

    if(m == null
      m = S3BRepository.getInstance().parseModel(null);
     
    URI node = m.createURI(person.getUri().toString()+"/recommendationPrefs/"+this.getName());
   
    if(!newmodel || m.contains(node, Variable.ANY, Variable.ANY))
      m.removeStatements(node, Variable.ANY, Variable.ANY);
   
    m.addStatement(prefsNode, Concepts.HAS_PREFERENCE.get(), node);
View Full Code Here

    this.setTimestamp();
  }
 
  public void setType(String type) {
    synchronized (this) {
      URI typeValue = model.createURI(type);
      this.addGraphProperty(RDF.type, typeValue);
    }
    this.setTimestamp();
  }
View Full Code Here

  /**
   * Checks if this resource is an imported root dir
   * @return
   */
  public boolean checkIsImportRootDir(){
    URI predicate = RDF.type;
    ClosableIterator<Statement> it = model.findStatements(null,this.resource, predicate,null);
    while (it.hasNext()) {
      Node ret = it.next().getObject();
      if (ret.toString().equals(S3B_SSCF.ImportedResource)){
        it.close();
View Full Code Here

         findResultInHistory(result,oldvisits);
       }
     }
     Map<URI,Double> termsList = new HashMap<URI,Double>();
     termsList = hist.getTerms(person);
     URI res;
    
     for(QueryParameterEntry ex : queryList)
     {
       if(ex.isWordnetType())
        {
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.node.URI

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.