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

Examples of com.hp.hpl.jena.rdf.model.Model.createTypedLiteral()


    Model resultModel = ModelFactory.createDefaultModel();
    for (Iterator iter = countTable.entrySet().iterator(); iter.hasNext();) {
      Entry currentEntry = (Entry) iter.next();
      Resource type = (Resource) currentEntry.getKey();
      Integer count = (Integer) currentEntry.getValue();
      Literal countLit = resultModel.createTypedLiteral(count);
      resultModel.add(type, instanceCount, countLit);
    }
    response.setBody(resultModel);

  }
View Full Code Here


        // anyway
        agent = model.createResource();
      }
    }

    Literal currentDate =resultModel.createTypedLiteral(new W3CDateFormat()
                .format(new Date()), XSDDatatype.XSDdateTime);
    transaction.addProperty(DC.date, currentDate);

    Resource user = VirtuserHandler.getSubject();
    if (user != null) {
View Full Code Here

    Resource source = null;
    model.enterCriticalSection(ModelLock.WRITE);
    try {
      comment = relation.getProperty(KNOBOT.target).getResource();
      if (!comment.hasProperty(DC.date)) {
        Literal currentDate = importing.createTypedLiteral(
            new W3CDateFormat().format(new Date()),
            XSDDatatype.XSDdateTime);
        comment.addProperty(DC.date, currentDate);
      }
      Statement makerStmt = comment.getProperty(FOAF.maker);
View Full Code Here

  public Resource getResource() {
    Model model = ModelFactory.createDefaultModel();
    Resource result = model.createResource(KNOBOT.Relation);
    result.addProperty(KNOBOT.source, getSource());
    result.addProperty(KNOBOT.target, getTarget());
    result.addProperty(KNOBOT.strength, model.createTypedLiteral(getCurrentStrength()));
    Literal effectiveDateLiteral = model.createTypedLiteral(new W3CDateFormat()
                .format(new Date()), XSDDatatype.XSDdateTime);
    result.addProperty(KNOBOT.effectiveDate, effectiveDateLiteral);
    //result.addProperty(KNOBOT.effectiveDate, System.currentTimeMillis()); //!!getEffectiveDate());
    result.addProperty(KNOBOT.strengthReduction, model.createTypedLiteral(getStrengthReduction()));
View Full Code Here

    Model model = ModelFactory.createDefaultModel();
    Resource result = model.createResource(KNOBOT.Relation);
    result.addProperty(KNOBOT.source, getSource());
    result.addProperty(KNOBOT.target, getTarget());
    result.addProperty(KNOBOT.strength, model.createTypedLiteral(getCurrentStrength()));
    Literal effectiveDateLiteral = model.createTypedLiteral(new W3CDateFormat()
                .format(new Date()), XSDDatatype.XSDdateTime);
    result.addProperty(KNOBOT.effectiveDate, effectiveDateLiteral);
    //result.addProperty(KNOBOT.effectiveDate, System.currentTimeMillis()); //!!getEffectiveDate());
    result.addProperty(KNOBOT.strengthReduction, model.createTypedLiteral(getStrengthReduction()));
    //if (getComparativeStrength() > getStrength()) {
View Full Code Here

    result.addProperty(KNOBOT.strength, model.createTypedLiteral(getCurrentStrength()));
    Literal effectiveDateLiteral = model.createTypedLiteral(new W3CDateFormat()
                .format(new Date()), XSDDatatype.XSDdateTime);
    result.addProperty(KNOBOT.effectiveDate, effectiveDateLiteral);
    //result.addProperty(KNOBOT.effectiveDate, System.currentTimeMillis()); //!!getEffectiveDate());
    result.addProperty(KNOBOT.strengthReduction, model.createTypedLiteral(getStrengthReduction()));
    //if (getComparativeStrength() > getStrength()) {
      result.addProperty(KNOBOT.comparativeStrength, model.createTypedLiteral(getCurrentComparativeStrength()));
    //}
    result.addProperty(KNOBOT.minimumChildStrengthReduction,
        model.createTypedLiteral(getChildStrengthReduction()));
View Full Code Here

                .format(new Date()), XSDDatatype.XSDdateTime);
    result.addProperty(KNOBOT.effectiveDate, effectiveDateLiteral);
    //result.addProperty(KNOBOT.effectiveDate, System.currentTimeMillis()); //!!getEffectiveDate());
    result.addProperty(KNOBOT.strengthReduction, model.createTypedLiteral(getStrengthReduction()));
    //if (getComparativeStrength() > getStrength()) {
      result.addProperty(KNOBOT.comparativeStrength, model.createTypedLiteral(getCurrentComparativeStrength()));
    //}
    result.addProperty(KNOBOT.minimumChildStrengthReduction,
        model.createTypedLiteral(getChildStrengthReduction()));
    result.addProperty(KNOBOT.childStrength, model.createTypedLiteral(getCurrentChildStrength()));
    Literal[] targetLabels = getTargetLabel();
View Full Code Here

    result.addProperty(KNOBOT.strengthReduction, model.createTypedLiteral(getStrengthReduction()));
    //if (getComparativeStrength() > getStrength()) {
      result.addProperty(KNOBOT.comparativeStrength, model.createTypedLiteral(getCurrentComparativeStrength()));
    //}
    result.addProperty(KNOBOT.minimumChildStrengthReduction,
        model.createTypedLiteral(getChildStrengthReduction()));
    result.addProperty(KNOBOT.childStrength, model.createTypedLiteral(getCurrentChildStrength()));
    Literal[] targetLabels = getTargetLabel();
    if (targetLabels != null) {
      for (int i = 0; i < targetLabels.length; i++) {
        result.addProperty(KNOBOT.targetLabel, targetLabels[i]);
View Full Code Here

    //if (getComparativeStrength() > getStrength()) {
      result.addProperty(KNOBOT.comparativeStrength, model.createTypedLiteral(getCurrentComparativeStrength()));
    //}
    result.addProperty(KNOBOT.minimumChildStrengthReduction,
        model.createTypedLiteral(getChildStrengthReduction()));
    result.addProperty(KNOBOT.childStrength, model.createTypedLiteral(getCurrentChildStrength()));
    Literal[] targetLabels = getTargetLabel();
    if (targetLabels != null) {
      for (int i = 0; i < targetLabels.length; i++) {
        result.addProperty(KNOBOT.targetLabel, targetLabels[i]);
       
View Full Code Here

        Resource recommendation = model
            .createResource(KNOBOT.Recommendation);
        recommendation.addProperty(KNOBOT.recommender,
            getRecommendations()[i].getRecommender());
        recommendation.addProperty(KNOBOT.strengthAtSource,
            model.createTypedLiteral(getRecommendations()[i].getStrengthAtSource()));
        recommendation.addProperty(KNOBOT.strengthOfRecommender,
            model.createTypedLiteral(getRecommendations()[i].getStrengthOfRecommender()));
        result.addProperty(KNOBOT.recommendedBy, recommendation);
      }
    }
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.