*/
private QueryParameter processParameter(QueryParameter qp, boolean expand,boolean precise) {
List<QueryParameterEntry> newqpes = new ArrayList<QueryParameterEntry>();
boolean found=false;
QueryParameter newqp = new QueryParameterImpl();
newqp.setType(QueryParameterType.TAXONOMY);
List <QueryParameterEntry> valuesToRemove = new ArrayList<QueryParameterEntry>();
if(expand){
if(!m2resource.status.contains("<br />Expanding classes using Control Vocabulary..."))
m2resource.status.add("<br />Expanding classes using Control Vocabulary...");
if(qp.getType().isTaxonomyType()){
for(QueryParameterEntry qpe : qp.getValues())
{
newqpes.addAll(processEntry(qpe,precise));
valuesToRemove.add(qpe);
}
}
}else{
if(!m2resource.status.contains("<br />Matching classes using Control Vocabulary..."))
m2resource.status.add("<br />Matching classes using Control Vocabulary...");
for(QueryParameterEntry qpe : qp.getValues())
{
List<QueryParameterEntry> tempQpe = matchTaxonomy(qpe);
//Iterator<QueryParameterEntry> it = tempQpe.iterator();
//Iterator<QueryParameterEntry> it2 = newqpes.iterator();
for(QueryParameterEntry qpe2 : tempQpe)
{
//QueryParameterEntry tempel= (QueryParameterEntry)it.next();
if(newqpes.size()!=0)
{
found=false;
for(QueryParameterEntry qpe3 : newqpes)
{
// QueryParameterEntry tempel2= (QueryParameterEntry)it2.next();
if(qpe2.getTaxonomy().getLabel()==qpe3.getTaxonomy().getLabel())
found=true;
}
if(found!=true)
{
newqpes.add(qpe2);
}
}
else
{
newqpes.add(qpe2);
}
//if(!newqpes.contains(tempel))
}
}
for(QueryParameterEntry qpr : valuesToRemove)
{
qp.removeValue(qpr);
newqpes.remove(qpr);
}
}
newqp.clearValues();
newqp.addValues(newqpes);
if (newqp.getValues().size() > 0){
//notify history, RELATION_POINTER_TYPE = null, as this is not wordnet expansion
ExpandedHistoryInfo ehi = new ExpandedHistoryInfo(qp.getValues(),newqpes,newqp.getType());
resultObject.addHistoryInfo(ehi);
return newqp;
}
else
return null;