From b22e2858d08ee27970cc248a66a2eaf501ff5a23 Mon Sep 17 00:00:00 2001 From: cmungall Date: Thu, 17 May 2018 19:19:12 -0700 Subject: [PATCH] Minerva changes in prep for switch of URIs, see https://github.com/geneontology/go-site/issues/617 Makefil added to clarify how the json ld contexts are built. Now using go and obo context only --- Makefile | 4 ++++ .../minerva/curie/DefaultCurieHandler.java | 12 +++++----- .../src/main/resources/go_context.jsonld | 17 ++++--------- .../curie/DefaultCurieHandlerTest.java | 24 ++++++++++++------- 4 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f8f9d6f7 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +# See: https://github.com/geneontology/go-site/issues/617 +# Note: we will later switch to doing this as part of the GO release +minerva-core/src/main/resources/go_context.jsonld: + wget --no-check-certificate https://raw.githubusercontent.com/prefixcommons/biocontext/master/registry/go_context.jsonld -O $@ diff --git a/minerva-core/src/main/java/org/geneontology/minerva/curie/DefaultCurieHandler.java b/minerva-core/src/main/java/org/geneontology/minerva/curie/DefaultCurieHandler.java index 39dc7311..9c19adfa 100644 --- a/minerva-core/src/main/java/org/geneontology/minerva/curie/DefaultCurieHandler.java +++ b/minerva-core/src/main/java/org/geneontology/minerva/curie/DefaultCurieHandler.java @@ -33,13 +33,13 @@ public static CurieMappings loadMappingsFromFile(File jsonld) throws FileNotFoun public static CurieMappings loadDefaultMappings() { final Map curieMap = new HashMap(); + // TODO: we believe we only need obo_context and go_context + // See: https://github.com/geneontology/go-site/issues/617 loadJsonldResource("obo_context.jsonld", curieMap); - // TODO: we believe we only need obo_context and go_context - // See: https://github.com/geneontology/go-site/issues/617 - loadJsonldResource("monarch_context.jsonld", curieMap); - loadJsonldResource("amigo_context_gen.jsonld", curieMap); - loadJsonldResource("amigo_context_manual.jsonld", curieMap); - loadJsonldResource("go_context.jsonld", curieMap); + loadJsonldResource("go_context.jsonld", curieMap); + //loadJsonldResource("monarch_context.jsonld", curieMap); + //loadJsonldResource("amigo_context_gen.jsonld", curieMap); + //loadJsonldResource("amigo_context_manual.jsonld", curieMap); return new CurieMappings.SimpleCurieMappings(curieMap); } diff --git a/minerva-core/src/main/resources/go_context.jsonld b/minerva-core/src/main/resources/go_context.jsonld index 3ef16c07..52236f5a 100644 --- a/minerva-core/src/main/resources/go_context.jsonld +++ b/minerva-core/src/main/resources/go_context.jsonld @@ -20,7 +20,6 @@ "MEROPS_fam": "http://merops.sanger.ac.uk/cgi-bin/famsum?family=", "GO_REF": "http://purl.obolibrary.org/obo/go/references/", "VEGA": "http://vega.sanger.ac.uk/id/", - "EnsemblProtists": "http://www.ensemblgenomes.org/id/", "ZFIN": "http://identifiers.org/zfin/", "AspGD_REF": "http://www.aspergillusgenome.org/cgi-bin/reference/reference.pl?dbid=", "RO": "http://purl.obolibrary.org/obo/RO_", @@ -33,7 +32,6 @@ "SGN": "http://identifiers.org/sgn/", "BFO": "http://purl.obolibrary.org/obo/BFO_", "Genesys-pgr": "https://www.genesys-pgr.org/acn/search?q=", - "NCBI_gi": "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=", "UniMod": "http://www.unimod.org/modifications_view.php?editid1=", "UM-BBD_reactionID": "http://eawag-bbd.ethz.ch/servlets/pageservlet?ptype=r&reacID=", "PubChem_Substance": "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pcsubstance&term=", @@ -42,7 +40,7 @@ "InterPro": "http://identifiers.org/interpro/", "UniRule": "http://www.uniprot.org/unirule/", "MGCSC_GENETIC_STOCKS": "http://www.maizegdb.org/cgi-bin/displaystockrecord.cgi?id=", - "dictyBase": "http://identifiers.org/dbsnp/", + "dictyBase": "http://identifiers.org/dictybase/", "PO_GIT": "https://github.com/Planteome/plant-ontology/issues/", "AspGD_LOCUS": "http://identifiers.org/aspgd.locus/", "SGD": "http://identifiers.org/sgd/", @@ -51,13 +49,10 @@ "PAMGO_MGG": "http://scotland.fgl.ncsu.edu/cgi-bin/adHocQuery.cgi?adHocQuery_dbName=smeng_goannotation&Action=Data&QueryName=Functional+Categorization+of+MGG+GO+Annotation&P_KeyWord=", "AgBase": "http://www.agbase.msstate.edu/cgi-bin/getEntry.pl?db_pick=[ChickGO/MaizeGO]&uid=", "AraCyc": "http://www.arabidopsis.org:1555/ARA/NEW-IMAGE?type=NIL&object=", - "GONUTS": "http://gowiki.tamu.edu/wiki/index.php/", "EcoCyc_REF": "http://biocyc.org/ECOLI/reference.html?type=CITATION-FRAME&object=", - "EnsemblPlants": "http://www.ensemblgenomes.org/id/", "CHEBI": "http://purl.obolibrary.org/obo/CHEBI_", "HGNC": "http://identifiers.org/hgnc/", "dictyBase_gene_name": "http://dictybase.org/gene/", - "ENSEMBL_ProteinID": "http://www.ensembl.org/id/", "TAIR": "http://identifiers.org/tair.locus/", "EnsemblFungi": "http://www.ensemblgenomes.org/id/", "Wikipedia": "http://en.wikipedia.org/wiki/", @@ -75,7 +70,6 @@ "MIPS_funcat": "http://mips.gsf.de/cgi-bin/proj/funcatDB/search_advanced.pl?action=2&wert=", "GR_REF": "http://www.gramene.org/db/literature/pub_search?ref_id=", "MaizeGDB": "http://maizegdb.org/gene_center/gene/", - "EnsemblMetazoa": "http://www.ensemblgenomes.org/id/", "HAMAP": "http://hamap.expasy.org/unirule/", "SGN_ref": "http://www.sgn.cornell.edu/chado/publication.pl?pub_id=", "TO_GIT": "https://github.com/Planteome/plant-trait-ontology/issues/", @@ -84,7 +78,6 @@ "MaizeGDB_REF": "http://maizegdb.org/data_center/reference?id=", "GEO": "http://www.ncbi.nlm.nih.gov/sites/GDSbrowser?acc=", "PO": "http://purl.obolibrary.org/obo/PO_", - "ENSEMBL_TranscriptID": "http://www.ensembl.org/id/", "PomBase": "http://identifiers.org/pombase/", "ENA": "http://www.ebi.ac.uk/ena/data/view/", "PIRSF": "http://pir.georgetown.edu/cgi-bin/ipcSF?id=", @@ -101,6 +94,7 @@ "WB_REF": "http://www.wormbase.org/db/misc/paper?name=", "TGD_LOCUS": "http://db.ciliate.org/cgi-bin/locus.pl?locus=", "MA": "http://purl.obolibrary.org/obo/MA_", + "UniProtKB": "http://identifiers.org/uniprot/", "MGI": "http://identifiers.org/mgi/", "GRINDesc": "https://npgsweb.ars-grin.gov/gringlobal/descriptordetail.aspx?id=", "DDANAT": "http://purl.obolibrary.org/obo/DDANAT_", @@ -114,7 +108,7 @@ "Gene3D": "http://gene3d.biochem.ucl.ac.uk/search?mode=family&sterm=", "PATRIC": "http://patric.vbi.vt.edu/gene/overview.php?fid=", "FB": "http://identifiers.org/flybase/", - "UniProtKB": "http://identifiers.org/uniprot/", + "PAINT_REF": "http://www.pantherdb.org/panther/lookupId.jsp?id=PTHR", "CASREF": "http://research.calacademy.org/research/ichthyology/catalog/getref.asp?id=", "ENSEMBL": "http://identifiers.org/ensembl/", "SMART": "http://smart.embl-heidelberg.de/smart/do_annotation.pl?BLAST=DUMMY&DOMAIN=", @@ -160,19 +154,18 @@ "SEED": "http://www.theseed.org/linkin.cgi?id=", "SO": "http://purl.obolibrary.org/obo/SO_", "Soy_gene": "http://www.soybase.org/sbt/search/search_results.php?category=FeatureName&search_term=", - "PECO_GIT": "https://github.com/Planteome/plant-environment-ontology/issues/", "CORUM": "http://mips.gsf.de/genre/proj/corum/complexdetails.html?id=", "RHEA": "http://www.rhea-db.org/reaction.xhtml?id=", "dbSNP": "http://identifiers.org/dbsnp/", "MaizeGDB_Locus": "http://identifiers.org/maizegdb.locus/", "MO": "http://mged.sourceforge.net/ontologies/MGEDontology.php#", "PLANA_REF": "http://purl.obolibrary.org/obo/plana/references/", - "BRENDA": "http://purl.obolibrary.org/obo/BTO_", + "BRENDA": "http://www.brenda-enzymes.info/php/result_flat.php4?ecno=", "ASAP": "https://asap.ahabs.wisc.edu/annotation/php/feature_info.php?FeatureID=", "CAS": "http://identifiers.org/cas/", "H-invDB_locus": "http://www.h-invitational.jp/hinv/spsoup/locus_view?hix_id=", "UM-BBD_ruleID": "http://eawag-bbd.ethz.ch/servlets/rule.jsp?rule=", - "taxon": "http://purl.obolibrary.org/obo/NCBITaxon_", + "NCBITaxon": "http://purl.obolibrary.org/obo/NCBITaxon_", "ComplexPortal": "https://www.ebi.ac.uk/complexportal/complex/", "JSTOR": "http://www.jstor.org/stable/", "GRIMS": "https://www.genesys-pgr.org/acn/search2?q=IRGC+", diff --git a/minerva-core/src/test/java/org/geneontology/minerva/curie/DefaultCurieHandlerTest.java b/minerva-core/src/test/java/org/geneontology/minerva/curie/DefaultCurieHandlerTest.java index ea8c49d6..6aa43f63 100644 --- a/minerva-core/src/test/java/org/geneontology/minerva/curie/DefaultCurieHandlerTest.java +++ b/minerva-core/src/test/java/org/geneontology/minerva/curie/DefaultCurieHandlerTest.java @@ -24,14 +24,22 @@ public void testAll() { assertTrue(handler.getInternalMappings().containsKey("PMID")); assertFalse(handler.getInternalMappings().containsKey("BLABLA")); } - - @Test - public void testObo() { - InputStream stream = DefaultCurieHandler.loadResourceAsStream("obo_context.jsonld"); - assertNotNull(stream); - CurieMappings mappings = CurieMappingsJsonld.loadJsonLdContext(stream); - assertFalse(mappings.getMappings().isEmpty()); - } + + @Test + public void testGo() { + InputStream stream = DefaultCurieHandler.loadResourceAsStream("go_context.jsonld"); + assertNotNull(stream); + CurieMappings mappings = CurieMappingsJsonld.loadJsonLdContext(stream); + assertFalse(mappings.getMappings().isEmpty()); + } + + @Test + public void testObo() { + InputStream stream = DefaultCurieHandler.loadResourceAsStream("obo_context.jsonld"); + assertNotNull(stream); + CurieMappings mappings = CurieMappingsJsonld.loadJsonLdContext(stream); + assertFalse(mappings.getMappings().isEmpty()); + } @Test public void testMonarch() {