Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Property


      repObjResource.addProperty(RDF.type, JenaVocabulary.reputationObject);
    }
    Entity finalOwner = getFinalOwner(null, null, reputationObject,
          owner, true);
    if(finalOwner != null) {     
      Property property = model.createProperty(reputationParser
           .getRiNamespace(), "owner");
      Statement statement = repObjResource.getProperty(property);
      if(statement == null) {
        repObjResource.addProperty(property, finalOwner.getResource());
      } else {
        statement.changeObject(finalOwner.getResource());
      }
    }
    Property property = model.createProperty(reputationParser
         .getRiNamespace(), "fromCommunity");
    Statement statement = repObjResource.getProperty(property);
    if(reputationObject.getFromCommunity() != null) {     
      if(reputationObject.getFromCommunity().getResource() != null) {
        if(statement == null) {
View Full Code Here


      repValResource.addProperty(RDF.type, JenaVocabulary.reputationValue);
    }
    Entity finalOwner = getFinalOwner(null, reputationValue, repObj,
          owner, true);
    if(finalOwner != null) {     
      Property property = model.createProperty(reputationParser
           .getRiNamespace(), "owner");
      Statement statement = repValResource.getProperty(property);
      if(statement == null) {
        repValResource.addProperty(property, finalOwner.getResource());
      } else {
        statement.changeObject(finalOwner.getResource());
      }
    }
    Property property = model.createProperty(reputationParser
         .getRiNamespace(), "obtainedBy");
    Statement statement = repValResource.getProperty(property);
    if(reputationValue.getObtainedBy() != null) {     
      if(reputationValue.getObtainedBy().getResource() != null) {
        if(statement == null) {
View Full Code Here

      repEvaResource.addProperty(RDF.type, JenaVocabulary.reputationEvaluation);
    }
    Entity finalOwner = getFinalOwner(reputationEvaluation, repValue, null,
        owner, true);
    if(finalOwner != null) {     
      Property property = model.createProperty(reputationParser
           .getRiNamespace(), "owner");
      Statement statement = repEvaResource.getProperty(property);
      if(statement == null) {
        repEvaResource.addProperty(property, finalOwner.getResource());
      } else {
        statement.changeObject(finalOwner.getResource());
      }
    } 
   
    Property property = model.createProperty(reputationParser
         .getRiNamespace(), "hasMetric");
    Statement statement = repEvaResource.getProperty(property);
    if(reputationEvaluation.getHasMetric() != null &&
        reputationEvaluation.getHasMetric().getResource() != null) {
      if(statement == null) {
View Full Code Here

 
  static public Resource updateOnlineAccount(Model model, EntityIdentifier entityIdentifier,
      ReputationParser reputationParser, String base, Entity owner) {   
    if(entityIdentifier.getResource() != null) {
      Resource accResource = entityIdentifier.getResource();
      Property property = model.createProperty(reputationParser
           .getFoafNamespace(), "accountName");
      Statement statement = accResource.getProperty(property);     
      if(statement == null) {
        accResource.addLiteral(property,
            entityIdentifier.getName());
View Full Code Here

       entityRes = model.createResource(getResourceString(
           base+entity.getUniqueIdentificator(),base));
     }
     entityRes.addProperty(RDF.type, JenaVocabulary.entity);
     if(entity.getUniqueIdentificator() != null) {
       Property uniqIdProperty = model.createProperty(reputationParser
           .getRiNamespace(), "identifier");
       entityRes.addProperty(uniqIdProperty,
           entity.getUniqueIdentificator());
     } else {
      return;
     }
     if(entity.getIdentificatorInCommunities() != null) {
       for(EntityIdentifier entityIdentifier :
           entity.getIdentificatorInCommunities().values()) {
         Property property = model.createProperty(reputationParser
             .getFoafNamespace(), "onlineAccount");
         Resource resource = addOnlineAccountToModel(model,
             entityIdentifier, reputationParser, base, entity);
         if(resource == null) {
           continue;
         }
         entityRes.addProperty(property,resource);
       }
     }
     if(entity.getHasReputation() != null) {
       for(ReputationObject reputationObject :
           entity.getHasReputation()) {
         Property property = model.createProperty(reputationParser
             .getRiNamespace(), "hasReputation");
         Resource resource = addReputationObjectToModel(model,
             reputationObject, reputationParser, base, entity);
         if(resource == null) {
           continue;
         }
         entityRes.addProperty(property,resource);
       }
     }
     if(entity.getHasValue() != null) {
       for(ReputationValue reputationValue :
           entity.getHasValue()) {
         Property property = model.createProperty(reputationParser
             .getRiNamespace(), "hasValue");
         Resource resource = addReputationValueToModel(model,
             reputationValue, reputationParser, base, entity, null);
         if(resource == null) {
           continue;
         }
         entityRes.addProperty(property,resource);
       }
     }
     if(entity.getHasEvaluation() != null) {
       for(ReputationEvaluation reputationEvaluation :
           entity.getHasEvaluation()) {
         Property property = model.createProperty(reputationParser
             .getRiNamespace(), "hasEvaluation");
         Resource resource = addReputationEvaluationToModel(model,
             reputationEvaluation, reputationParser, base, entity, null);
         if(resource == null) {
           continue;
View Full Code Here

      repObjectRes = model.createResource(getResourceString(
        base+finalOwner.getUniqueIdentificator()+"-"+
        reputationObject.getFromCommunity().getName(),base));
    }
    repObjectRes.addProperty(RDF.type, JenaVocabulary.reputationObject);
    Property property = model.createProperty(reputationParser
         .getRiNamespace(), "owner");
    repObjectRes.addProperty(property, finalOwner.getResource());
    property = model.createProperty(reputationParser
         .getRiNamespace(), "fromCommunity");
    repObjectRes.addProperty(property, reputationObject.getFromCommunity().getResource());
    if(reputationObject.getHasValue() != null) {
      for(ReputationValue reputationValue :
        reputationObject.getHasValue()) {
         Property properti = model.createProperty(reputationParser
             .getRiNamespace(), "hasValue");
         Resource resource = addReputationValueToModel(model,
             reputationValue, reputationParser, base, finalOwner, reputationObject);
         if(resource == null) {
           continue;
View Full Code Here

          base+finalOwner.getUniqueIdentificator()
          +"-"+reputationValue.getObtainedBy().getName(),base));
      }
    }
    repValueRes.addProperty(RDF.type, JenaVocabulary.reputationValue);
    Property property = model.createProperty(reputationParser
         .getRiNamespace(), "owner");
    repValueRes.addProperty(property, finalOwner.getResource());
    property = model.createProperty(reputationParser
         .getRiNamespace(), "obtainedBy");
    repValueRes.addProperty(property,reputationValue.getObtainedBy().getResource());
    if(reputationValue.getTimeStamp() != null) {
      property = model.createProperty(reputationParser
           .getRiNamespace(), "timeStamp");
      //repObjectRes.addProperty(property,reputationValue.getTimeStamp());
      Calendar cal = GregorianCalendar.getInstance();
      cal.setTime(reputationValue.getTimeStamp());
      Literal date = model.createTypedLiteral(cal);
      repValueRes.addLiteral(property,date);
    }
    if(reputationValue.getExpirationTime() != null) {
      property = model.createProperty(reputationParser
           .getRiNamespace(), "expirationTime");
      //repObjectRes.addProperty(property,reputationValue.getExpirationTime());
      Calendar cal = GregorianCalendar.getInstance();
      cal.setTime(reputationValue.getExpirationTime());
      Literal date = model.createTypedLiteral(cal);
      repValueRes.addLiteral(property,date);
    }
    if(reputationValue.getCollectionIdentifier() != null) {
      property = model.createProperty(reputationParser
           .getRiNamespace(), "collectionIdentifier");
      repValueRes.addProperty(property,reputationValue.getCollectionIdentifier());
    }
    if(reputationValue.getCollectionIdentifier() != null) {
      repValueRes.addProperty(property,reputationValue.getCollectionIdentifier());
    }
    if(reputationValue.getHasEvaluations() != null) {
      for(ReputationEvaluation reputationEvaluation :
        reputationValue.getHasEvaluations()) {
        Property properti = model.createProperty(reputationParser
             .getRiNamespace(), "hasEvaluation");
        Resource resource = addReputationEvaluationToModel(model,
           reputationEvaluation, reputationParser, base, finalOwner, reputationValue);
        if(resource == null) {
          continue;
View Full Code Here

          base+finalOwner.getUniqueIdentificator()+"-"+
          reputationEvaluation.getValue(),base));
      }
    }
    repEvaluationRes.addProperty(RDF.type, JenaVocabulary.reputationEvaluation);
    Property property = model.createProperty(reputationParser
         .getRiNamespace(), "target");
    repEvaluationRes.addProperty(property, finalOwner.getResource());
    property = model.createProperty(reputationParser
         .getRiNamespace(), "hasMetric");
    if(reputationEvaluation.getHasMetric() != null &&
View Full Code Here

          base+entityIdentifier.getName(),base));
      }
    }
    onlineAccount.addProperty(RDF.type, JenaVocabulary.onlineAccount);
    if(entityIdentifier.getName() != null) {
      Property property = model.createProperty(reputationParser
           .getFoafNamespace(), "accountName");
      onlineAccount.addProperty(property,
          entityIdentifier.getName());
    }
    if(entityIdentifier.getUrl() != null) {
      Property property = model.createProperty(reputationParser
           .getFoafNamespace(), "accountProfilePage");
      onlineAccount.addProperty(property,
          entityIdentifier.getUrl());
    }
    if(entityIdentifier.getBelongsTo() != null &&
        entityIdentifier.getBelongsTo().getResource() != null) {
      Property property = model.createProperty(reputationParser
          .getRiNamespace(), "belongsTo");
      onlineAccount.addProperty(property,
          entityIdentifier.getBelongsTo().getResource());     
    }
    return onlineAccount;
View Full Code Here

        }
    } else {
      System.out.println("No simple String foafNamespace+Person were found in the database");
    }
   
    Property propertyOnlineAccount = ResourceFactory.createProperty(
        foafNamespace, "OnlineAccount");   
    iters = model.listSubjectsWithProperty(propertyOnlineAccount);
    if (iters.hasNext()) {
        System.out.println("The database contains OnlineAccount for:");
        while (iters.hasNext()) {
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.Property

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.