ontoSpreadState.setCurrentScore(currentScore);//FIXME
final int depth = uriDepth.getDepth();
final double []parameters = new double[]{depth};
double degradation = 1.0;
Concept concept = getOntologyDAO().getConcept(currentUri, null);
ConceptOperations conceptOperations = new ConceptOperations(concept);
//We take all the concepts (and the relation wich join with the // ''concept'' variable)
//Iterate over them, and score its spread value
//System.out.println("Spreading "+uriDepth);
logger.debug("SPREADING "+uriDepth.getUri()+" DEPTH "+uriDepth.getDepth()+" SCORE "+currentScore);
timer.start();
for (ConceptRelationPair conceptRelation : conceptOperations.getRelatedConcepts()) {
final String qualRelationUri = conceptRelation.getOnproperty();
final String relatedUri =conceptRelation.getConceptUri();
logger.debug("Activation for "+relatedUri+" from "+uriDepth.getUri()+" on "+qualRelationUri);
if (conceptOperations.isSon(conceptRelation.getConceptUri()))
degradation = getDegradationFunction().applyDegradation(parameters, ontoSpreadState);
/**
* Concept activation
*/
if(managerBeforeConceptActivationStrategy!= null) {
managerBeforeConceptActivationStrategy.applyStrategy(ontoSpreadState);
}
//FIXME:USE as key relatedUri and qualRelationUri
registerSpreadPath(ontoSpreadState, relatedUri, uriDepth.getUri(), qualRelationUri,currentSpreadPath);
/*
* The puntuation of the concept of this iteration, is
* related with the score of the one it's been spreaded, the
* weight of the relation (a "gobernadoPor" should has "more
* weight" than a "itDoesn'tMatter" one) and the degradation
* score (if this concept is a really abstract one, the
* degradation should be really big
*/
final double newScore = currentScore * getWeight(qualRelationUri) * degradation;
addScore(ontoSpreadState, newScore, relatedUri);
int newDepth = 0;
//The new node increments its depth if it's a parent
if(conceptOperations.isSon(conceptRelation.getConceptUri())){
newDepth = depth;
}else{
newDepth = depth + 1;
}
//If the uri in spreading is the related Uri no