Examples of ReputationAlgorithmImplementation


Examples of cross.reputation.model.ReputationAlgorithmImplementation

            "obtainedBy 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);         
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

            "hasReputationModel property of Community 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);         
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

    }
  }
 
  public ReputationAlgorithmImplementation getReputationImporter(
      Model model, Resource resource) throws Exception {
    ReputationAlgorithmImplementation repImp = (
        ReputationAlgorithmImplementation) getResourceFromCache(
            resource, ReputationAlgorithmImplementation.class);
    if(repImp != null) {     
      return repImp;
    }   
    List<Class<? extends ReputationBehaviour>> types =
      new ArrayList<Class<? extends ReputationBehaviour>>();
    types.add(ReputationImporterBehaviour.class);
    repImp = getReputationAlgorithm(model, resource,types);
    ReputationImporterBehaviour repImpBeh = null;
    for(ReputationBehaviour behaviour : repImp.getBehaviours()) {
      if(behaviour instanceof ReputationImporterBehaviour) {
        repImpBeh = (ReputationImporterBehaviour) behaviour;
      }
    }
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

        System.out.println("The database contains subjects" +
            " of type reputationImporter:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            ReputationAlgorithmImplementation repImpInstance =
              getReputationImporter(model,resource);
            System.out.println(repImpInstance.toString("     "));
        }
    } else {
        System.out.println("No simple String riNamespace+" +
            "reputationImporter were found in the database");
    }
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

            "collectsReputationBy property of ImportationUnit resource:"+
            resource.getURI()+" is not a resource")) {
          return null;
        }
      } else {
        ReputationAlgorithmImplementation colAlg = (
            ReputationAlgorithmImplementation) getResourceFromCache(
            statement.getObject().asResource(),ReputationAlgorithmImplementation.class);
        if(colAlg == null) {
          colAlg = getReputationAlgorithm(model,
              statement.getObject().asResource(),null);         
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

  }
 
  public ReputationAlgorithmImplementation getReputationAlgorithm(Model model,
      Resource resource, List<Class<? extends ReputationBehaviour>> types
      ) throws Exception {
    ReputationAlgorithmImplementation repAlg = (
        ReputationAlgorithmImplementation) getResourceFromCache(
        resource, ReputationAlgorithmImplementation.class);
    if(repAlg != null) {     
      return repAlg;
    }   
    repAlg = new ReputationAlgorithmImplementation();
    repAlg.setResource(resource);
    addResourceInstanceToCache(resource, repAlg);
    if(types == null) {     
      StmtIterator stmtI1 = model.listStatements(resource, RDF.type, (RDFNode)null);           
      while(stmtI1.hasNext()) {
        Statement typeStatement = stmtI1.nextStatement();
        for(Resource resourceType : reputationAlgorithmSubclasses.keySet()) {
          if(typeStatement.getObject().asResource().getURI().equals(
              resourceType.getURI())) {
            addBehaviourToReputationAlgorithm(model, resource,
                reputationAlgorithmSubclasses.get(resourceType),repAlg);
          }
        }               
      }
      for(Property property : reputationSubclassesProperties.keySet()) {
        stmtI1 = model.listStatements((Resource) null, property, resource);
        if(stmtI1.hasNext()) {
          addBehaviourToReputationAlgorithm(model, resource,
              reputationSubclassesProperties.get(property),repAlg);         
        }
      }
      for(Property property : reputationSubclassSubjectProperties.keySet()) {
        stmtI1 = model.listStatements(resource, property, (RDFNode) null);
        if(stmtI1.hasNext()) {
          addBehaviourToReputationAlgorithm(model, resource,
              reputationSubclassSubjectProperties.get(property),repAlg);
        }
      }     
    } else {
      for(Class<? extends ReputationBehaviour> type : types) {
        ReputationBehaviour behaviour = (
            ReputationBehaviour) getResourceFromCache(resource, type);
        if(behaviour == null) {
          behaviour = type.newInstance();
          addResourceInstanceToCache(resource, behaviour);
        }
        repAlg.addBehaviour(behaviour, repAlg);
        //behaviour.setRoot(repAlg);
      }
    }

    // Specific Attributes and Properties of ReputationalAlgorithm Class //
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

        System.out.println("The database contains subjects" +
            " of type ReputationAlgorithm:");
        while (iters.hasNext()) {
            Resource resource = iters.nextResource();
            System.out.println("  " + resource.getLocalName());
            ReputationAlgorithmImplementation repAlgInstance =
              getReputationAlgorithm(model,resource,null);
            System.out.println(repAlgInstance.toString("     "));                     
        }
    } else {
        System.out.println("No simple String riNamespace+" +
            "ReputationAlgorithm were found in the database");
    }
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

    if(!resourcesCache.isEmpty()) {   
      System.out.println("The database contains subjects" +
          " of class or superclass ReputationAlgorithm:");
      for(Resource resource : resourcesCache) {
            System.out.println("  " + resource.getLocalName());
          ReputationAlgorithmImplementation repAlgInstance =
               getReputationAlgorithm(model,resource,null);
          System.out.println("  "+repAlgInstance);
          System.out.println(repAlgInstance.toString("     "));
      }
    } else {
        System.out.println("No simple String riNamespace+" +
            "ReputationAlgorithm were found in the database");
    }
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

    }
  }
 
  public ReputationAlgorithmImplementation getReputationalAction(
      Model model, Resource resource) throws Exception {
    ReputationAlgorithmImplementation repAct = (
        ReputationAlgorithmImplementation) getResourceFromCache(
        resource, ReputationalActionBehaviour.class);
    if(repAct != null) {     
      return repAct;
    }   
View Full Code Here

Examples of cross.reputation.model.ReputationAlgorithmImplementation

            collectingSystem.getURI())) {
          return getCollectingSystem(model, resource);
        }       
      }
      if(type == null) {
        ReputationAlgorithmImplementation repAct = (
            ReputationAlgorithmImplementation) getResourceFromCache(
            resource, CollectingAlgorithmBehaviour.class);
        if(repAct != null) {     
          return repAct;
        }
        types.add(CollectingAlgorithmBehaviour.class);
      }
    } else {
      ReputationAlgorithmImplementation repAct = (
        ReputationAlgorithmImplementation) getResourceFromCache(resource, type);
      if(repAct != null) {     
        return repAct;
      }
      types.add(type);     
    }
    ReputationAlgorithmImplementation colAlg =
      getReputationAlgorithm(model, resource, types);
    @SuppressWarnings("unused")
    CollectingAlgorithmBehaviour colAlgBeh = null;
    for(ReputationBehaviour behaviour : colAlg.getBehaviours()) {
      if(behaviour instanceof CollectingAlgorithmBehaviour) {
        colAlgBeh = (CollectingAlgorithmBehaviour) behaviour;
      }
    }
    // Specific Attributes and Properties of CollectingAlgorithm Class //
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.