if (supportingTermLabelReverseCache.containsKey(belTerm)) {
return supportingTermLabelReverseCache.get(belTerm);
}
// parse the BelTerm
Term t;
try {
t = BELParser.parseTerm(belTerm);
} catch (Exception e) {
// invalid BEL
return null;
}
// convert to short form
String shortForm = t.toBELShortForm();
// 1: short circuit; try by kam node label
PreparedStatement ps = getPreparedStatement(SELECT_KAM_NODE_BY_LABEL_SQL);
ResultSet rset = null;
try {
ps.setString(1, shortForm);
rset = ps.executeQuery();
if (rset.next()) {
int kamNodeId = rset.getInt(1);
supportingTermLabelReverseCache.put(belTerm, kamNodeId);
return kamNodeId;
}
} finally {
close(rset);
}
// 2: try by bel terms
Collection<Integer> possibleTermIds = null;
int ordinal = 0;
for (Parameter param : t.getAllParametersLeftToRight()) {
Integer namespaceId = null;
if (param.getNamespace() != null
&& StringUtils.isNotBlank(param.getNamespace().getPrefix())) {
Namespace ns =
getNamespaceByPrefix(param.getNamespace().getPrefix());