if((o2 == null) || (!o1.equalsIgnoreCase(o2)))
return false;
}
// Match ontologies set
Iterator itTemplate = template.getAllOntologies();
while(itTemplate.hasNext()) {
String templateOnto = (String)itTemplate.next();
boolean found = false;
Iterator itFact = fact.getAllOntologies();
while(!found && itFact.hasNext()) {
String factOnto = (String)itFact.next();
found = templateOnto.equalsIgnoreCase(factOnto);
}
if(!found)
return false;
}
// Match languages set
itTemplate = template.getAllLanguages();
while(itTemplate.hasNext()) {
String templateLang = (String)itTemplate.next();
boolean found = false;
Iterator itFact = fact.getAllLanguages();
while(!found && itFact.hasNext()) {
String factLang = (String)itFact.next();
found = templateLang.equalsIgnoreCase(factLang);
}
if(!found)
return false;
}
// Match protocols set
itTemplate = template.getAllProtocols();
while(itTemplate.hasNext()) {
String templateProto = (String)itTemplate.next();
boolean found = false;
Iterator itFact = fact.getAllProtocols();
while(!found && itFact.hasNext()) {
String factProto = (String)itFact.next();
found = templateProto.equalsIgnoreCase(factProto);
}
if(!found)
return false;
}
// Match properties set
itTemplate = template.getAllProperties();
while(itTemplate.hasNext()) {
Property templateProp = (Property)itTemplate.next();
boolean found = false;
Iterator itFact = fact.getAllProperties();
while(!found && itFact.hasNext()) {
Property factProp = (Property)itFact.next();
found = templateProp.match(factProp);
/*if (templateProp.getName().equals(factProp.getName())) {
// The property name matches. Check the value
Object templateValue = templateProp.getValue();
if (templateValue == null) {