Examples of ConcreteRelation


Examples of org.wymiwyg.knobot.relations.ConcreteRelation

   * @param out
   */
  private void process(ResIterator iter, PrintWriter out) {
    while (iter.hasNext()) {
      Resource currentRelationRes = iter.nextResource();
      ConcreteRelation relation = new ConcreteRelation(currentRelationRes);
      float strength = relation.getCurrentStrength();
      if (strength > 0.000001) {
        float newStrength = 1f - ((1f - strength)*0.5f);
       
        currentRelationRes.removeAll(KNOBOT.effectiveDate);
        currentRelationRes.removeAll(KNOBOT.strength);
 
View Full Code Here

Examples of org.wymiwyg.knobot.relations.ConcreteRelation

      float strength = relation.getProperty(KNOBOT.strength).getFloat();
      float childStrength = relation.getProperty(KNOBOT.strength).getFloat();
      try {
        float comparativeStrength = relation.getProperty(KNOBOT.comparativeStrength).getFloat();
        if (Math.max(strength, childStrength) > comparativeStrength) {
          out.println(new ConcreteRelation(relation)+ "had to low compariteStrength, removing");
          relation.removeAll(KNOBOT.comparativeStrength);
        }
      } catch (Exception ex) {
        //ex.printStackTrace(out);
      }
View Full Code Here

Examples of org.wymiwyg.knobot.relations.ConcreteRelation

   * @param current
   * @param supposedBestRelation
   * @return
   */
  private boolean isMoreRelevant(Resource thisOne, Resource other) {
    if (new ConcreteRelation(thisOne)
        .compareTo(new ConcreteRelation(other)) == 1) {
      return true;
    } else {
      return false;
    }
  }
View Full Code Here

Examples of org.wymiwyg.knobot.relations.ConcreteRelation

   */
  private void process(ResIterator iter) {
    while (iter.hasNext()) {
      Resource currentRelationRes = iter.nextResource();
      try {
        Relation relation = new ConcreteRelation(currentRelationRes);
        Resource target = relation.getTarget();
        if (target.hasProperty(RDF.type, RSS.item) || target.isAnon()) {
            currentRelationRes.addProperty(RDF.type, KNOBOT.InlineRelation);
        }
      } catch (Exception ex) {
        log.info("Exception on "+currentRelationRes+" "+ex+"!");
View Full Code Here

Examples of org.wymiwyg.knobot.relations.ConcreteRelation

  private void process(ResIterator iter, boolean delete, PrintWriter out) {
    Collection removing = new ArrayList();
    while (iter.hasNext()) {
      Resource currentRelationRes = iter.nextResource();
      try {
        Relation relation = new ConcreteRelation(currentRelationRes);
        relation.getChildStrength();
        relation.getChildStrengthReduction();
        relation.getCurrentChildStrength();
        relation.getComparativeStrength();
        Resource target = relation.getTarget();
        if (target.isAnon()) {
          //TODO this is wrong (agents are anon!), look more detail at osar problem
          if (!target.hasProperty(RDF.type, FOAF.Agent)) {
            throw new RuntimeException("target is anon and not an Agent");
          }
        }
        relation.getTargetLabel();
        relation.getEffectiveDate();
      } catch (Exception ex) {
        log.info("Exception on "+currentRelationRes+" "+ex+", will remove");
        removing.add(currentRelationRes);
      }
    }
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.