Commit 2c9b9a53 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

parse new miriam format for all urls

parent b1473e5f
...@@ -3,6 +3,9 @@ minerva (15.1.0~beta.1) unstable; urgency=medium ...@@ -3,6 +3,9 @@ minerva (15.1.0~beta.1) unstable; urgency=medium
(#1354) (#1354)
* Bug fix: SBML text labels that were referencing layout aliases using * Bug fix: SBML text labels that were referencing layout aliases using
layout:graphicalObject attribute were not handled properly (#1356) layout:graphicalObject attribute were not handled properly (#1356)
* Bug fix: miriam urls in new format
(like: https://identifiers.org/kegg.compound:197020) are parsed properly for
all know identifier types (#1359)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 17 Aug 2020 16:00:00 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Mon, 17 Aug 2020 16:00:00 +0200
......
...@@ -109,6 +109,24 @@ public class MiriamTypeGenericTest extends ModelTestFunctions { ...@@ -109,6 +109,24 @@ public class MiriamTypeGenericTest extends ModelTestFunctions {
} }
} }
@Test
public void testNewHttpAndHttpsForIdentifiersOrg() {
if (!deprecated) {
boolean httpIdentifiersOrgUriExists = false;
boolean httpsIdentifiersOrgUriExists = false;
for (String uri : miriamType.getUris()) {
if (uri.toLowerCase().startsWith("http://identifiers.org/") && !uri.endsWith("/")) {
httpIdentifiersOrgUriExists = true;
}
if (uri.toLowerCase().startsWith("https://identifiers.org/") && !uri.endsWith("/")) {
httpsIdentifiersOrgUriExists = true;
}
}
assertTrue("Http identifiers.org url does not exists for: " + miriamType, httpIdentifiersOrgUriExists);
assertTrue("Https identifiers.org url does not exists for: " + miriamType, httpsIdentifiersOrgUriExists);
}
}
@Test @Test
public void testGetMiriamByIncompleteUri() throws Exception { public void testGetMiriamByIncompleteUri() throws Exception {
for (String uri : miriamType.getUris()) { for (String uri : miriamType.getUris()) {
......
...@@ -123,4 +123,34 @@ public class MiriamTypeTest extends ModelTestFunctions { ...@@ -123,4 +123,34 @@ public class MiriamTypeTest extends ModelTestFunctions {
assertTrue(md.getResource().contains("/")); assertTrue(md.getResource().contains("/"));
} }
@Test
public void testGetMiriamByKeggCompoundIdentifiersOrgUri() throws Exception {
MiriamData md = MiriamType.getMiriamByUri("https://identifiers.org/kegg.compound:197020");
assertEquals(new MiriamData(MiriamType.KEGG_COMPOUND, "197020"), md);
}
@Test
public void testGetMiriamByEcoIdentifiersOrgUri() throws Exception {
MiriamData md = MiriamType.getMiriamByUri("https://identifiers.org/ECO:0000006");
assertEquals(new MiriamData(MiriamType.ECO, "ECO:0000006"), md);
}
@Test
public void testGetMiriamByMgiIdentifiersOrgUri() throws Exception {
MiriamData md = MiriamType.getMiriamByUri("https://identifiers.org/MGI:2442292");
assertEquals(new MiriamData(MiriamType.MGD, "MGI:2442292"), md);
}
@Test
public void testGetMiriamByPatoIdentifiersOrgUri() throws Exception {
MiriamData md = MiriamType.getMiriamByUri("https://identifiers.org/PATO:0001998");
assertEquals(new MiriamData(MiriamType.PATO, "PATO:0001998"), md);
}
@Test
public void testGetMiriamBySboIdentifiersOrgUri() throws Exception {
MiriamData md = MiriamType.getMiriamByUri("https://identifiers.org/SBO:0000262");
assertEquals(new MiriamData(MiriamType.SBO_TERM, "SBO:0000262"), md);
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment