@Test public final void testAutoName() { Model model = BioPAXLevel.L3.getDefaultFactory().createModel(); Provenance pro = model.addNew(Provenance.class, "http: pro.setStandardName("foo"); Normalizer.autoName(pro); assertNotNull(pro.getStandardName()); assertTrue(pro.getName().contains("PID")); assertTrue(pro.getName().contains("NCI_Nature curated")); assertFalse(pro.getStandardName().equals("foo")); }
public static void autoName(Provenance pro) { if(!(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: && pro.getName().isEmpty()) { log.info("Skipping: cannot normalize Provenance: " + pro.getUri()); } else { final SortedSet<String> names = new TreeSet<String>(); String key = null; if(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: key = pro.getUri(); } else if (pro.getStandardName() != null) { key = pro.getStandardName(); } else { key = pro.getDisplayName(); } if (key != null) { try { names.addAll(Arrays.asList(MiriamLink.getNames(key))); pro.setStandardName(MiriamLink.getName(key)); String description = MiriamLink.getDataTypeDef(pro.getStandardName()); pro.addComment(description); } catch (IllegalArgumentException e) { } } if(names.isEmpty()) { for (String name : pro.getName()) { try { names.addAll(Arrays.asList(MiriamLink.getNames(name))); } catch (IllegalArgumentException e) { } } if(!names.isEmpty()) pro.setStandardName(MiriamLink .getName(names.iterator().next())); } for(String name : names) pro.addName(name); if(pro.getDisplayName() == null) pro.setDisplayName(pro.getStandardName()); } }
Normalizer { public static void autoName(Provenance pro) { if(!(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: && pro.getName().isEmpty()) { log.info("Skipping: cannot normalize Provenance: " + pro.getUri()); } else { final SortedSet<String> names = new TreeSet<String>(); String key = null; if(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: key = pro.getUri(); } else if (pro.getStandardName() != null) { key = pro.getStandardName(); } else { key = pro.getDisplayName(); } if (key != null) { try { names.addAll(Arrays.asList(MiriamLink.getNames(key))); pro.setStandardName(MiriamLink.getName(key)); String description = MiriamLink.getDataTypeDef(pro.getStandardName()); pro.addComment(description); } catch (IllegalArgumentException e) { } } if(names.isEmpty()) { for (String name : pro.getName()) { try { names.addAll(Arrays.asList(MiriamLink.getNames(name))); } catch (IllegalArgumentException e) { } } if(!names.isEmpty()) pro.setStandardName(MiriamLink .getName(names.iterator().next())); } for(String name : names) pro.addName(name); if(pro.getDisplayName() == null) pro.setDisplayName(pro.getStandardName()); } } }
Normalizer { public static void autoName(Provenance pro) { if(!(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: && pro.getName().isEmpty()) { log.info("Skipping: cannot normalize Provenance: " + pro.getUri()); } else { final SortedSet<String> names = new TreeSet<String>(); String key = null; if(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: key = pro.getUri(); } else if (pro.getStandardName() != null) { key = pro.getStandardName(); } else { key = pro.getDisplayName(); } if (key != null) { try { names.addAll(Arrays.asList(MiriamLink.getNames(key))); pro.setStandardName(MiriamLink.getName(key)); String description = MiriamLink.getDataTypeDef(pro.getStandardName()); pro.addComment(description); } catch (IllegalArgumentException e) { } } if(names.isEmpty()) { for (String name : pro.getName()) { try { names.addAll(Arrays.asList(MiriamLink.getNames(name))); } catch (IllegalArgumentException e) { } } if(!names.isEmpty()) pro.setStandardName(MiriamLink .getName(names.iterator().next())); } for(String name : names) pro.addName(name); if(pro.getDisplayName() == null) pro.setDisplayName(pro.getStandardName()); } } Normalizer(); }
Normalizer { public static void autoName(Provenance pro) { if(!(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: && pro.getName().isEmpty()) { log.info("Skipping: cannot normalize Provenance: " + pro.getUri()); } else { final SortedSet<String> names = new TreeSet<String>(); String key = null; if(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: key = pro.getUri(); } else if (pro.getStandardName() != null) { key = pro.getStandardName(); } else { key = pro.getDisplayName(); } if (key != null) { try { names.addAll(Arrays.asList(MiriamLink.getNames(key))); pro.setStandardName(MiriamLink.getName(key)); String description = MiriamLink.getDataTypeDef(pro.getStandardName()); pro.addComment(description); } catch (IllegalArgumentException e) { } } if(names.isEmpty()) { for (String name : pro.getName()) { try { names.addAll(Arrays.asList(MiriamLink.getNames(name))); } catch (IllegalArgumentException e) { } } if(!names.isEmpty()) pro.setStandardName(MiriamLink .getName(names.iterator().next())); } for(String name : names) pro.addName(name); if(pro.getDisplayName() == null) pro.setDisplayName(pro.getStandardName()); } } 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 static void autoName(Provenance pro) { if(!(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: && pro.getName().isEmpty()) { log.info("Skipping: cannot normalize Provenance: " + pro.getUri()); } else { final SortedSet<String> names = new TreeSet<String>(); String key = null; if(pro.getUri().startsWith("urn:miriam:") || pro.getUri().startsWith("http: key = pro.getUri(); } else if (pro.getStandardName() != null) { key = pro.getStandardName(); } else { key = pro.getDisplayName(); } if (key != null) { try { names.addAll(Arrays.asList(MiriamLink.getNames(key))); pro.setStandardName(MiriamLink.getName(key)); String description = MiriamLink.getDataTypeDef(pro.getStandardName()); pro.addComment(description); } catch (IllegalArgumentException e) { } } if(names.isEmpty()) { for (String name : pro.getName()) { try { names.addAll(Arrays.asList(MiriamLink.getNames(name))); } catch (IllegalArgumentException e) { } } if(!names.isEmpty()) pro.setStandardName(MiriamLink .getName(names.iterator().next())); } for(String name : names) pro.addName(name); if(pro.getDisplayName() == null) pro.setDisplayName(pro.getStandardName()); } } 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; }