public void onSourceUpdated(Publication publication, Source oldSource) { if (oldSource == null){ publicationChangeLogger.log(Level.INFO, "The source has been initialised for the publication " + publication.toString()); } else if (publication.getSource() == null){ publicationChangeLogger.log(Level.INFO, "The source has been reset for the publication " + publication.toString()); } else { publicationChangeLogger.log(Level.INFO, "The source " + oldSource + " has been updated with " + publication.getSource() + " in the publication " + publication.toString()); } }
public void writeSource(BinaryInteractionEvidence interaction) throws IOException { Experiment experiment = interaction.getExperiment(); if (experiment != null){ Publication pub = experiment.getPublication(); if (pub != null){ writeCvTerm(pub.getSource()); } else { getWriter().write(MitabUtils.EMPTY_COLUMN); } } else{ getWriter().write(MitabUtils.EMPTY_COLUMN); } }
/** * * @param pub * @return the hashcode consistent with the equals method for this comparator */ public static int hashCode(Publication pub){ if (unambiguousCuratedPublicationComparator == null){ unambiguousCuratedPublicationComparator = new UnambiguousCuratedPublicationComparator(); } if (pub == null){ return 0; } int hashcode = UnambiguousPublicationComparator.hashCode(pub); hashcode = 31*hashcode + pub.getCurationDepth().hashCode(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(pub.getSource()); hashcode = 31*hashcode + (pub.getReleasedDate() != null ? pub.getReleasedDate().hashCode() : 0); return hashcode; } }
@Override protected boolean isEntitledToAssignImexId(Publication publicationToEnrich, ImexPublication imexPublication) throws EnricherException { Source source = publicationToEnrich.getSource(); Source source2 = imexPublication.getSource(); if (source2 == null){ source2 = new DefaultSource(imexPublication.getOwner()); } if (source != null && !DefaultCvTermComparator.areEquals(source, imexPublication.getSource())){ if (imexPublication.getOwner().equalsIgnoreCase(ImexCentralManager.INTACT_CURATOR)){ return true; } return false; } return source != null && DefaultCvTermComparator.areEquals(source, imexPublication.getSource()); } }
/*** * This method will copy properties of publication source in publication target and will override all the other properties of Target publication. * This method will ignore experiments * @param source * @param target */ public static void copyAndOverridePublicationProperties(Publication source, Publication target){ if (source != null && target != null){ target.setCurationDepth(source.getCurationDepth()); target.setJournal(source.getJournal()); target.setReleasedDate(source.getReleasedDate()); target.setTitle(source.getTitle()); target.setPublicationDate(source.getPublicationDate()); target.setSource(source.getSource()); // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getIdentifiers().clear(); target.getIdentifiers().addAll(source.getIdentifiers()); target.getAuthors().clear(); target.getAuthors().addAll(source.getAuthors()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); } }
public void write(Publication object) throws IOException { if (!object.getIdentifiers().isEmpty()){ MIJsonUtils.writePropertyKey("pubid", writer); MIJsonUtils.writeOpenArray(writer); Iterator<Xref> identifierIterator = object.getIdentifiers().iterator(); while (identifierIterator.hasNext()){ getIdentifierWriter().write(identifierIterator.next()); if (identifierIterator.hasNext()){ MIJsonUtils.writeSeparator(writer); } } if (object.getImexId() != null){ MIJsonUtils.writeSeparator(writer); MIJsonUtils.writeProperty("imex", JSONValue.escape(object.getImexId()), writer); } MIJsonUtils.writeEndArray(writer); } else if (object.getImexId() != null){ MIJsonUtils.writePropertyKey("pubid", writer); MIJsonUtils.writeOpenArray(writer); MIJsonUtils.writeProperty("imex", JSONValue.escape(object.getImexId()), writer); MIJsonUtils.writeEndArray(writer); } // publication source if (object.getSource() != null){ MIJsonUtils.writeSeparator(writer); MIJsonUtils.writePropertyKey("sourceDatabase", writer); getCvWriter().write(object.getSource()); } }
Source institution = publication.getSource(); if (source == null){ return;