Ignore:
Timestamp:
Jun 10, 2010, 1:36:02 AM (10 years ago)
Author:
keesvb
Message:

added BioPortal? Ontology add function via Ontocat, added test for that

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/data/Ontology.groovy

    r496 r552  
    4040                }*/
    4141        }
     42
     43        static Ontology getBioPortalOntology(String ncboId) {
     44                // Get ontology from BioPortal via Ontocat
     45                // TODO: maybe make a static OntologyService instance to be more efficient, and decorate it with caching?
     46                uk.ac.ebi.ontocat.OntologyService os = new uk.ac.ebi.ontocat.bioportal.BioportalOntologyService()
     47                uk.ac.ebi.ontocat.Ontology o = os.getOntology(ncboId)
     48
     49                // Instantiate and return Ontology object
     50                new dbnp.data.Ontology(
     51                        name: o.label,
     52                        description: o.description,
     53                        url: o.properties['homepage'] ?: "http://bioportal.bioontology.org/ontologies/${o.id}",
     54                        versionNumber: o.versionNumber,
     55                        ncboId: o.ontologyAccession,
     56                        ncboVersionedId: o.id
     57                );
     58        }
    4259}
Note: See TracChangeset for help on using the changeset viewer.