@Test public final void testMergeModel() { BioPAXFactory factory = BioPAXLevel.L3.getDefaultFactory(); Model model = factory.createModel(); Xref ref = model.addNew(UnificationXref.class, "Xref1"); ref.setDb("uniprotkb"); ref.setId("Q0VCL1"); Xref uniprotX = ref; ProteinReference pr = model.addNew(ProteinReference.class, "ProteinReference"); pr.setDisplayName("ProteinReference"); pr.addXref(uniprotX); ref = model.addNew(RelationshipXref.class, "Xref2"); ref.setDb("refseq"); ref.setId("NP_001734"); pr.addXref(ref); ref = model.addNew(PublicationXref.class, "Xref3"); ref.setDb("pubmed"); ref.setId("2549346"); pr.addXref(ref); ref = model.addNew(RelationshipXref.class,"Xref4"); ref.setDb("pubmed"); ref.setId("2549346"); pr.addXref(ref); BioSource bs = factory.create(BioSource.class, "Mouse"); ref = factory.create(UnificationXref.class, "Xref5"); ref.setDb("taxonomy"); ref.setId("10090"); bs.addXref(ref); pr.setOrganism(bs); assertEquals(5, model.getObjects().size()); SimpleMerger merger = new SimpleMerger(SimpleEditorMap.L3); merger.merge(model, model); bs = (BioSource) model.getByID("Mouse"); assertEquals(1, bs.getXref().size()); pr = (ProteinReference) model.getByID("ProteinReference"); assertEquals(4, pr.getXref().size()); assertEquals(7, model.getObjects().size()); }
public void merge(Model target, Model... sources) { for (Model source : sources) if (source != null) merge(target, source.getObjects()); }
SimpleMerger { public void merge(Model target, Model... sources) { for (Model source : sources) if (source != null) merge(target, source.getObjects()); } }
SimpleMerger { public void merge(Model target, Model... sources) { for (Model source : sources) if (source != null) merge(target, source.getObjects()); } SimpleMerger(EditorMap map);  SimpleMerger(EditorMap map, Filter<BioPAXElement> mergePropOf); }
SimpleMerger { public void merge(Model target, Model... sources) { for (Model source : sources) if (source != null) merge(target, source.getObjects()); } SimpleMerger(EditorMap map);  SimpleMerger(EditorMap map, Filter<BioPAXElement> mergePropOf); void merge(Model target, Model... sources); void merge(Model target, Collection<? extends BioPAXElement> elements); void merge(Model target, BioPAXElement source); }
SimpleMerger { public void merge(Model target, Model... sources) { for (Model source : sources) if (source != null) merge(target, source.getObjects()); } SimpleMerger(EditorMap map);  SimpleMerger(EditorMap map, Filter<BioPAXElement> mergePropOf); void merge(Model target, Model... sources); void merge(Model target, Collection<? extends BioPAXElement> elements); void merge(Model target, BioPAXElement source);  }