diff --git a/src/main/java/cpath/cleaner/KeggHsaCleaner.java b/src/main/java/cpath/cleaner/KeggHsaCleaner.java index de24d251..707b2f7a 100644 --- a/src/main/java/cpath/cleaner/KeggHsaCleaner.java +++ b/src/main/java/cpath/cleaner/KeggHsaCleaner.java @@ -46,7 +46,7 @@ public void clean(InputStream data, OutputStream cleanedData) if(!uxrefs.isEmpty()) { UnificationXref x = uxrefs.iterator().next(); if(x.getId() != null && x.getId().startsWith("hsa")) { - String uri = "bioregistry.io/kegg.pathway:" + x.getId(); + String uri = "http://bioregistry.io/kegg.pathway:" + x.getId(); if(!model.containsID(uri) && !newUriToEntityMap.containsKey(uri)) { newUriToEntityMap.put(uri, pw); //collect to replace URIs later (below) } else { //shared unification xref bug diff --git a/src/main/java/cpath/cleaner/PathbankCleaner.java b/src/main/java/cpath/cleaner/PathbankCleaner.java index 6ddbc779..abc9a5c8 100644 --- a/src/main/java/cpath/cleaner/PathbankCleaner.java +++ b/src/main/java/cpath/cleaner/PathbankCleaner.java @@ -38,7 +38,7 @@ public void clean(InputStream data, OutputStream cleanedData) { //since Apr-2018, top pathway URIs are "normalized" like: http://identifiers.org/smpdb/... //let's fix pathway uris base - use bioregistry.io/pathbank: instead - CPathUtils.rebaseUris(model, "http://identifiers.org/smpdb/", "bioregistry.io/pathbank:"); + CPathUtils.rebaseUris(model, "http://identifiers.org/smpdb/", "http://bioregistry.io/pathbank:"); //remove pathways that have "SubPathway" name; //though all these could be merged to become more informative pathways (once all the datafiles get merged), diff --git a/src/main/java/cpath/cleaner/ReactomeCleaner.java b/src/main/java/cpath/cleaner/ReactomeCleaner.java index 1650ce06..ebbf0d37 100644 --- a/src/main/java/cpath/cleaner/ReactomeCleaner.java +++ b/src/main/java/cpath/cleaner/ReactomeCleaner.java @@ -58,7 +58,7 @@ public void clean(InputStream data, OutputStream cleanedData) stableId = stableId.substring(9); // stableID is like 'R-HSA-123456' } - final String uri = "bioregistry.io/reactome:" + stableId; + final String uri = "http://bioregistry.io/reactome:" + stableId; if (!model.containsID(uri) && !newUriToEntityMap.containsKey(uri)) { //save it in the map to replace the URI later (see below) newUriToEntityMap.put(uri, proc); diff --git a/src/main/java/cpath/converter/ChebiOntologyAnalysis.java b/src/main/java/cpath/converter/ChebiOntologyAnalysis.java index 08955bb5..2a33b829 100644 --- a/src/main/java/cpath/converter/ChebiOntologyAnalysis.java +++ b/src/main/java/cpath/converter/ChebiOntologyAnalysis.java @@ -51,7 +51,7 @@ private void processOBOEntry(StringBuilder entryBuffer, Model model) throws IOEx return; } final String thisID = childChebiIDs.iterator().next(); - SmallMoleculeReference thisSMR = (SmallMoleculeReference) model.getByID("bioregistry.io/chebi:" + thisID.toLowerCase()); + SmallMoleculeReference thisSMR = (SmallMoleculeReference) model.getByID("http://bioregistry.io/chebi:" + thisID.toLowerCase()); if (thisSMR == null) { log.debug("processOBOEntry(), Skipped (not found): " + thisID); return; diff --git a/src/main/java/cpath/converter/UniprotConverter.java b/src/main/java/cpath/converter/UniprotConverter.java index 2082142c..4bd73d8c 100644 --- a/src/main/java/cpath/converter/UniprotConverter.java +++ b/src/main/java/cpath/converter/UniprotConverter.java @@ -409,7 +409,7 @@ private ProteinReference newProteinReferenceWithAccessionXrefs(String idLine, St final List acList = new ArrayList<>(Arrays.asList(accessions.split(";"))); // Pop the first item, the primary AC, to generate canonical URI and unif. xref: final String primaryId = acList.remove(0).trim(); - final String uri = "bioregistry.io/uniprot:" + primaryId; + final String uri = "http://bioregistry.io/uniprot:" + primaryId; // create a new PR with the name and primary unification xref ProteinReference proteinReference = model.addNew(ProteinReference.class, uri); @@ -450,7 +450,7 @@ private BioSource getBioSource(String taxId, String name, Model model) { if(taxonomy==null || taxonomy <= 0) { throw new RuntimeException("Illegal taxonomy ID: " + taxId); } else { - String uri = "bioregistry.io/ncbitaxon:" + taxonomy; + String uri = "http://bioregistry.io/ncbitaxon:" + taxonomy; if (model.containsID(uri)) { toReturn = (BioSource) model.getByID(uri); } else { diff --git a/src/main/java/cpath/service/Merger.java b/src/main/java/cpath/service/Merger.java index 4671f689..499d6943 100644 --- a/src/main/java/cpath/service/Merger.java +++ b/src/main/java/cpath/service/Merger.java @@ -599,7 +599,7 @@ private void mayAddHgncXrefs(final Model m, final XReferrable bpe, } final Set hgncSymbols = new HashSet<>(); for (String ac : accessions) { - ProteinReference canonicalPR = (ProteinReference) warehouseModel.getByID("bioregistry.io/uniprot:" + ac); + ProteinReference canonicalPR = (ProteinReference) warehouseModel.getByID("http://bioregistry.io/uniprot:" + ac); if (canonicalPR != null) { for (Xref x : canonicalPR.getXref()) if (x.getDb().equalsIgnoreCase("hgnc.symbol")) { diff --git a/src/main/java/cpath/service/api/RelTypeVocab.java b/src/main/java/cpath/service/api/RelTypeVocab.java index 44ffbea2..48c33d89 100644 --- a/src/main/java/cpath/service/api/RelTypeVocab.java +++ b/src/main/java/cpath/service/api/RelTypeVocab.java @@ -4,15 +4,15 @@ * Values to generate standard BioPAX RelationshipTypeVocabulary objects. */ public enum RelTypeVocab { - IDENTITY("identity", "bioregistry.io/mi:0356", "mi", "0356"), - SECONDARY_ACCESSION_NUMBER("secondary-ac", "bioregistry.io/mi:0360", "mi", "0360"), - ADDITIONAL_INFORMATION("see-also", "bioregistry.io/mi:0361", "mi", "0361"), + IDENTITY("identity", "http://bioregistry.io/mi:0356", "mi", "0356"), + SECONDARY_ACCESSION_NUMBER("secondary-ac", "http://bioregistry.io/mi:0360", "mi", "0360"), + ADDITIONAL_INFORMATION("see-also", "http://bioregistry.io/mi:0361", "mi", "0361"), //next should work for rel. xrefs pointing to a protein but attached to a Gene, Dna*, Rna* objects - GENE_PRODUCT("gene product", "bioregistry.io/mi:0251", "mi", "0251"), - SET_MEMBER("set member", "bioregistry.io/mi:1341", "mi", "1341"), + GENE_PRODUCT("gene product", "http://bioregistry.io/mi:0251", "mi", "0251"), + SET_MEMBER("set member", "http://bioregistry.io/mi:1341", "mi", "1341"), //next one is for chebi "is_a" relationships (when parent is a chemical class/concept rather than compound) - MULTIPLE_PARENT_REFERENCE("multiple parent reference", "bioregistry.io/mi:0829", "mi", "0829"), - ISOFORM_PARENT("isoform-parent", "bioregistry.io/mi:0243", "mi", "0243"),; + MULTIPLE_PARENT_REFERENCE("multiple parent reference", "http://bioregistry.io/mi:0829", "mi", "0829"), + ISOFORM_PARENT("isoform-parent", "http://bioregistry.io/mi:0243", "mi", "0243"),; public final String term; public final String uri; diff --git a/src/test/java/cpath/cleaner/KeggHsaCleanerTest.java b/src/test/java/cpath/cleaner/KeggHsaCleanerTest.java index 30b616c8..97deec90 100644 --- a/src/test/java/cpath/cleaner/KeggHsaCleanerTest.java +++ b/src/test/java/cpath/cleaner/KeggHsaCleanerTest.java @@ -23,7 +23,7 @@ public class KeggHsaCleanerTest { @Test public final void testClean() throws IOException { Cleaner cleaner = new KeggHsaCleaner(); - final String testPathwayUri = "bioregistry.io/kegg.pathway:hsa00010"; + final String testPathwayUri = "http://bioregistry.io/kegg.pathway:hsa00010"; String f10 = getClass().getClassLoader().getResource("").getPath() + File.separator + "testCleanKegghsa00010.owl"; @@ -45,7 +45,7 @@ public final void testClean() throws IOException { assertEquals("PGM", named.getStandardName()); //was "PGM1, GSD14..." assertFalse(named.getXref().isEmpty()); //Pathway - named = (Named)m10.getByID("bioregistry.io/kegg.pathway:hsa00010"); + named = (Named)m10.getByID("http://bioregistry.io/kegg.pathway:hsa00010"); assertEquals("Glycolysis / Gluconeogenesis", named.getDisplayName()); //was "Glycolysis / ..." //SM or SMR named = (Named)m10.getByID(m10.getXmlBase()+"cpdC00236"); @@ -63,7 +63,7 @@ public final void testClean() throws IOException { cleaner.clean(new FileInputStream(getClass().getResource("/hsa00562.owl").getFile()), new FileOutputStream(f562)); Model m562 = new SimpleIOHandler().convertFromOWL(new FileInputStream(f562)); - assertTrue(m562.containsID("bioregistry.io/kegg.pathway:hsa00562")); + assertTrue(m562.containsID("http://bioregistry.io/kegg.pathway:hsa00562")); assertTrue(m562.containsID(testPathwayUri)); @@ -73,7 +73,7 @@ public final void testClean() throws IOException { model.merge(m10); model.merge(m562); assertTrue(model.containsID(testPathwayUri)); - assertTrue(model.containsID("bioregistry.io/kegg.pathway:hsa00562")); + assertTrue(model.containsID("http://bioregistry.io/kegg.pathway:hsa00562")); //save result 1 new SimpleIOHandler().convertToOWL(model, new FileOutputStream( @@ -88,7 +88,7 @@ public final void testClean() throws IOException { model.merge(m562); model.merge(m10); assertTrue(model.containsID(testPathwayUri)); - assertTrue(model.containsID("bioregistry.io/kegg.pathway:hsa00562")); + assertTrue(model.containsID("http://bioregistry.io/kegg.pathway:hsa00562")); //save test result 2 new SimpleIOHandler().convertToOWL(model, new FileOutputStream( @@ -104,7 +104,7 @@ public final void testClean() throws IOException { merger.merge(model, m562); merger.merge(model, m10); assertTrue(model.containsID(testPathwayUri)); - assertTrue(model.containsID("bioregistry.io/kegg.pathway:hsa00562")); + assertTrue(model.containsID("http://bioregistry.io/kegg.pathway:hsa00562")); //save test result 3 new SimpleIOHandler().convertToOWL(model, new FileOutputStream( diff --git a/src/test/java/cpath/cleaner/PathbankCleanerTest.java b/src/test/java/cpath/cleaner/PathbankCleanerTest.java index acaee851..490ec7dd 100644 --- a/src/test/java/cpath/cleaner/PathbankCleanerTest.java +++ b/src/test/java/cpath/cleaner/PathbankCleanerTest.java @@ -22,12 +22,12 @@ public class PathbankCleanerTest { @Test public final void testClean() throws IOException { Cleaner cleaner = new PathbankCleaner(); - String uri1 = "bioregistry.io/pathbank:SMP0000040"; //was "http://identifiers.org/smpdb/SMP0000040"; + String uri1 = "http://bioregistry.io/pathbank:SMP0000040"; //was "http://identifiers.org/smpdb/SMP0000040"; String f1 = getClass().getClassLoader().getResource("").getPath() + File.separator + "PW000146.cleaned.owl"; cleaner.clean(new FileInputStream(getClass().getResource("/PW000146.owl").getFile()), new FileOutputStream(f1)); Model m1 = new SimpleIOHandler().convertFromOWL(new FileInputStream(f1)); Pathway p1 = (Pathway)m1.getByID(uri1); - String uri2 = "bioregistry.io/pathbank:SMP0000057"; //was "http://identifiers.org/smpdb/SMP0000057"; + String uri2 = "http://bioregistry.io/pathbank:SMP0000057"; //was "http://identifiers.org/smpdb/SMP0000057"; String f2 = getClass().getClassLoader().getResource("").getPath() + File.separator + "PW000005.cleaned.owl"; cleaner.clean(new FileInputStream(getClass().getResource("/PW000005.owl").getFile()), new FileOutputStream(f2)); Model m2 = new SimpleIOHandler().convertFromOWL(new FileInputStream(f2)); diff --git a/src/test/java/cpath/converter/ChebiConvertersTest.java b/src/test/java/cpath/converter/ChebiConvertersTest.java index 9175fdbd..8c9a7c70 100644 --- a/src/test/java/cpath/converter/ChebiConvertersTest.java +++ b/src/test/java/cpath/converter/ChebiConvertersTest.java @@ -53,10 +53,10 @@ public void convertObo() throws IOException { // get all small molecule references out assertEquals(7, model.getObjects(SmallMoleculeReference.class).size()); - assertNotNull(model.getByID("bioregistry.io/chebi:58342")); //the SMR without InChIKey + assertNotNull(model.getByID("http://bioregistry.io/chebi:58342")); //the SMR without InChIKey // get lactic acid sm - String rdfID = "bioregistry.io/chebi:422"; + String rdfID = "http://bioregistry.io/chebi:422"; assertTrue(model.containsID(rdfID)); SmallMoleculeReference smallMoleculeReference = (SmallMoleculeReference) model.getByID(rdfID); @@ -77,12 +77,12 @@ public void convertObo() throws IOException { assertEquals(0, publicationXrefCount); //there are no such xrefs anymore // following checks work in this test only (using in-memory model); with DAO - use getObject... - assertTrue(model.containsID("bioregistry.io/chebi:20")); - EntityReference er20 = (EntityReference) model.getByID("bioregistry.io/chebi:20"); - assertTrue(model.containsID("bioregistry.io/chebi:28")); -// EntityReference er28 = (EntityReference) model.getByID("bioregistry.io/chebi:28"); - assertTrue(model.containsID("bioregistry.io/chebi:422")); - EntityReference er422 = (EntityReference) model.getByID("bioregistry.io/chebi:422"); + assertTrue(model.containsID("http://bioregistry.io/chebi:20")); + EntityReference er20 = (EntityReference) model.getByID("http://bioregistry.io/chebi:20"); + assertTrue(model.containsID("http://bioregistry.io/chebi:28")); +// EntityReference er28 = (EntityReference) model.getByID("http://bioregistry.io/chebi:28"); + assertTrue(model.containsID("http://bioregistry.io/chebi:422")); + EntityReference er422 = (EntityReference) model.getByID("http://bioregistry.io/chebi:422"); assertTrue(er20.getMemberEntityReferenceOf().isEmpty()); assertTrue(er422.getMemberEntityReferenceOf().isEmpty()); diff --git a/src/test/java/cpath/converter/UniprotConverterTest.java b/src/test/java/cpath/converter/UniprotConverterTest.java index 239c422f..68642c8b 100644 --- a/src/test/java/cpath/converter/UniprotConverterTest.java +++ b/src/test/java/cpath/converter/UniprotConverterTest.java @@ -54,14 +54,14 @@ public void convert() throws IOException { assertEquals(10, proteinReferences.size()); assertTrue(proteinReferences.iterator().next().getXref().iterator().hasNext()); - ProteinReference pr = (ProteinReference) model.getByID("bioregistry.io/uniprot:P27797"); + ProteinReference pr = (ProteinReference) model.getByID("http://bioregistry.io/uniprot:P27797"); assertEquals(10, pr.getName().size()); //make sure this one is passed (important!) assertEquals("CALR_HUMAN", pr.getDisplayName()); assertEquals("Calreticulin", pr.getStandardName()); assertEquals(48, pr.getXref().size()); //no duplicates (UniProt, HGNC, PDB, IPI, EMBL, PIR, DIP, etc., xrefs) - assertEquals("bioregistry.io/ncbitaxon:9606", pr.getOrganism().getUri()); + assertEquals("http://bioregistry.io/ncbitaxon:9606", pr.getOrganism().getUri()); - pr = (ProteinReference) model.getByID("bioregistry.io/uniprot:P0DP23"); + pr = (ProteinReference) model.getByID("http://bioregistry.io/uniprot:P0DP23"); assertNotNull(pr); assertTrue(pr.getName().contains("CALM")); assertTrue(pr.getName().contains("CALM1")); @@ -70,32 +70,7 @@ public void convert() throws IOException { assertTrue(pr.getXref().toString().contains("1J7P")); // has that PDB xref too //we don't convert/add features anymore assertTrue(pr.getEntityFeature().isEmpty()); -// assertEquals(11, pr.getEntityFeature().size()); -// //check for a feature object by using URI generated the same way as it's in the converter: -// String mfUri = Normalizer.uri(model.getXmlBase(), null, pr.getDisplayName() + "_1", ModificationFeature.class); -// ModificationFeature mf = (ModificationFeature) model.getByID(mfUri); -// assertNotNull(mf); -// assertTrue(pr.getEntityFeature().contains(mf)); -// SequenceLocation sl = mf.getFeatureLocation(); -// assertTrue(sl instanceof SequenceSite); -// assertEquals(2, ((SequenceSite)sl).getSequencePosition()); -// assertEquals("N-acetylalanine", mf.getModificationType().getTerm().iterator().next()); -// //test for the following FT entry was correctly parsed/converted: -// // FT MOD_RES 45 -// // FT /note="Phosphothreonine; by CaMK4" -// // FT /evidence="ECO:0000250|UniProtKB:P0DP29" -// ModificationFeature f = null; -// for(EntityFeature ef : pr.getEntityFeature()) { -// if((ef instanceof ModificationFeature) && ((ModificationFeature)ef).getModificationType().getTerm().contains("Phosphothreonine")) { -// f = (ModificationFeature) ef; -// } -// } -// assertNotNull(f); -// assertTrue(f.getModificationType() instanceof SequenceModificationVocabulary); -// Set terms = f.getModificationType().getTerm(); -// assertTrue(terms.contains("Phosphothreonine")); -// assertTrue(f.getFeatureLocation() instanceof SequenceSite); - + //this is just to test for a bug in the DR text format parser... boolean rel = false; for(Xref x : pr.getXref()) { diff --git a/src/test/java/cpath/service/ConsoleApplicationIT.java b/src/test/java/cpath/service/ConsoleApplicationIT.java index 3fb9dffb..302ed68f 100644 --- a/src/test/java/cpath/service/ConsoleApplicationIT.java +++ b/src/test/java/cpath/service/ConsoleApplicationIT.java @@ -197,10 +197,10 @@ public void premergeAndMerge() throws IOException { Model warehouse = CPathUtils.importFromTheArchive(service.settings().warehouseModelFile()); assertNotNull(warehouse); assertFalse(warehouse.getObjects(ProteinReference.class).isEmpty()); - assertTrue(warehouse.containsID("bioregistry.io/uniprot:P0DP23")); + assertTrue(warehouse.containsID("http://bioregistry.io/uniprot:P0DP23")); assertFalse(warehouse.getObjects(SmallMoleculeReference.class).isEmpty()); - assertTrue(warehouse.containsID("bioregistry.io/chebi:20")); - ProteinReference pr = (ProteinReference) warehouse.getByID("bioregistry.io/uniprot:P0DP23"); + assertTrue(warehouse.containsID("http://bioregistry.io/chebi:20")); + ProteinReference pr = (ProteinReference) warehouse.getByID("http://bioregistry.io/uniprot:P0DP23"); assertNotNull(pr); assertNotNull(pr.getName()); assertFalse(pr.getName().isEmpty()); @@ -210,7 +210,7 @@ public void premergeAndMerge() throws IOException { assertFalse(pr.getXref().isEmpty()); service.index().refresh(); - assertTrue(warehouse.containsID("bioregistry.io/uniprot:Q8TD86")); + assertTrue(warehouse.containsID("http://bioregistry.io/uniprot:Q8TD86")); // test some id-mapping using different srcDb names (UniProt synonyms...) Set acs = service.map(List.of("A2A2M3"), "UNIPROT"); assertFalse(acs.isEmpty()); @@ -229,7 +229,7 @@ public void premergeAndMerge() throws IOException { // (the id-mapping table only has canonical uniprot AC/IDs, not isoform IDs) acs = service.map(List.of("NP_619650"), "UNIPROT"); assertTrue(acs.contains("Q8TD86")); - assertTrue(warehouse.containsID("bioregistry.io/uniprot:Q8TD86")); + assertTrue(warehouse.containsID("http://bioregistry.io/uniprot:Q8TD86")); ids = service.map(List.of("P01118"), "UNIPROT"); assertEquals(1, ids.size()); @@ -335,7 +335,7 @@ public void premergeAndMerge() throws IOException { // Test FETCH (get an object or subnetwork by URI or ID service; uses the full-text id-mapping index too) // fetch as BIOPAX - res = service.fetch(OutputFormat.BIOPAX, null, false, "bioregistry.io/uniprot:P27797"); + res = service.fetch(OutputFormat.BIOPAX, null, false, "http://bioregistry.io/uniprot:P27797"); assertNotNull(res); assertTrue(res instanceof DataResponse); assertFalse(res.isEmpty()); @@ -353,7 +353,7 @@ public void premergeAndMerge() throws IOException { assertFalse(((DataResponse) res).getProviders().isEmpty()); // fetch a small molecule by URI - res = service.fetch(OutputFormat.BIOPAX, null, false, "bioregistry.io/chebi:20"); + res = service.fetch(OutputFormat.BIOPAX, null, false, "http://bioregistry.io/chebi:20"); assertNotNull(res); assertFalse(res.isEmpty()); @@ -364,7 +364,7 @@ public void premergeAndMerge() throws IOException { //test traverse using path and URI res = service.traverse("ProteinReference/displayName", - "bioregistry.io/uniprot:P27797"); + "http://bioregistry.io/uniprot:P27797"); assertTrue(res instanceof TraverseResponse); assertFalse(res.isEmpty()); List vals = ((TraverseResponse) res).getTraverseEntry().get(0).getValue(); @@ -395,22 +395,22 @@ private void assertMerge(Model mergedModel) { // test proper merge of protein reference assertTrue(mergedModel.containsID(DS_XML_BASE+"Protein_54")); assertFalse(mergedModel.containsID("http://www.biopax.org/examples/myExample#Protein_54")); //due to orig. xml base was rewritten - assertTrue(mergedModel.containsID("bioregistry.io/uniprot:P27797")); //CALR_HUMAN + assertTrue(mergedModel.containsID("http://bioregistry.io/uniprot:P27797")); //CALR_HUMAN assertTrue(mergedModel.containsID(Normalizer.uri(XML_BASE, "UNIPROT", "P27797", UnificationXref.class))); String humanUri = Normalizer.uri(XML_BASE, "taxonomy", "9606", BioSource.class); assertTrue(mergedModel.containsID(humanUri)); String clUri = Normalizer.uri(XML_BASE, "GO", "GO:0005737", CellularLocationVocabulary.class); assertTrue(mergedModel.containsID(clUri)); - assertTrue(mergedModel.containsID("bioregistry.io/uniprot:P13631")); - assertFalse(mergedModel.containsID("bioregistry.io/uniprot:P22932")); + assertTrue(mergedModel.containsID("http://bioregistry.io/uniprot:P13631")); + assertFalse(mergedModel.containsID("http://bioregistry.io/uniprot:P22932")); //sec. ACs are not kept anymore (they're used in creating id-mapping and index, and then removed) assertFalse(mergedModel.containsID(Normalizer.uri(XML_BASE, "UNIPROT", "P01118_secondary-ac", RelationshipXref.class))); - assertFalse(mergedModel.containsID("bioregistry.io/uniprot:P01118")); //must be replaced with P01116 and gone + assertFalse(mergedModel.containsID("http://bioregistry.io/uniprot:P01118")); //must be replaced with P01116 and gone assertTrue(mergedModel.containsID(Normalizer.uri(XML_BASE, "UNIPROT", "P01116", UnificationXref.class))); - assertTrue(mergedModel.containsID("bioregistry.io/uniprot:P01116")); + assertTrue(mergedModel.containsID("http://bioregistry.io/uniprot:P01116")); - ProteinReference pr = (ProteinReference) mergedModel.getByID("bioregistry.io/uniprot:P27797"); + ProteinReference pr = (ProteinReference) mergedModel.getByID("http://bioregistry.io/uniprot:P27797"); assertEquals(10, pr.getName().size()); //make sure this one is passed (important!) assertEquals("CALR_HUMAN", pr.getDisplayName()); assertEquals("Calreticulin", pr.getStandardName()); @@ -420,8 +420,8 @@ private void assertMerge(Model mergedModel) { // test proper merge of small molecule reference assertFalse(mergedModel.containsID("http://www.biopax.org/examples/myExample#beta-D-fructose_6-phosphate")); assertTrue(mergedModel.containsID(DS_XML_BASE+"beta-D-fructose_6-phosphate")); - assertTrue(mergedModel.containsID("bioregistry.io/chebi:20")); - SmallMoleculeReference smr = (SmallMoleculeReference) mergedModel.getByID("bioregistry.io/chebi:20"); + assertTrue(mergedModel.containsID("http://bioregistry.io/chebi:20")); + SmallMoleculeReference smr = (SmallMoleculeReference) mergedModel.getByID("http://bioregistry.io/chebi:20"); assertNotNull(smr.getStructure()); assertSame(StructureFormatType.InChI, smr.getStructure().getStructureFormat()); assertNotNull(smr.getStructure().getStructureData()); @@ -432,20 +432,20 @@ private void assertMerge(Model mergedModel) { // A special test id-mapping file (some PubChem SIDs and CIDs to ChEBI) is there present. // The PubChem:14438 SMR would not be replaced by CHEBI:20 if it were not having standard URI // (because the original xref has ambiguous db='PubChem' it wouldn't map to CHEBI:20); - assertFalse(mergedModel.containsID("bioregistry.io/pubchem.substance:14438")); + assertFalse(mergedModel.containsID("http://bioregistry.io/pubchem.substance:14438")); // but 14439 gets successfully replaced/merged - assertFalse(mergedModel.containsID("bioregistry.io/pubchem.substance:14439")); //maps to CHEBI:28 by xrefs + assertFalse(mergedModel.containsID("http://bioregistry.io/pubchem.substance:14439")); //maps to CHEBI:28 by xrefs SmallMolecule sm = (SmallMolecule) mergedModel.getByID(DS_XML_BASE+"alpha-D-glucose_6-phosphate"); smr = (SmallMoleculeReference) sm.getEntityReference(); assertNotNull(smr); - assertEquals("bioregistry.io/chebi:422", smr.getUri()); + assertEquals("http://bioregistry.io/chebi:422", smr.getUri()); // smr must not contain any member SMR anymore (changeed on 2015/11/26) // (if ChEBI OBO was previously converted by ChebiOntologyAnalysis) assertEquals(0, smr.getMemberEntityReference().size()); assertEquals(4, smr.getXref().size());//0 PX, 1 UX and 3 RX (ChEBI) are there! - SmallMoleculeReference msmr = (SmallMoleculeReference) mergedModel.getByID("bioregistry.io/chebi:20"); + SmallMoleculeReference msmr = (SmallMoleculeReference) mergedModel.getByID("http://bioregistry.io/chebi:20"); assertEquals("(+)-camphene", msmr.getDisplayName()); assertEquals("(1R,4S)-2,2-dimethyl-3-methylidenebicyclo[2.2.1]heptane", msmr.getStandardName()); assertEquals(3, msmr.getXref().size()); @@ -456,7 +456,7 @@ private void assertMerge(Model mergedModel) { assertNotNull(smr); assertEquals(smr, msmr);//CHEBI:20 - smr = (SmallMoleculeReference) mergedModel.getByID("bioregistry.io/chebi:28"); + smr = (SmallMoleculeReference) mergedModel.getByID("http://bioregistry.io/chebi:28"); assertEquals(5, smr.getXref().size(), "chebi:28 smr.xref.size!=5"); // relationship xrefs were removed before merging assertEquals("(R)-linalool", smr.getDisplayName()); assertEquals(5, smr.getEntityReferenceOf().size(), "chebi:28 entityReferenceOf.size!=5"); @@ -474,7 +474,7 @@ private void assertMerge(Model mergedModel) { assertEquals(1, ux.getXrefOf().size()); // check features from the warehouse and pathway data were merged properly - pr = (ProteinReference) mergedModel.getByID("bioregistry.io/uniprot:P01116"); + pr = (ProteinReference) mergedModel.getByID("http://bioregistry.io/uniprot:P01116"); assertEquals(2, pr.getEntityFeature().size()); //from test models (no mod_res features from uniprot anymore) for (EntityFeature ef : pr.getEntityFeature()) { assertSame(pr, ef.getEntityFeatureOf()); @@ -482,11 +482,11 @@ private void assertMerge(Model mergedModel) { //SmallMoleculeReference165390 SMR should have been replaced with one from the warehouse (ChEBI) or removed assertFalse(mergedModel.containsID("http://identifiers.org/chebi/CHEBI:28"));//shoulda match by ID and become bioregistry.io/chebi:28! - assertTrue(mergedModel.containsID("bioregistry.io/chebi:28")); + assertTrue(mergedModel.containsID("http://bioregistry.io/chebi:28")); assertFalse(mergedModel.containsID("http://biocyc.org/biopax/biopax-level3#SmallMoleculeReference165390"));//orig. URI base was replaced assertFalse(mergedModel.containsID(DS_XML_BASE+"SmallMoleculeReference165390")); // check the canonical SMR has proper member/memberOf - smr = (SmallMoleculeReference) mergedModel.getByID("bioregistry.io/chebi:28"); + smr = (SmallMoleculeReference) mergedModel.getByID("http://bioregistry.io/chebi:28"); // - was matched/replaced by the same URI Warehouse SMR sm = (SmallMolecule) mergedModel.getByID(DS_XML_BASE+"SmallMolecule173158"); assertFalse(smr.getXref().isEmpty()); diff --git a/src/test/java/cpath/web/WebApplicationIT.java b/src/test/java/cpath/web/WebApplicationIT.java index 10d6c4e6..cdec706c 100644 --- a/src/test/java/cpath/web/WebApplicationIT.java +++ b/src/test/java/cpath/web/WebApplicationIT.java @@ -115,11 +115,11 @@ public void getFetchQueryNOK() { // API v2 disallows HTTP GET public void postFetchQuery() { // API v1, HTTP POST, body: URL-encoded form parameters HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - String body = "uri=bioregistry.io/uniprot:P27797"; //will be url-encoded before sent + String body = "uri=http://bioregistry.io/uniprot:P27797"; //will be url-encoded before sent HttpEntity req = new HttpEntity<>(body, headers); String result = template.postForObject("/get", req, String.class); assertNotNull(result); - assertTrue(result.contains("