@Test public final void testGetURI() { assertEquals("urn:miriam:psimi:MI%3A0000", MiriamLink.getURI(MISYN, "MI:0000")); try{ MiriamLink.getURI(MISYN, "MI_0000"); fail("must throw IllegalArgumentException (wrong ID format)"); } catch (IllegalArgumentException e) { } }
public static String getURI(String name, String id) { Datatype datatype = getDatatype(name); String db = datatype.getName(); if(checkRegExp(id, db)) { try { return getOfficialDataTypeURI(datatype) + ":" + URLEncoder.encode(id, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 encoding error of id=" + id, e); } } else throw new IllegalArgumentException( "ID pattern mismatch. db=" + db + ", id=" + id + ", regexp: " + datatype.getPattern()); }
MiriamLink { public static String getURI(String name, String id) { Datatype datatype = getDatatype(name); String db = datatype.getName(); if(checkRegExp(id, db)) { try { return getOfficialDataTypeURI(datatype) + ":" + URLEncoder.encode(id, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 encoding error of id=" + id, e); } } else throw new IllegalArgumentException( "ID pattern mismatch. db=" + db + ", id=" + id + ", regexp: " + datatype.getPattern()); } }
MiriamLink { public static String getURI(String name, String id) { Datatype datatype = getDatatype(name); String db = datatype.getName(); if(checkRegExp(id, db)) { try { return getOfficialDataTypeURI(datatype) + ":" + URLEncoder.encode(id, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 encoding error of id=" + id, e); } } else throw new IllegalArgumentException( "ID pattern mismatch. db=" + db + ", id=" + id + ", regexp: " + datatype.getPattern()); } protected  MiriamLink(); }
MiriamLink { public static String getURI(String name, String id) { Datatype datatype = getDatatype(name); String db = datatype.getName(); if(checkRegExp(id, db)) { try { return getOfficialDataTypeURI(datatype) + ":" + URLEncoder.encode(id, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 encoding error of id=" + id, e); } } else throw new IllegalArgumentException( "ID pattern mismatch. db=" + db + ", id=" + id + ", regexp: " + datatype.getPattern()); } protected  MiriamLink(); static String getServicesVersion(); static String getDataTypeURI(String datatypeKey); static String[] getDataTypeURIs(String datatypeKey); static String getResourceLocation(String resourceId); static String getResourceInstitution(String resourceId); static String getURI(String name, String id); static String getDataTypeDef(String datatypeKey); static String[] getLocations(String datatypeKey, String entityId); static String[] getDataResources(String datatypeKey); static boolean isDeprecated(String uri); static String getDataTypePattern(String datatypeKey); static String getName(String datatypeKey); static String[] getNames(String datatypeKey); static String[] getDataTypesName(); static String[] getDataTypesId(); static String getOfficialDataTypeURI(String uri); static boolean checkRegExp(String identifier, String datatype); static String getOfficialDataTypeURI(Datatype datatype); static Datatype getDatatype(String datatypeKey); static String[] getResourcesId(); static Resource getResource(String resourceId); static boolean containsIdOrName(String searchKey); static boolean containsUri(String searchUri); static String convertUrn(String urn); static String getIdentifiersOrgURI(String name, String id); }
MiriamLink { public static String getURI(String name, String id) { Datatype datatype = getDatatype(name); String db = datatype.getName(); if(checkRegExp(id, db)) { try { return getOfficialDataTypeURI(datatype) + ":" + URLEncoder.encode(id, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 encoding error of id=" + id, e); } } else throw new IllegalArgumentException( "ID pattern mismatch. db=" + db + ", id=" + id + ", regexp: " + datatype.getPattern()); } protected  MiriamLink(); static String getServicesVersion(); static String getDataTypeURI(String datatypeKey); static String[] getDataTypeURIs(String datatypeKey); static String getResourceLocation(String resourceId); static String getResourceInstitution(String resourceId); static String getURI(String name, String id); static String getDataTypeDef(String datatypeKey); static String[] getLocations(String datatypeKey, String entityId); static String[] getDataResources(String datatypeKey); static boolean isDeprecated(String uri); static String getDataTypePattern(String datatypeKey); static String getName(String datatypeKey); static String[] getNames(String datatypeKey); static String[] getDataTypesName(); static String[] getDataTypesId(); static String getOfficialDataTypeURI(String uri); static boolean checkRegExp(String identifier, String datatype); static String getOfficialDataTypeURI(Datatype datatype); static Datatype getDatatype(String datatypeKey); static String[] getResourcesId(); static Resource getResource(String resourceId); static boolean containsIdOrName(String searchKey); static boolean containsUri(String searchUri); static String convertUrn(String urn); static String getIdentifiersOrgURI(String name, String id); static final String BINDING; static boolean useObsoleteDatatypes; static boolean useObsoleteResources; }