public T fetchByIdentifier(String termIdentifier, String ontologyDatabaseName) throws BridgeFailedException { if (ontologyDatabaseName != null && !this.ontologyDatabase.getShortName().equalsIgnoreCase(ontologyDatabaseName)){ return null; } return id2Term.get(termIdentifier); }
public T fetchByName(String searchName, String ontologyDatabaseName) throws BridgeFailedException { if (ontologyDatabaseName != null && !this.ontologyDatabase.getShortName().equalsIgnoreCase(ontologyDatabaseName)){ return null; } return name2Term.get(searchName); }
public void onShortNameUpdate(CvTerm cv, String oldShortName) { cvChangeLogger.log(Level.INFO, "The short name "+oldShortName+" has been updated with " + cv.getShortName() + " in the cv term " + cv.toString()); }
public Collection<T> fetchByIdentifiers(Collection<String> termIdentifiers, String ontologyDatabaseName) throws BridgeFailedException { if (ontologyDatabaseName != null && !this.ontologyDatabase.getShortName().equalsIgnoreCase(ontologyDatabaseName)){ return Collections.EMPTY_LIST; } Collection<T> terms = new ArrayList<T>(termIdentifiers.size()); for (String id : termIdentifiers){ if (id2Term.containsKey(id)){ terms.add(id2Term.get(id)); } } return terms; }
public Collection<T> fetchByNames(Collection<String> searchNames, String ontologyDatabaseName) throws BridgeFailedException { if (ontologyDatabaseName != null && !this.ontologyDatabase.getShortName().equalsIgnoreCase(ontologyDatabaseName)){ return Collections.EMPTY_LIST; } Collection<T> terms = new ArrayList<T>(searchNames.size()); for (String name : searchNames){ if (name2Term.containsKey(name)){ terms.add(name2Term.get(name)); } } return terms; }
protected void configure(String filePath) { /** * ensure we get the right logger */ logger = Logger.getLogger(AbstractOboLoader.class); try { parser = new OBO2FormatParser(filePath); } catch (Exception e) { logger.fatal("Parse failed: " + e.getMessage(), e); } ONTOLOGY_DEFINITION = ontologyDatabase.getShortName(); FULL_NAME = ontologyDatabase.getFullName(); SHORT_NAME = ontologyDatabase.getShortName(); }
protected void processShortLabel(Term term, T ontologyTerm) { if (ontologyTerm.getShortName().length() == 0){ ontologyTerm.setShortName(term.getName()); } }
public static Term buildTerm( CvTerm cv ) { if (cv == null){ return null; } final String id = cv.getMIIdentifier(); if( id == null ) { return null; } return new Term( id, cv.getShortName() ); }
public void writeXref(Xref xref) throws IOException { if (xref != null){ // write identifier first writeIdentifier(xref); // write qualifier if (xref.getQualifier() != null){ getWriter().write("("); escapeAndWriteString(xref.getQualifier().getShortName()); getWriter().write(")"); } } }
public void writeChecksum(Checksum checksum) throws IOException { if (checksum != null){ // first method escapeAndWriteString(checksum.getMethod().getShortName()); getWriter().write(MitabUtils.XREF_SEPARATOR); // then value escapeAndWriteString(checksum.getValue()); } }
public void writeParameter(Parameter parameter) throws IOException { if (parameter != null){ // first parameter type escapeAndWriteString(parameter.getType().getShortName()); getWriter().write(MitabUtils.XREF_SEPARATOR); // then parameter value escapeAndWriteString(ParameterUtils.getParameterValueAsString(parameter)); // then write unit if (parameter.getUnit() != null){ getWriter().write("("); escapeAndWriteString(parameter.getUnit().getShortName()); getWriter().write(")"); } } }
public void writeIdentifier(Xref identifier) throws IOException { if (identifier != null){ // write db first escapeAndWriteString(identifier.getDatabase().getShortName()); // write xref separator writer.write(MitabUtils.XREF_SEPARATOR); // write id escapeAndWriteString(identifier.getId()); // write version if (identifier.getVersion() != null){ writer.write(identifier.getVersion()); } } }
protected void writeExpansionMethod(CvTerm expansion) throws IOException { MIJsonUtils.writeStartObject(writer); MIJsonUtils.writeProperty("name", JSONValue.escape(expansion.getShortName()), writer); writeOtherExpansionMethodProperties(); MIJsonUtils.writeEndObject(writer); }
protected void createAliasFromAltId(Interactor interactor, MitabXref ref) { // create alias from xref MitabAlias alias = new MitabAlias(ref.getDatabase().getShortName(), ref.getQualifier(), ref.getId(), ref.getSourceLocator()); interactor.getAliases().add(alias); if (listener != null){ listener.onSyntaxWarning(ref, "Found an Alias in the alternative identifiers column. Will load it as a checksum."); } }
public void writeAlias(ModelledParticipant participant, Alias alias) throws IOException { if (alias != null){ // write db first escapeAndWriteString(MitabUtils.findDbSourceForAlias(participant, alias)); // write xref separator getWriter().write(MitabUtils.XREF_SEPARATOR); // write name escapeAndWriteString(alias.getName()); // write type if (alias.getType() != null){ getWriter().write("("); escapeAndWriteString(alias.getType().getShortName()); getWriter().write(")"); } } }
public void writeConfidence(Confidence conf) throws IOException { if (conf != null){ // write confidence type first if (conf.getType().getFullName() != null){ escapeAndWriteString(conf.getType().getFullName()); } else{ escapeAndWriteString(conf.getType().getShortName()); } // write confidence value writer.write(MitabUtils.XREF_SEPARATOR); escapeAndWriteString(conf.getValue()); } }
public void write(Parameter object) throws IOException { MIJsonUtils.writeStartObject(writer); MIJsonUtils.writeProperty("type", JSONValue.escape(object.getType().getShortName()), writer); MIJsonUtils.writeSeparator(writer); MIJsonUtils.writeProperty("value", JSONValue.escape(ParameterUtils.getParameterValueAsString(object)), writer); if (object.getUnit() != null){ MIJsonUtils.writeSeparator(writer); MIJsonUtils.writeProperty("unit", JSONValue.escape(object.getUnit().getShortName()), writer); } MIJsonUtils.writeEndObject(writer); } }
public void write(Confidence object) throws IOException { MIJsonUtils.writeStartObject(writer); MIJsonUtils.writeProperty("type", JSONValue.escape(object.getType().getShortName()), writer); MIJsonUtils.writeSeparator(writer); MIJsonUtils.writeProperty("value", JSONValue.escape(object.getValue()), writer); MIJsonUtils.writeEndObject(writer); } }
public void write(Xref object) throws IOException { MIJsonUtils.writeStartObject(writer); MIJsonUtils.writeProperty("db", JSONValue.escape(object.getDatabase().getShortName()), writer); MIJsonUtils.writeSeparator(writer); MIJsonUtils.writeProperty("id", JSONValue.escape(object.getId()), writer); MIJsonUtils.writeEndObject(writer); } }
protected T createNewTerm(Term t) { T ontologyTerm = instantiateNewTerm(t.getName(), XrefUtils.createIdentityXref(getOntologyDatabase().getShortName(), getOntologyDatabase().getMIIdentifier(), t.getIdentifier())); // load synonyms (alias and shortlabel) processSynonyms(t, ontologyTerm); // set shortlabel in case it was not set with synonyms processShortLabel(t, ontologyTerm); // load db xrefs processXrefs(t, ontologyTerm); // load definition, url, obsolete message processDefinition(t, ontologyTerm); // load annotations processAnnotations(t, ontologyTerm); return ontologyTerm; }