subject);
int effectiveTill = till;
for (int i = (from - 1); i <= effectiveTill; i++) {
try {
// Relation relation = itemsList.getRelation(i);
Relation relation = itemIterator.nextRelation();
if ((!unOrdered) && (relation.getStrength() < minimalRelevance)) {
break;
}
Resource targetResource = relation.getTarget();
if (!isPermitted(targetResource)) {
effectiveTill++;
continue;
}
if (hideRead
&& targetResource.hasProperty(KNOBOT.isReadBy, subject)) {
effectiveTill++;
continue;
}
if (relation.isPath()) {
effectiveTill++;
}
if (log.isDebugEnabled()) {
log.debug("returning " + i + "nd relation with strenght"
+ relation.getCurrentStrength() + "(" + relation
+ ")");
}
boolean isItem = targetResource.hasProperty(RDF.type, RSS.item);
if (isItem && !hasAcceptedLanguage(targetResource, ehRequest)) {
effectiveTill++;
continue;
}
Model itemModel = getEventInRangeAndArea(targetResource,
startDate, endDate, area, relevantMonths, relevantAreas);
if (itemModel == null) {
continue;
}
/*
* relation = itemsList.getRelation(i); log.info( "returning " +
* i + "nd relation with strenght"
*/
// resultModel.write(System.out);
Model relationModel = JenaUtil.getExpandedResource(relation
.getResource(), 3, true);
Statement feedStmt = relation.getTarget().getProperty(
AGGREGATOR.feed);
if (feedStmt != null) {
relationModel.add(feedStmt);
}
// relationModel.write(System.out);
/*
* Resource relationInResourceModel = (Resource) relation
*/
Resource relationInResourceModel = JenaUtil
.getRoots(relationModel)[0];
relationInResourceModel.removeAll(KNOBOT.nextRelation);
// we may still have nextRelation stmts in relationModel
resultModel.add(JenaUtil.getExpandedResource(
relationInResourceModel, 3, true));
resultModel.add(itemModel);
Resource item = (Resource) targetResource.inModel(resultModel);
addMissingSummaries(item);
addCommentCount(item);
/*
* Util.getExpandedResource(relation.getTarget(),
*/
ResIterator aggregatorIter = model.listSubjectsWithProperty(
AGGREGATOR.aggregated, relation.getTarget());
if (aggregatorIter.hasNext()) {
resultModel.add(JenaUtil.getExpandedResource(aggregatorIter
.nextResource(), 2, true));
}