@Test public final void testNormalize2() { Model model = BioPAXLevel.L3.getDefaultFactory().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); Normalizer normalizer = new Normalizer(); normalizer.normalize(model); ProteinReference e = (ProteinReference) model.getByID("http: assertNotNull(e); assertEquals(4, e.getXref().size()); }
public String normalize(String biopaxOwlData) { if(biopaxOwlData == null || biopaxOwlData.length() == 0) throw new IllegalArgumentException("no data. " + description); biopaxOwlData = biopaxOwlData.replaceAll("taxonXref","xref"); Model model = null; try { model = biopaxReader.convertFromOWL( new ByteArrayInputStream(biopaxOwlData.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException("Failed! " + description, e); } if(model == null) { throw new IllegalArgumentException("Failed to create Model! " + description); } if (model.getLevel() != BioPAXLevel.L3) { log.info("Converting model to BioPAX Level3..."); model = (new LevelUpgrader()).filter(model); } normalize(model); return convertToOWL(model); }
Normalizer { public String normalize(String biopaxOwlData) { if(biopaxOwlData == null || biopaxOwlData.length() == 0) throw new IllegalArgumentException("no data. " + description); biopaxOwlData = biopaxOwlData.replaceAll("taxonXref","xref"); Model model = null; try { model = biopaxReader.convertFromOWL( new ByteArrayInputStream(biopaxOwlData.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException("Failed! " + description, e); } if(model == null) { throw new IllegalArgumentException("Failed to create Model! " + description); } if (model.getLevel() != BioPAXLevel.L3) { log.info("Converting model to BioPAX Level3..."); model = (new LevelUpgrader()).filter(model); } normalize(model); return convertToOWL(model); } }
Normalizer { public String normalize(String biopaxOwlData) { if(biopaxOwlData == null || biopaxOwlData.length() == 0) throw new IllegalArgumentException("no data. " + description); biopaxOwlData = biopaxOwlData.replaceAll("taxonXref","xref"); Model model = null; try { model = biopaxReader.convertFromOWL( new ByteArrayInputStream(biopaxOwlData.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException("Failed! " + description, e); } if(model == null) { throw new IllegalArgumentException("Failed to create Model! " + description); } if (model.getLevel() != BioPAXLevel.L3) { log.info("Converting model to BioPAX Level3..."); model = (new LevelUpgrader()).filter(model); } normalize(model); return convertToOWL(model); } Normalizer(); }
Normalizer { public String normalize(String biopaxOwlData) { if(biopaxOwlData == null || biopaxOwlData.length() == 0) throw new IllegalArgumentException("no data. " + description); biopaxOwlData = biopaxOwlData.replaceAll("taxonXref","xref"); Model model = null; try { model = biopaxReader.convertFromOWL( new ByteArrayInputStream(biopaxOwlData.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException("Failed! " + description, e); } if(model == null) { throw new IllegalArgumentException("Failed to create Model! " + description); } if (model.getLevel() != BioPAXLevel.L3) { log.info("Converting model to BioPAX Level3..."); model = (new LevelUpgrader()).filter(model); } normalize(model); return convertToOWL(model); } Normalizer(); String normalize(String biopaxOwlData); static String uri(final String xmlBase, 
		String dbName, String idPart, Class<? extends BioPAXElement> type); String getDescription(); void setDescription(String description); void normalize(Model model); static void autoName(Provenance pro); static String convertToLevel3(final String biopaxData); boolean isFixDisplayName(); void setFixDisplayName(boolean fixDisplayName); String getXmlBase(); void setXmlBase(String xmlBase); }
Normalizer { public String normalize(String biopaxOwlData) { if(biopaxOwlData == null || biopaxOwlData.length() == 0) throw new IllegalArgumentException("no data. " + description); biopaxOwlData = biopaxOwlData.replaceAll("taxonXref","xref"); Model model = null; try { model = biopaxReader.convertFromOWL( new ByteArrayInputStream(biopaxOwlData.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException("Failed! " + description, e); } if(model == null) { throw new IllegalArgumentException("Failed to create Model! " + description); } if (model.getLevel() != BioPAXLevel.L3) { log.info("Converting model to BioPAX Level3..."); model = (new LevelUpgrader()).filter(model); } normalize(model); return convertToOWL(model); } Normalizer(); String normalize(String biopaxOwlData); static String uri(final String xmlBase, 
		String dbName, String idPart, Class<? extends BioPAXElement> type); String getDescription(); void setDescription(String description); void normalize(Model model); static void autoName(Provenance pro); static String convertToLevel3(final String biopaxData); boolean isFixDisplayName(); void setFixDisplayName(boolean fixDisplayName); String getXmlBase(); void setXmlBase(String xmlBase); static final String PROPERTY_NORMALIZER_URI_STRATEGY; static final String VALUE_NORMALIZER_URI_STRATEGY_SIMPLE; static final String VALUE_NORMALIZER_URI_STRATEGY_MD5; }