Package cross.reputation.model

Examples of cross.reputation.model.Dimension


public class ConfigureModel {
 
  static void buildCrossReputationGlobalModel() {
    //Set the dimensions of each scale, the scale of each metric, the metrics
    //of each community, the categories of each community and the communities
    Dimension reputationInQandA = new Dimension("ReputationInQandA");
    Dimension projectsReputation = new Dimension("ReputationInProject");
    Dimension rankReputation = new Dimension("rankReputation");   
   
   
    String qandACategory = GlobalModel.addCategory("QandA");
    String securityWebAppCategory = GlobalModel.addCategory("SecurityWebApp");
    String projectConnCategory = GlobalModel.addCategory("ProjectConnection");
View Full Code Here


public class ConfigureModel {
 
  static public void buildCrossReputationGlobalModel() {
    //Set the dimensions of each scale, the scale of each metric, the metrics
    //of each community, the categories of each community and the communities
    Dimension reputationInQandA = new Dimension("ReputationInQandA");
    Dimension projectsReputation = new Dimension("ReputationInProject");
    Dimension rankReputation = new Dimension("rankReputation");   
   
   
    String qandACategory = GlobalModel.addCategory("QandA");
    String securityWebAppCategory = GlobalModel.addCategory("SecurityWebApp");
    String projectConnCategory = GlobalModel.addCategory("ProjectConnection");
View Full Code Here

            "hasDimension property of Metric resource:"+
            resource.getURI()+" is not a resource")) {
          return null;
        }
      } else {
        Dimension dimension = (Dimension) getResourceFromCache(
            statement.getObject().asResource(),Dimension.class);
        if(dimension == null) {
          dimension = getDimension(model,
              statement.getObject().asResource());         
        }
View Full Code Here

            "sourceDimension property of DimensionCorrelation resource:"+
              resource.getURI()+" is not a resource")) {
            return null;
          }
        } else {
          Dimension dimension = (Dimension) getResourceFromCache(
              statement.getObject().asResource(), Dimension.class);
        if(dimension == null) {     
          dimension = getDimension(model, statement.getObject().asResource());
        }
          dimCor.setSourceDimension(dimension);         
        }
      }
    Property targetDimension = ResourceFactory.
        createProperty(riNamespace + "targetDimension");
    // targetDimension //
        stmtI1 = model.listStatements(resource,
            targetDimension, (RDFNode)null);
    while(stmtI1.hasNext()) {
        Statement statement = stmtI1.nextStatement();
        // validate targetDimension property //
        if(!statement.getObject().isResource()) {         
          if(!ModelException.throwException(ModelException.DIMENSIONCORRELATION,
            "targetDimension property of DimensionCorrelation resource:"+
              resource.getURI()+" is not a resource")) {
            return null;
          }
        } else {
          Dimension dimension = (Dimension) getResourceFromCache(
              statement.getObject().asResource(), Dimension.class);
        if(dimension == null) {     
          dimension = getDimension(model, statement.getObject().asResource());
        }
          dimCor.setTargetDimension(dimension);         
View Full Code Here

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

                " in the database");
        }
  }
 
  public Dimension getDimension(Model model, Resource resource) throws Exception {
    Dimension dimension = (Dimension) getResourceFromCache(resource, Dimension.class);
    if(dimension != null) {     
      return dimension;
    }
    Property name = ResourceFactory.createProperty(riNamespace + "name");   
    // name //
        StmtIterator stmtI1 = model.listStatements(resource, name, (RDFNode)null);
    while(stmtI1.hasNext()) {
        Statement statement = stmtI1.nextStatement();
        /* validate name property */
        if(!statement.getObject().isLiteral()) {         
          if(!ModelException.throwException(ModelException.DIMENSION,
            "name property of Dimension resource:"+
              resource.getURI()+" is not a literal")) {
            return null;
          }
        }
        dimension = new Dimension(statement.getObject().asLiteral().getString());
        dimension.setResource(resource);
        addResourceInstanceToCache(resource, dimension);             
      }
    Property description = ResourceFactory.createProperty(dcNamespace + "description");   
    // description //
        stmtI1 = model.listStatements(resource, description, (RDFNode)null);
    while(stmtI1.hasNext()) {
        Statement statement = stmtI1.nextStatement();
        // validate description property //
        if(!statement.getObject().isLiteral()) {
          if(!ModelException.throwException(ModelException.DIMENSION,
            "description property of Dimension resource:"+
              resource.getURI()+" is not a literal")) {
            return null;
          }
        }
        if(dimension != null) {
          dimension.setDescription(statement.getObject().asLiteral().getString());
        }       
      }
    return dimension;
  }
View Full Code Here

public class ConfigureModel {
 
  static public void buildCrossReputationGlobalModel() throws Exception {
    //Set the dimensions of each scale, the scale of each metric, the metrics
    //of each community, the categories of each community and the communities
    Dimension reputationInQandA = new Dimension("ReputationInQandA");
    Dimension projectsReputation = new Dimension("ReputationInProject");
    Dimension rankReputation = new Dimension("rankReputation");   
   
   
    Category qandACategory = GlobalModel.addCategory("QandA");
    Category securityWebAppCategory = GlobalModel.addCategory("SecurityWebApp");
    Category projectConnCategory = GlobalModel.addCategory("ProjectConnection");
View Full Code Here

TOP

Related Classes of cross.reputation.model.Dimension

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.