Changeset 1398


Ignore:
Timestamp:
Jan 13, 2011, 5:29:54 PM (6 years ago)
Author:
business@…
Message:

make sure manual adding of ontologies is only done in development and test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrapTemplates.groovy

    r1341 r1398  
    2222                "inserting initial ontologies".grom()
    2323
    24                 // add Species ontology which is used for a.o. the Subject domain field 'species'
    25                 def speciesOntology = new Ontology(
    26                         name: 'NCBI organismal classification',
    27                         description: 'A taxonomic classification of living organisms and associated artifacts for their controlled description within the context of databases.',
    28                         url: 'http://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/',
    29                         versionNumber: '1.2',
    30                         ncboId: '1132',
    31                         ncboVersionedId: '38802'
    32                 ).with { if (!validate()) { errors.each { println it} } else save()}
    33 
    34                 // add Sample>material ontology
    35                 def brendaOntology = new Ontology(
    36                         name: 'BRENDA tissue / enzyme source',
    37                         description: 'A structured controlled vocabulary for the source of an enzyme. It comprises terms for tissues, cell lines, cell types and cell cultures from uni- and multicellular organisms.',
    38                         url: 'http://www.brenda-enzymes.info',
    39                         versionNumber: '1.3',
    40                         ncboId: '1005',
    41                         ncboVersionedId: '40643'
    42                 ).with { if (!validate()) { errors.each { println it} } else save()}
    43 
    44                 // add NCI ontology which is used in Mouse genotype template field
    45                 def nciOntology = new Ontology(
    46                         name: 'NCI Thesaurus',
    47                         description: 'A vocabulary for clinical care, translational and basic research, and public information and administrative activities.',
    48                         url: 'http://ncicb.nci.nih.gov/core/EVS',
    49                         versionNumber: '10.03',
    50                         ncboId: '1032',
    51                         ncboVersionedId: '42838'
    52                 ).with { if (!validate()) { errors.each { println it} } else save()}
    53 
    54                 // add CHEBI ontology which is used for describing chemicals in e.g. events
    55                 def chebiOntology = new Ontology(
    56                         name: 'Chemical entities of biological interest',
    57                         description: 'A structured classification of chemical compounds of biological relevance.',
    58                         url: 'http://www.ebi.ac.uk/chebi',
    59                         versionNumber: '1.73',
    60                         ncboId: '1007',
    61                         ncboVersionedId: '44746'
    62                 ).with { if (!validate()) { errors.each { println it} } else save()}
    63 
    64                 /* These ontologies can be added dynamically, fetching the description and such from BioPortal.
    65                    However, because the BioPortal REST services are currently down,
    66                    added the above as a fix which allows running offline from BioPortal,
    67                    and commenting out the following lines.
    68 
    69                 def speciesOntology = Ontology.getOrCreateOntologyByNcboId(1132)
    70                 def brendaOntology = Ontology.getOrCreateOntologyByNcboId(1005)
    71                 def nciOntology = Ontology.getOrCreateOntologyByNcboId(1032)
    72                 def chebiOntology = Ontology.getOrCreateOntologyByNcboId(1007)
    73                 */
     24                // If running in development or test mode, add ontologies manually to speed up development and allow running offline
     25                if (grails.util.GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT || grails.util.GrailsUtil.environment == GrailsApplication.ENV_TEST) {
     26
     27                        // add Species ontology which is used for a.o. the Subject domain field 'species'
     28                        def speciesOntology = new Ontology(
     29                                name: 'NCBI organismal classification',
     30                                description: 'A taxonomic classification of living organisms and associated artifacts for their controlled description within the context of databases.',
     31                                url: 'http://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/',
     32                                versionNumber: '1.2',
     33                                ncboId: '1132',
     34                                ncboVersionedId: '38802'
     35                        ).with { if (!validate()) { errors.each { println it} } else save()}
     36
     37                        // add Sample>material ontology
     38                        def brendaOntology = new Ontology(
     39                                name: 'BRENDA tissue / enzyme source',
     40                                description: 'A structured controlled vocabulary for the source of an enzyme. It comprises terms for tissues, cell lines, cell types and cell cultures from uni- and multicellular organisms.',
     41                                url: 'http://www.brenda-enzymes.info',
     42                                versionNumber: '1.3',
     43                                ncboId: '1005',
     44                                ncboVersionedId: '40643'
     45                        ).with { if (!validate()) { errors.each { println it} } else save()}
     46
     47                        // add NCI ontology which is used in Mouse genotype template field
     48                        def nciOntology = new Ontology(
     49                                name: 'NCI Thesaurus',
     50                                description: 'A vocabulary for clinical care, translational and basic research, and public information and administrative activities.',
     51                                url: 'http://ncicb.nci.nih.gov/core/EVS',
     52                                versionNumber: '10.03',
     53                                ncboId: '1032',
     54                                ncboVersionedId: '42838'
     55                        ).with { if (!validate()) { errors.each { println it} } else save()}
     56
     57                        // add CHEBI ontology which is used for describing chemicals in e.g. events
     58                        def chebiOntology = new Ontology(
     59                                name: 'Chemical entities of biological interest',
     60                                description: 'A structured classification of chemical compounds of biological relevance.',
     61                                url: 'http://www.ebi.ac.uk/chebi',
     62                                versionNumber: '1.73',
     63                                ncboId: '1007',
     64                                ncboVersionedId: '44746'
     65                        ).with { if (!validate()) { errors.each { println it} } else save()}
     66
     67                }
     68                // otherwise, this may be a production demo instance, so initialize the ontologies dynamically from BioPortal
     69                else {
     70
     71                        def speciesOntology = Ontology.getOrCreateOntologyByNcboId(1132)
     72                        def brendaOntology = Ontology.getOrCreateOntologyByNcboId(1005)
     73                        def nciOntology = Ontology.getOrCreateOntologyByNcboId(1032)
     74                        def chebiOntology = Ontology.getOrCreateOntologyByNcboId(1007)
     75                }
    7476        }
    7577
Note: See TracChangeset for help on using the changeset viewer.