Examples of EntityIdentifier


Examples of cross.reputation.model.EntityIdentifier

        new EntityIdentifier("Sairam Kunala",null));*/
    Entity racker = GlobalModel.addEntity(new Entity("Racker"));
    //racker.addIdentificatorInCommunities(GlobalModel.getCommunities().get("ohloh.net"),
    //    new EntityIdentifier("janosch","http://www.ohloh.net/p/linux-omap/contributors/34615288934090"));
    racker.addIdentificatorInCommunities(GlobalModel.getCommunities().get("sla.ckers.org"),
        new EntityIdentifier("rsnake",null));
    GetMoreAccounts();
    return GlobalModel.getEntities().values();
  }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

  static private void SetAccountsInEntity(Entity entity, String userName, List<String> accounts) {
    for(String accountName : accounts) {
      Community community = getCommunityByAccountName(accountName);
      if(community == null)
        continue;
      EntityIdentifier id = entity.getIdentificatorInCommunities().get(community);
      if(id == null) {
        System.out.println("New account:"+entity.getUniqueIdentificator()+","+
            community.getName()+","+userName+","+accountName);
        entity.addIdentificatorInCommunities(community,
          new EntityIdentifier(userName, accountName));
      } else if(id.getUrl() == null) {
        System.out.println("Update account:"+entity.getUniqueIdentificator()+","+
            community.getName()+","+userName+","+accountName);
        id.setUrl(accountName);
      }
    }
  }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

  }
 
  static public Collection<Entity> SetWikiUserEntitiesAndAccounts() {
    Entity administrator = GlobalModel.addEntity(new Entity("Administrator"));
    administrator.addIdentificatorInCommunities(GlobalModel.getCommunities().get("serverfault.com"),
        new EntityIdentifier("Ben Torell",null));
    Entity pblanco = GlobalModel.addEntity(new Entity("PBlanco"));
    pblanco.addIdentificatorInCommunities(GlobalModel.getCommunities().get("serverfault.com"),
        new EntityIdentifier("wayne koorts",null));
    pblanco.addIdentificatorInCommunities(GlobalModel.getCommunities().get("security.stackexchange.com"),
        new EntityIdentifier("kk-sjp-kk","http://security.stackexchange.com/users/1337/sjp"));
    pblanco.addIdentificatorInCommunities(GlobalModel.getCommunities().get("ohloh.net"),
        new EntityIdentifier("Arjan van de Ven",null));
    Entity jAMaldonado = GlobalModel.addEntity(new Entity("Jamaldonado"));
    jAMaldonado.addIdentificatorInCommunities(GlobalModel.getCommunities().get("questions.securitytube.net"),
        new EntityIdentifier("Andre G",null));
    jAMaldonado.addIdentificatorInCommunities(GlobalModel.getCommunities().get("security.stackexchange.com"),
        new EntityIdentifier("Karrax",null));
    jAMaldonado.addIdentificatorInCommunities(GlobalModel.getCommunities().get("stackoverflow.com"),
        new EntityIdentifier("Karrax",null));
    Entity dPozog = GlobalModel.addEntity(new Entity("DPozog"));
    dPozog.addIdentificatorInCommunities(GlobalModel.getCommunities().get("stackoverflow.com"),
        new EntityIdentifier("347915/Jose",null));
    dPozog.addIdentificatorInCommunities(GlobalModel.getCommunities().get("security.stackexchange.com"),
        new EntityIdentifier("sdanelson",null));
    Entity ebarear = GlobalModel.addEntity(new Entity("Ebarear"));
    ebarear.addIdentificatorInCommunities(GlobalModel.getCommunities().get("stackoverflow.com"),
        new EntityIdentifier("Jon Skeet",null));
    Entity edukun = GlobalModel.addEntity(new Entity("Edukun"));
    edukun.addIdentificatorInCommunities(GlobalModel.getCommunities().get("ohloh.net"),
        new EntityIdentifier("Gavin Sharp",null));
    edukun.addIdentificatorInCommunities(GlobalModel.getCommunities().get("security.stackexchange.com"),
        new EntityIdentifier("Sairam Kunala",null));
    Entity racker = GlobalModel.addEntity(new Entity("Racker"));
    racker.addIdentificatorInCommunities(GlobalModel.getCommunities().get("ohloh.net"),
        new EntityIdentifier("janosch","http://www.ohloh.net/p/linux-omap/contributors/34615288934090"));
    //racker.addIdentificatorInCommunities(GlobalModel.getCommunities().get("sla.ckers.org"),
    //    new EntityIdentifier("rsnake",null));
    GetMoreAccounts();
    return GlobalModel.getEntities().values();
  }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

  static private void SetAccountsInEntity(Entity entity, String userName, List<String> accounts) {
    for(String accountName : accounts) {
      Community community = getCommunityByAccountName(accountName);
      if(community == null)
        continue;
      EntityIdentifier id = entity.getIdentificatorInCommunities().get(community);
      if(id == null) {
        System.out.println("New account:"+entity.getUniqueIdentificator()+","+
            community.getName()+","+userName+","+accountName);
        entity.addIdentificatorInCommunities(community,
          new EntityIdentifier(userName, accountName));
      } else if(id.getUrl() == null) {
        System.out.println("Update account:"+entity.getUniqueIdentificator()+","+
            community.getName()+","+userName+","+accountName);
        id.setUrl(accountName);
      }
    }
  }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

            System.out.println("Error: domain is not known from user:"+
            entity.getUniqueIdentificator()+" and it is discarted: "+contents[i]);
            continue;
          }
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
              new EntityIdentifier(entity.getUniqueIdentificator(),contents[i]));
        } else {
          String userName = contents[i].substring(0,coincidence);
          //System.out.println("iu:"+entity.getUniqueIdentificator()+",u:"+userName);
          String domain = findDomain(contents[i].substring(coincidence+3));
          //System.out.println("d:"+domain);         
          if(domain == null) {
            System.out.println("Error: domain is not known from user:"+
                entity.getUniqueIdentificator()+"-nickname:"+userName+
                " and it is discarted: "+contents[i].substring(coincidence+3));
            continue;
          }
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
              new EntityIdentifier(userName,null));
        }         
      }
      if(!entity.getIdentificatorInCommunities().isEmpty()) {
        GlobalModel.addEntity(entity);
      }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

            System.out.println("Error: domain is not known from user:"+
            entity.getUniqueIdentificator()+" and it is discarted: "+contents[i]);
            continue;
          }
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
              new EntityIdentifier(entity.getUniqueIdentificator(),contents[i]));
        } else {
          String userName = contents[i].substring(0,coincidence);
          //System.out.println("iu:"+entity.getUniqueIdentificator()+",u:"+userName);
          String domain = findDomain(contents[i].substring(coincidence+3));
          //System.out.println("d:"+domain);         
          if(domain == null) {
            System.out.println("Error: domain is not known from user:"+
                entity.getUniqueIdentificator()+"-nickname:"+userName+
                " and it is discarted: "+contents[i].substring(coincidence+3));
            continue;
          }
          entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
              new EntityIdentifier(userName,null));
        }         
      }
      if(!entity.getIdentificatorInCommunities().isEmpty()) {
        GlobalModel.addEntity(entity);
      }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

    return community;
  }
 
  public EntityIdentifier getFoafOnlineAccount(Model model,
      Resource resource) throws Exception {
    EntityIdentifier onlAcc = (EntityIdentifier) getResourceFromCache(
        resource, EntityIdentifier.class);
    if(onlAcc != null) {
      return onlAcc;         
    }
    onlAcc = new EntityIdentifier();
    onlAcc.setResource(resource);
    addResourceInstanceToCache(resource, onlAcc);
    // Specific Attributes and Properties of Foaf:OnlineAccount Class //
    // foafAccountName //
    Property foafAccountName = ResourceFactory.createProperty(
        foafNamespace + "accountName");
    StmtIterator stmtI1 = model.listStatements(resource,
        foafAccountName, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate name property //
      if(!statement.getObject().isLiteral()) {         
        if(!ModelException.throwException(ModelException.ONLINEACCOUNT,
            "name property of OnlineAccount resource:"+
            resource.getURI()+" is not a literal")) {
          return null;
        }
      } else {
        onlAcc.setName(statement.getObject().asLiteral().getString());
      }
    }
    // foafAccountProfilePage //
    Property foafAccountProfilePage = ResourceFactory.createProperty(
        foafNamespace + "accountProfilePage");
    stmtI1 = model.listStatements(resource,
        foafAccountProfilePage, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate name property //
      if(!statement.getObject().isLiteral()) {         
        if(!ModelException.throwException(ModelException.ONLINEACCOUNT,
            "name property of OnlineAccount resource:"+
            resource.getURI()+" is not a literal")) {
          return null;
        }
      } else {
        onlAcc.setUrl(statement.getObject().asLiteral().getString());
      }
    }
    // belongsTo //
    Property belongsTo = ResourceFactory.createProperty(
        riNamespace + "belongsTo");   
    stmtI1 = model.listStatements(resource,
        belongsTo, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate belongsTo property //
      if(!statement.getObject().isResource()) {         
        if(!ModelException.throwException(ModelException.ONLINEACCOUNT,
            "belongsTo property of resource:"+
            resource.getURI()+" is not a resource")) {
          return null;
        }
      } else {
        onlAcc.setBelongsTo(getLimitedCommunity(model,
            statement.getObject().asResource()));
      }
    }
    return onlAcc;
  }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

                  entity.getUniqueIdentificator()+" and it is discarted: "+ accountURL);
                  continue;
                }
                if(!accountUserName.equals("")){
                  entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
                    new EntityIdentifier(accountUserName,null));
                }
                else{
                  entity.addIdentificatorInCommunities(GlobalModel.getCommunities().get(domain),
                    new EntityIdentifier(entity.getUniqueIdentificator(),accountURL));
                }
                 
                if(!entity.getIdentificatorInCommunities().isEmpty()) {
                  GlobalModel.addEntity(entity);
                }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

        new EntityIdentifier("Sairam Kunala",null));*/
    Entity racker = GlobalModel.addEntity(new Entity("Racker"));
    //racker.addIdentificatorInCommunities(GlobalModel.getCommunities().get("ohloh.net"),
    //    new EntityIdentifier("janosch","http://www.ohloh.net/p/linux-omap/contributors/34615288934090"));
    racker.addIdentificatorInCommunities(GlobalModel.getCommunities().get("sla.ckers.org"),
        new EntityIdentifier("rsnake",null));
    GetMoreAccounts();
    return GlobalModel.getEntities().values();
  }
View Full Code Here

Examples of cross.reputation.model.EntityIdentifier

  static private void SetAccountsInEntity(Entity entity, String userName, Collection<String> accounts) {
    for(String accountName : accounts) {
      Community community = getCommunityByAccountName(accountName);
      if(community == null)
        continue;
      EntityIdentifier id = entity.getIdentificatorInCommunities().get(community);
      if(id == null) {
        System.out.println("New account:"+entity.getUniqueIdentificator()+","+
            community.getName()+","+userName+","+accountName);
        entity.addIdentificatorInCommunities(community,
          new EntityIdentifier(userName, accountName));
      } else if(id.getUrl() == null) {
        System.out.println("Update account:"+entity.getUniqueIdentificator()+","+
            community.getName()+","+userName+","+accountName);
        id.setUrl(accountName);
      }
    }
  }
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.