}
}
public FixedCommunitiesTrust getFixedCommunitiesTrust(
Model model, Resource resource) throws Exception {
FixedCommunitiesTrust fixCom = (FixedCommunitiesTrust)
getResourceFromCache(resource, FixedCommunitiesTrust.class);
if(fixCom != null) {
return fixCom;
}
fixCom = (FixedCommunitiesTrust) getTrustBetweenCommunities(
model, resource, FixedCommunitiesTrust.class);
Property communityScorer = ResourceFactory.
createProperty(riNamespace + "communityScorer");
// communityScorer //
StmtIterator stmtI1 = model.listStatements(resource,
communityScorer, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
// validate originatingCategory property //
if(!statement.getObject().isResource()) {
if(!ModelException.throwException(ModelException.FIXEDCOMMUNITYTRUST,
"communityScorer property of FixedCommunityTrust resource:"+
resource.getURI()+" is not a resource")) {
return null;
}
} else {
Community community = (Community) getResourceFromCache(
statement.getObject().asResource(), Community.class);
if(community == null) {
//Community community = getCommunity(
// model, statement.getObject().asResource());
community = getLimitedCommunity(
model, statement.getObject().asResource());
}
fixCom.setCommunityScorer(community);
}
}
Property communityScored = ResourceFactory.
createProperty(riNamespace + "communityScored");
// communityScored //
stmtI1 = model.listStatements(resource,
communityScored, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
/* validate communityScored property */
if(!statement.getObject().isResource()) {
if(!ModelException.throwException(ModelException.FIXEDCOMMUNITYTRUST,
"communityScored property of FixedCommunityTrust resource:"+
resource.getURI()+" is not a resource")) {
return null;
}
} else {
Community community = (Community) getResourceFromCache(
statement.getObject().asResource(), Community.class);
if(community == null) {
//Community community = getCommunity(
// model, statement.getObject().asResource());
community = getLimitedCommunity(
model, statement.getObject().asResource());
}
fixCom.setCommunityScored(community);
}
}
return fixCom;
}