Examples of StrengthSortedRelationIterator


Examples of org.wymiwyg.knobot.relations.StrengthSortedRelationIterator

    if (!onlyDirect) {
      itemIterator = new IndirectRelationIterator(
          (CSRelationIterator) itemIterator, minimalRelevance);
    }
    if (!unOrdered) {
      itemIterator = new StrengthSortedRelationIterator(
          (CSRelationIterator) itemIterator);
    }
    /*
     * RelationIterator itemIterator = new IndirectRelationIterator(new
     * DirectRelationIterator( resource), minimalRelevance);
View Full Code Here

Examples of org.wymiwyg.knobot.relations.StrengthSortedRelationIterator

     */
    static private Resource[] getContainers(Resource resource, Model resultModel,
            float minimalRelevance, int till) {
        List resultList = new ArrayList();
        //TopicsList topicsList = new TopicsList(resource, 0);
        RelationIterator iter = new StrengthSortedRelationIterator(
                new InverseIndirectRelationIterator(
                        new InverseDirectRelationIterator(resource),
                        minimalRelevance));
        try {
            for (int i = 0; i < till; i++) {
                Relation current = iter.nextRelation();
                if (current.getStrength() < minimalRelevance) {
                    break;
                }
                resultModel.add(JenaUtil.getExpandedResource(current
                        .getResource(), 3));
View Full Code Here

Examples of org.wymiwyg.knobot.relations.StrengthSortedRelationIterator

      itemIterator = new IndirectRelationIterator(
          (CSRelationIterator) itemIterator, requestParameters
              .getMinimalRelevance());
    }
    if (!requestParameters.getUnOrdered()) {
      itemIterator = new StrengthSortedRelationIterator(
          (CSRelationIterator) itemIterator);
    }
    return itemIterator;
  }
View Full Code Here

Examples of org.wymiwyg.knobot.relations.StrengthSortedRelationIterator

     * @param resource
     * @param resultModel
     */
    public static List addInverseRelations(Resource resource, Model resultModel,
        float minimalRelevance) {
      RelationIterator iter = new StrengthSortedRelationIterator(
          new InverseIndirectRelationIterator(
              new InverseDirectRelationIterator(resource),
              minimalRelevance));
      //TopicsList topicsList = new TopicsList(resource, 0);
      List result = new ArrayList();
      try {
        for (int i = 0; i < 5; i++) {
          Relation relation = iter.nextRelation();//topicsList.getRelation(i);
          resultModel.add(JenaUtil.getExpandedResource(relation
              .getResource(), 2));
          Resource source = relation.getSource();
          if (source.hasProperty(RSS.title)) {
              StmtIterator titles =  source.listProperties(RSS.title);
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.