@Override public Set<String> fetchID(BioPAXElement ele) { return Collections.singleton(ele.getUri()); }
/** * 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; }
/** * Checks if the element has one of the desired IDs. * @param match current pattern match * @param ind mapped indices * @return true if the ID is in the list */ @Override public boolean satisfies(Match match, int... ind) { return ids.contains(match.get(ind[0]).getUri()); } }
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); }
public void check(final Validation validation, BioPAXElement thing) { String rdfid = thing.getUri(); if(rdfid != null) { try { URI.create(rdfid); } catch (IllegalArgumentException e) { error(validation, thing, "invalid.rdf.id", false, "not a valid URI: " + rdfid); } } else error(validation, thing, "invalid.rdf.id", false, "null value"); }
@Override protected void visit(Object range, BioPAXElement domain, Model model, PropertyEditor editor) { if (thing.equals(range)) { error(validation, thing, "cyclic.inclusion", false, "is a component of itself or its componets... : " + domain.getUri()); } else if(range instanceof Complex) { traverse((Complex) range, model); } } };
public String identify(Object obj) { String id = ""; if(obj instanceof SimpleIOHandler) { SimpleIOHandler r = (SimpleIOHandler) obj; id = r.getClass().getSimpleName(); try { id = r.getId(); //current element URI } catch (Throwable e) { id = r.getXmlStreamInfo(); //location } } else if (obj instanceof BioPAXElement && ((BioPAXElement)obj).getUri() != null) { id = ((BioPAXElement) obj).getUri().replaceFirst("^.+#", ""); // - strictly spk., does not always get the local part (depends on xml:base) but is OK. } else if(obj instanceof Model) { id = obj + "; xml:base=" + ((Model) obj).getXmlBase(); } else { id = "" + obj; } return id; } }
writer.write("\n" + ele.getUri());
/** * 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) + ")"; } }
for (BioPAXElement med : meds) mediators.get(s1s).get(s2s).add(med.getUri());