private boolean notAllowed(Object o) { if (o instanceof BioPAXElement) { for (int i = 0; i < NOT_ADVISED.length; i++) { if (((BioPAXElement) o).getModelInterface().equals( NOT_ADVISED[i])) { return true; // found } } } return false; }
for (String property : properties) { try { Method method = bpe.getModelInterface().getMethod( "get" + property.substring(0, 1).toUpperCase() + property.substring(1).replace('-', '_')); + bpe.getRDFId() + ": " + e);
/** * Finds a name for the variable. * @param ele element to check * @return a name */ public String getAName(BioPAXElement ele) { String name = null; if (ele instanceof Named) { Named n = (Named) ele; if (n.getDisplayName() != null && n.getDisplayName().length() > 0) name = n.getDisplayName(); else if (n.getStandardName() != null && n.getStandardName().length() > 0) name = n.getStandardName(); else if (!n.getName().isEmpty() && n.getName().iterator().next().length() > 0) name = n.getName().iterator().next(); } if (name == null ) name = ele.getUri(); return name + " (" + ele.getModelInterface().getName().substring( ele.getModelInterface().getName().lastIndexOf(".") + 1) + ")"; } }
@Override protected void visit(Object value, BioPAXElement parent, Model model, PropertyEditor editor) { if(value instanceof BioSource) { if(!((BioPAXElement) value).isEquivalent(organism)) { organisms.add((BioPAXElement) value); } } else if (value instanceof BioPAXElement) { if (log.isTraceEnabled()) log.trace("Traverse into " + value + " " + value.getClass().getSimpleName()); traverse((BioPAXElement) value, model); } } };
/** * Gets the local part of the BioPAX element ID. * * @param bpe * @return */ public static String getLocalId(BioPAXElement bpe) { String id = bpe.getRDFId(); return (id != null) ? id.replaceFirst("^.+#", "") : null; }
private boolean notAllowed(Object o) { if (o instanceof BioPAXElement) { for (int i = 0; i < NOT_ADVISED.length; i++) { if (((BioPAXElement) o).getModelInterface().equals( NOT_ADVISED[i])) { return true; // found } } } return false; }
for (String property : properties) { try { Method method = bpe.getModelInterface().getMethod( "get" + property.substring(0, 1).toUpperCase() + property.substring(1).replace('-', '_')); + bpe.getRDFId() + ": " + e);
@Override public Set<String> fetchID(BioPAXElement ele) { return Collections.singleton(ele.getUri()); }
private boolean notAllowed(BioPAXElement bp) { for (int i = 0; i < NOT_ALLOWED.length; i++) { if (bp.getModelInterface().equals(NOT_ALLOWED[i])) { return true; // found } } return false; }
Method method = bpe.getModelInterface().getMethod( "get" + property.substring(0, 1).toUpperCase() + property.substring(1).replace('-', '_')); if(log.isDebugEnabled()) { log.debug("Cannot get value of '" + property + "' for " + bpe.getRDFId() + ": " + e);
/** * Checks if the blacklist contains id of any mediator * @param ids blacklist * @param mediators mediators of inferred interactions * @return true if any mediator is blacklisted */ private boolean intersects(Set<String> ids, Set<BioPAXElement> mediators) { for (BioPAXElement mediator : mediators) { if (ids.contains(mediator.getRDFId())) return true; } return false; }
/** * Collects IDs of mediators. * @return mediator IDs */ public List<String> getMediatorIDs() { List<String> ids = new ArrayList<String>(mediators.size()); for (BioPAXElement ele : mediators) { ids.add(ele.getUri()); } return ids; }
private boolean notAllowed(BioPAXElement bp) { for (int i = 0; i < NOT_ALLOWED.length; i++) { if (bp.getModelInterface().equals(NOT_ALLOWED[i])) { return true; // found } } return false; }
Method method = bpe.getModelInterface().getMethod( "get" + property.substring(0, 1).toUpperCase() + property.substring(1).replace('-', '_')); if(log.isDebugEnabled()) { log.debug("Cannot get value of '" + property + "' for " + bpe.getRDFId() + ": " + e);
public void check(BioPAXElement thing, boolean fix) { String rdfid = thing.getRDFId(); if(rdfid != null && rdfid.length() > URI_MAX_LENGTH) error(thing, "too.long.id", false, rdfid.length(), URI_MAX_LENGTH); }
public void check(final Validation validation, BioPAXElement thing) { String rdfid = thing.getUri(); if(rdfid != null && rdfid.length() > URI_MAX_LENGTH) error(validation, thing, "too.long.id", false, rdfid.length(), URI_MAX_LENGTH); }
/** * Checks if the element is assignable to a variable of the desired type. * @param match current pattern match * @param ind mapped indices * @return true if the element is assignable to a variable of the desired type */ @Override public boolean satisfies(Match match, int... ind) { assert ind.length == 1; return clazz.isAssignableFrom(match.get(ind[0]).getModelInterface()); } }