Package cross.reputation.model

Examples of cross.reputation.model.ReputationModelBehaviour


    }   
    List<Class<? extends ReputationBehaviour>> types =
      new ArrayList<Class<? extends ReputationBehaviour>>();
    types.add(ReputationModelBehaviour.class);
    repMod = getReputationAlgorithm(model, resource, types);   
    ReputationModelBehaviour repModBeh = null;
    for(ReputationBehaviour behaviour : repMod.getBehaviours()) {
      if(behaviour instanceof ReputationModelBehaviour) {
        repModBeh = (ReputationModelBehaviour) behaviour;
      }
    }
    // reputationModule //
    Property reputationModule = ResourceFactory.createProperty(
        riNamespace + "reputationModule");
    StmtIterator stmtI1 = model.listStatements(resource,
        reputationModule, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      /* validate reputationModel property */
      if(!statement.getObject().isResource()) {         
        if(!ModelException.throwException(ModelException.REPUTATIONMODEL,
            "reputationModule property of resource:"+
            resource.getURI()+" is not a resource")) {
          return null;
        }
      } else {
        ReputationAlgorithmImplementation repAlg =
          (ReputationAlgorithmImplementation) getResourceFromCache(
          statement.getObject().asResource(),ReputationAlgorithmImplementation.class);
        if(repAlg == null) {
          repAlg = getReputationAlgorithm(model,
              statement.getObject().asResource(), null);       
        }
        repModBeh.addReputationModules(repAlg);         
      }
    }
    return repMod;
  }
View Full Code Here


    return repMod;
  }
 
  public ReputationBehaviour getReputationModelBehaviour(Model model,
      Resource resource, Class<? extends ReputationBehaviour> type) throws Exception {
    ReputationModelBehaviour behaviour = (ReputationModelBehaviour)
      getResourceFromCache(resource, ReputationModelBehaviour.class);
    if(behaviour != null) {     
      return behaviour;
    }
    behaviour = new ReputationModelBehaviour();
    addResourceInstanceToCache(resource, behaviour);
    // Specific Attributes and Properties of ReputationModel Class //
    // reputationModule //
    Property reputationModule = ResourceFactory.createProperty(
        riNamespace + "reputationModule");
    StmtIterator stmtI1 = model.listStatements(resource,
        reputationModule, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      /* validate reputationModule property */
      if(!statement.getObject().isResource()) {         
        if(!ModelException.throwException(ModelException.REPUTATIONMODEL,
            "reputationModule property of resource:"+
            resource.getURI()+" is not a resource")) {
          return null;
        }
      } else {
        ReputationAlgorithmImplementation repAlg =
          (ReputationAlgorithmImplementation) getResourceFromCache(
          statement.getObject().asResource(),ReputationAlgorithmImplementation.class);
        if(repAlg == null) {
          repAlg = getReputationAlgorithm(model,
              statement.getObject().asResource(), null);       
        }
        behaviour.addReputationModules(repAlg);         
      }
    }
    return behaviour;
  }
View Full Code Here

    if(repAlg.getBehaviours() == null) {
      return metricMappings;
    }
    for(ReputationBehaviour behaviour : repAlg.getBehaviours()) {
      if(ReputationModelBehaviour.class.isInstance(behaviour)) {
        ReputationModelBehaviour model = (
            ReputationModelBehaviour) behaviour;
        if(model.getReputationModules() != null) {
          for(ReputationAlgorithmImplementation module :
            model.getReputationModules()) {
            metricMappings.addAll(findMetricMappings(module));         
          }
        }
      }
      if(ReputationModuleBehaviour.class.isInstance(behaviour)) {
View Full Code Here

    if(repAlg.getBehaviours() == null) {
      return importationUnitsMap;
    }
    for(ReputationBehaviour behaviour : repAlg.getBehaviours()) {
      if(ReputationModelBehaviour.class.isInstance(behaviour)) {
        ReputationModelBehaviour model = (
            ReputationModelBehaviour) behaviour;
        if(model.getReputationModules() != null) {
          for(ReputationAlgorithmImplementation module :
            model.getReputationModules()) {
            importationUnitsMap.putAll(findImportationUnits(module));         
          }
        }
      }
      if(ReputationModuleBehaviour.class.isInstance(behaviour)) {
View Full Code Here

    List<ReputationBehaviour> behaviours = repAlg.getBehaviours();
    List<ObjectWithIdentifier> collectingSystems =
      new ArrayList<ObjectWithIdentifier>();
    for(ReputationBehaviour behaviour : behaviours) {
      if(ReputationModelBehaviour.class.isInstance(behaviour)) {
        ReputationModelBehaviour model = (
            ReputationModelBehaviour) behaviour;
        if(model.getReputationModules() != null) {
          for(ReputationAlgorithmImplementation module :
              model.getReputationModules()) {
            ObjectWithIdentifier collectingSystemsInside =
              findCollectionSystemsInside(module);
            if(collectingSystemsInside == null) {
              continue;
            }
View Full Code Here

TOP

Related Classes of cross.reputation.model.ReputationModelBehaviour

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.