BACKGROUND
ontologies are increasingly used to annotate life science data  <cit> , to improve search and integration  <cit> , and to model complex biological knowledge unambiguously  <cit> .
by definition, an ontology is a specification of a representational vocabulary for a shared domain of discourse - definitions of classes, relations, functions, and other objects  <cit>  or in short it is an explicit specification of a conceptualisation  <cit> .
for example, the disease ontology  <cit>  and the nci thesaurus  <cit>  are both examples of ontologies in the disease domain and cancer  and malignant neoplasm  are examples of equivalent concepts therein.
when used this allows for unambiguous attribution of a particular experimental condition or sample characteristic.
in recent years the obo foundry community has succeeded in creating a valuable catalogue of orthogonal, cross-linked ontologies  <cit>  for life sciences, of which the gene ontology  <cit>  for integration of gene annotations is a well known example.
however, there is still a considerable overlap especially in the areas of anatomy and disease, requiring much querying and integration when using ontologies in practice.
for the purpose of this article, ontology querying and integration is defined as integration of ontologies into software applications and the practical use of ontologies to annotate real data.
this clarification is necessary as ontology integration can also be understood as the integration of ontologies when building new ontologies by reusing other ontologies, or integration of ontologies by merging different ontologies into a single one that unifies them  <cit> .
bioinformaticians integrating public domain ontologies into their work face the following issues:  there are no standardised identifying features that characterise ontologies from the user's perspective;  individual ontology resources do not follow the same logical organisation;  to search for appropriate ontologies requires expert knowledge  <cit> ; and  programmatic ontology search is challenging.
a www ontology broker has been proposed to solve some of the issues  <cit> .
this was predated by an important effort in the biomedical domain, namely the unified medical language system , which encompasses a number of controlled vocabularies critical for the biomedical sciences and is still in active use for more than twenty years since its conception in  <dig>  <cit> .
there are now two major ontology repositories available: the ebi ontology lookup service   <cit>  and the ncbo bioportal  <cit> .
although there is some overlap in content between them ; some ontologies are only available in one repository so potentially both have to be queried to access all available ontologies.
for example, disease ontology  <cit>  is available in both repositories, but nci thesaurus  <cit>  is not available in ols, and pride controlled vocabulary  <cit>  does not exist in bioportal.
table  <dig> highlights a case where both ols and bioportal serve the same ontology, but differ in features such as accessions, versions, or number of terms available.
moreover, many users also develop local ontologies for internal use, which are proprietary and cannot be published online, or are still in development and not suitable for public consumption.
those ontologies are often developed in obo or owl.
the fma ontology as shown here differs substantially in availability and structure between the two repositories .
it has been postulated that manual annotation is no longer sufficient to keep up with the current rate that new data are generated in the biomedical domain  <cit> .
the field is undergoing rapid evolution, with the first generation of ontology development tools gaining wide adoption.
most notable examples in this area include protégé  <cit> , obo-edit  <cit> , and owl api  <cit> .
our experience is that building services to seamlessly access all these public repositories and local ontologies involves considerable effort, because these resources are still evolving or have rather advanced and heterogeneous programming structures.
a new generation of tools geared more towards bioinformaticians is needed, with the focus on flattening the learning curve and making common tasks simpler.
here we report the development of the software library for common ontology api tasks  that can be easily used from java programs, bioconductor/r  <cit>   and restful web services clients.
development as an open source community effort has helped to alleviate the challenges of accessing a fast evolving landscape of ontology resources and has already enabled large scale ontology integration in the experimental factor ontology  <cit> , arrayexpress  <cit> , molgenis/xgap  <cit>  and gen2phen http://www.gen2phen.org use cases.
implementation
ontocat is an application suite that combines access to a large number of terms via a java <dig> package, a rest interface, and an r interface, all available under the permissive lgplv <dig> or apache  licenses for anyone to use and extend.
the ontocat java package provides a generic ontologyservice interface  to query ontology sources.
a code example is also provided in figure  <dig>  ontocat provides simple and easy-to-use api for bioportal and ols web services, and the owl api  <cit>  .
table  <dig> illustrates how the common interface maps to respective functionalities in supported resources.
obo ontologies are translated by owl api into valid owl by a dedicated obo parser.
this process results in a lossless version of the obo ontology in owl, as in terms of content obo format can be considered a subset of owl.
in particular, synonyms and definitions are loaded into synonym and def owl annotations respectively and are then available as synonyms and definitions in ontocat.
http://rest.bioontology.org/bioportal/
Δ
.getontologyloaddate()
?query=url-encoded_query
&sexactmatch= <cit>
&includeproperties= <cit>
&maxnumhits = 10000000
1) .gettermsbyexactname
2) .gettermsbyname
3) .gettermsbyannotationdata, .getannotationstringvalue()
?query = url-encoded query
&isexactmatch= <cit>
&includeproperties= <cit>
&maxnumhits = 10000000
&email=email_address
?conceptid=url-encoded termaccession
./search/?query=url-encoded_termaccession
getrootterms()
&pagenum=pagenum
?conceptid = root &email=email_address
owlclass.getsuperclasses()
Δ
search defaults to non-exact matching and excludes properties, but this can be overridden by user with specific search options .
the Δ symbol signifies that some additional processing is performed on the original output of the underlying service to integrate the results with the ontocat's ontologyservice interface.
for example, in the case of obo synonyms the appropriate property is found among the term's metadata and the additional context information is removed before the values are returned.
eager fetching means that when the underlying service returns only partial results, e.g.
bioportal's rootpath only provides term accessions, an additional query is issued to fully populate the result set.
all hierarchy algorithms where noted are called in a non-recursive way to avoid memory issues for traversing large graphs in a recursive manner.
web applications can connect using rest or soap services as shown in figure  <dig> and demonstrated in the online documentation via a simple html search widget.
researchers using r statistics can connect using the bioconductor/r ontocat package  <cit> .
documentation is available at http://www.ontocat.org including programming examples and a complete javadoc.
simple demo applications showing ontocat for ontology searches with google web toolkit on the google app engine framework and the molgenis platform  <cit>  are available at http://ontocat-web.appspot.com and http://www.ontocat.org/wiki/ontocatdownload.
the java api exposes the results as java objects or java primitives, the r package returns r objects, and the rest interface returns xml or json.
the basic ontologyservice interface is further enhanced by a number of easy to use decorators , which extend the primary functionality of the underlying resources to add caching, allow integrated searches across multiple ontology services or perform more specialised tasks like translation and sorting:
cachedservicedecorator
adds two caching layers to every request relayed through the decorator.
all requests test the first cache with a  <dig> hours expiry first.
if no record is found the request is passed through to the original provider.
if the original provider query fails the results are returned from the eternal cache .
this provides a fallback mechanism if an ontology resource becomes temporarily unavailable, e.g.
due to maintenance downtime.
compositedecorator
allows searching across multiple ontology resources using a single ontologyservice interface, effectively establishing another meta layer of abstraction.
all underlying resources encompassing different repositories and local files are therefore available from a single access point.
an example is provided in figure  <dig> and in the online documentation.
this service is multithreaded and requests are simultaneously sent off to all the underlying resources .
as in r the java code cannot be multithreaded a dedicated implementation exists in compositeservicenothreads.
sortedsubsetdecorator
adds sorting and subsetting capabilities to any search in the underlying service.
this allows the prioritization and ranking of terms when searching over a specific selection of ontologies.
the service is instantiated with a list of ontology accessions indicating suggested priority of use.
all searches performed with the decorated ontologyservice will be truncated to only include the results from this initial list of ontologies, and ranked in the original order the ontologies were specified.
translatedontologyservice
allows the mapping of term accessions from one local identifier namespace to a different one, e.g.
between bioportal and ols schemas as shown in table  <dig>  this facilitates combining different ontologies under a single schema and resolves format inconsistencies, e.g.
owl ncbitaxon_ <dig> versus obo ncbitaxon: <dig>  behind the scenes an ontologyidtranslator encapsulates a set of user defined ontologyidmappings.
each mapping consists of a regular expression that uniquely identifies a term as belonging to a particular ontology, and another regular expression to translate the term accessions and ontology accessions into the required format.
respective example code snippets are provided in the online documentation http://www.ontocat.org/wiki/ontocatguide.
use of the decorator design pattern allows other ontology users to quickly extend ontocat, implementing additional functionality such as custom search filters.
RESULTS
ontocat has proven a valuable toolbox to search and integrate ontologies from heterogeneous sources on a large scale.
example use cases of ontocat for integrating ontologies with data include: harmonising and promoting consistency in data annotations, facilitating automated annotations, inferring additional information based on the knowledge conceptualisation, supporting complex user queries and user interfaces, nonsense detection and integrating external data.
we report successful applications in the following real world scenarios:
use case: updating ontology properties
the experimental factor ontology   <cit>  is an application focused ontology modelling the experimental factors in functional genomics experiments available from the ebi databases arrayexpress  <cit>  and the gene expression atlas  <cit> .
the development of efo involves construction of mappings to multiple existing domain specific ontologies, such as the disease ontology  <cit>  and cell type ontology  <cit> .
this is achieved using a combination of automated downloads of relevant ontology terms using ontocat.
periodically all the established cross-references in efo to external ontologies have to be re-evaluated against bioportal in order to detect changes in source ontologies in addition to importing new and extra annotations such as new synonyms and external definitions for efo terms.
multithreading the ontocat requests allows our annotators to process and import extra information from over  <dig>  external ontology terms in less than  <dig> minutes.
legacy obo-like term accessions proved to be the biggest challenge, as they are not directly resolvable through bioportal.
for this reason custom implementations of the translatedontologyservice and ontologyidtranslator classes were created saving great amounts of manual annotation and checking, and are available in the uk.ac.ebi.efo.bioportal package.
use case: annotating user supplied experimental values with ontology terms
the arrayexpress archive  <cit>  and the gene expression atlas  <cit>  together contain over one million unique experiment annotations.
these are all annotated with ontology terms from the ebi's pre-release version of the application ontology efo, and where they do not exist in efo they have to be checked against publicly available ontologies.
this previously manual process has now been automated using the zooma http://zooma.sf.net application, which extracts a list of unmapped terms from the source database and queries the local efo pre-release owl file and existing mapped data inside local databases.
it returns perfect matches as automatic mappings, and also launches queries at bioportal and ols for unmapped terms.
if several mappings to efo are possible, these experiment annotations are flagged as requiring curation and periodically mapped by a member of the atlas curation team.
if no mappings to efo were present, but possible mappings were acquired from other ontologies , then these are flagged as new suggestions and used in the development of efo.
use case: local ontology management
ontocat has also been applied using the molgenis software  <cit> , and in particular on the extensible genotype and phenotype data platform, xgap  <cit> .
a user interface for ontology term search and management has been deployed as part of molgenis code generation software and is used in xgap and other models to allow users to search publically available ontologies and download terms to unambiguously annotate their experimental genotype, qtl or gwas data http://www.xgap.org.
in addition a small html search widget can be used by bioinformaticians to add ontocat search and term selection anywhere in their web applications.
here the user is provided with a 'search' box where they can type in keywords and then a selection of matching candidate terms is loaded from ols, bioportal, owl or obo files for the user to choose from .
working examples of both systems are provided in the online documentation http://www.ontocat.org/wiki/ontocatguide.
use case: data analysis
ontologies are used in data analysis as well as for annotation purposes and a new bioconductor  <cit>  package ontocat http://www.ontocat.org/wiki/r is now available to read in and query owl/obo format ontologies into r for use in downstream analyses.
the ontocat package was released in bioconductor  <dig>  and comes with built-in offline support for efo and also supports online bioportal and ols ontology queries.
discussion
simplicity and ease of use
ontocat was designed to make common use cases easy to implement while still enabling implementation of advanced algorithms.
many of such common tasks are demonstrated in code examples that are provided in the online documentation http://www.ontocat.org/wiki/ontocatguide.
ontocat was developed as a common access point for available resources and therefore does not incorporate all of their rich feature sets .
new features are added to ontocat only when new use cases demand it and only for cases where the functionality in question is available across all the supported ontology resources or can be in some way emulated .
the advantage of this approach is the ontologyservice interface is more stable keeping the api very close to programmer's practice.
complexity is represented as a number of public methods available in the respective java api interface or different web services signatures where the former is not available.
richness is measured as a number of hits returned from a non exact query for 'thymus'.
a logarithm of richness and complexity quotient is provided as a single score to judge the relation between the two.
it is higher the richer the source and less complex it is to access .
to further lower the barrier to practical use we followed the convention over configuration design approach.
whenever possible a default behaviour requiring zero configuration can be used by the developer minimizing the number of decisions that are needed to made, while not losing the flexibility of defining custom settings when necessary.
this principle is strictly adhered throughout the package, but one notable example is the implementation of the simple knowledge organization system  properties.
w3c recommends their usage to annotate definitions and synonyms in owl, but few owl ontologies adhere to this.
ontocat fully supports skos properties.
whenever they are employed in an ontology; label, synonym and definition annotations will be recognised automatically.
however, it is still possible to specify custom uri fragments on a per ontology basis when using a local file source.
use of synonyms is another common task that has considerable significance in text mining activities  <cit> .
the obo standard for denoting synonyms and definitions is also fully supported without additional configuration.
however, extra information available in obo, in the form of cross-references to describe the origins of the synonym, synonym category and scope , are stripped from the results to be consistent with output from other services.
the raw values can still be accessed through getannotations() if required.
generally speaking ontologies consist of individuals , classes , attributes, and relations.
in order to avoid the confusion in the implementation - the word "concept" is avoided altogether in the implementation, and "term" is used instead to denote both individuals and concepts.
here an ontology term is defined as a tuple consisting of  term accession,  term label, and  ontology accession that the particular term belongs to.
ideally a term accession should be enough to uniquely identify a term thereby rendering term label and ontology accession redundant.
however, this is not the case when label is the accession as shown for the fma ontology in bioportal .
storing an ontology accession helps to resolve the actual ontology the term belongs to.
the label is only recorded for convenience as in most cases it is used for text mining, query support or indexing.
in fact, in this case the label forms the fragment of the term uri, but the term cannot be retrieved solely by its uri as the rest query additionally requires the bioportal-assigned ontology accession.
in theory a uri should be enough to uniquely identify an ontology term across all services solving the complex issue of integrating data annotated using different ontology resources and in the semantic web applications; wide adoption would render the translatedontologyservice unnecessary.
in bioportal it is already possible to use uris  in place of the short term accessions, however at present terms cannot be retrieved solely by their uris as the rest interface requires the bioportal-assigned ontology accession to be provided additionally.
while this is a minor issue that is likely to be resolved in the future, there are a number of other factors preventing wide adoption of resource identifiers.
although owl ontologies fully support term uris already, obo format provides only rudimentary support.
obo community is in the process of embracing persistent uniform resource locators  to encode namespaces and this issue is likely to be mitigated in the future.
however, while all purls are uris, not all uris are purls, in particular uris are not limited to http protocol.
to add to the confusion owl  <dig> specification replaced uris with internationalized resource identifier , which potentially are not backward compatible with uris .
ideally, a consensus is also required in whether and how to report the ontology version within the uri and there is also the issue of uri stability between versions, e.g.
:
• fma  <dig>  - http://sig.uw.edu/fma#anatomical_entity
• fma  <dig>  - http://sig.biostr.washington.edu/fma <dig> #anatomical_entity
• fma  <dig>  - http://bioontology.org/projects/ontologies/fma/fma20owldlcomponent#anatomical_entity
common functionality and integration
no term-level versioning information is stored at present as we have no use cases where this would be particularly useful.
this information is only available through bioportal, no such feature exists in ols, and there are no standards to code against to identify versions in owl.
a common practice in the community is that any substantial change to a term is recorded by assigning a new term accession and obsoleting the original one.
it is not strictly defined what makes a change substantial, e.g.
debatable whether changing a class' position in ontology hierarchy warrants a new accession.
alternatively, term annotations could be used as a proxy for detecting changes.
a version clash could be detected where a single annotation  changes between two retrievals of the same ontology term.
bioportal exclusively provides access to previous versions of ontologies, however their feature set is limited compared to the most recent versions , i.e., hierarchy and search services are not available.
for example, for ontologies following a daily release cycle it is impractical to reindex them so often.
however, since bioportal stores all the ontologies that were ever processed in a downloadable format, it is possible to use this facility by passing any of the version links provided in the bioportal's ontology summary view into the ontocat's fileontologyservice.
this allows working with a specific version of the ontology, not necessarily the latest one, including hierarchy and search functionalities.
it is particularly useful in ontology development process for regression testing.
example  <dig> in the online documentation shows how two different versions of efo can be compared in such a way.
replicas of ontologies, i.e., the same ontology present in both repositories, are treated as different ontologies as they have different ontology accessions.
bioportal assigns unique numeric identifiers, whereas ols uses the abbreviation of the ontology name.
these ontology accessions cannot be resolved against each other automatically and in practice this should not be attempted due to differences shown in table  <dig>  in fact, not a single ontology between bioportal and ols shares the same ontology accession thus a manual mapping is required.
example  <dig> in the online documentation demonstrates how one ontology namespace could be translated into another using the aforementioned translatedontologyservice and the two replicas integrated.
when searching across both the repositories combined it is also possible to ignore one of the copies selectively with the sortedsubsetdecorator .
due to significant differences in the same ontology between the sources as demonstrated in table  <dig> integrating the results is not recommended in practice.
nevertheless, replication is handled gracefully without additional overhead because of the unique ontology accessions.
that is if a user tries to access the term go: <dig> given its term  and ontology  accessions, only a single version specific to ols  will be returned.
the following features were implemented directly in ontocat as the underlying ontology resources did not support them, and we had use cases for these.
• neither the ols client nor owl api provide getsynonyms(), getdefinitions (), getallparents(), getallchildren(), and getallterms() methods natively; these were implemented using available meta data.
the functionality of searching annotations across the whole repository does not exist in ols either and cannot easily be emulated.
a warning is issued whenever a user attempts this.
• the owl api does not support search methods natively.
these were implemented to provide the full functionality of searching properties and non exact matching.
for example, a search for 'thymus' with search options: non exact, not including properties involves iterating through all the classes' labels in an ontology to verify which label contains the specified keyword.
a class label is defined in this context in order of preference and availability as a user-specified property, rdfs:label, skos:preflabel, or a fragment of the class uri.
only in-memory caching of ontology terms is performed, and the whole cache is searched when a query is issued.
we have not observed scalability issues on the local level when using ontologies up to  <dig> terms that would warrant building an index to aid the queries.
however, users could potentially employ ontocat as a means of populating an external index, e.g.
lucene-based http://lucene.apache.org, which we also did to enable query expansion in our molgenis database.
the in-memory cache is used to access owl classes by their accessions as a convenience method for bypassing the owl api requirement for fetching a class by its full uri.
it is in theory potentially unsafe and could lead to collisions, i.e., owl format allows for two classes to share the accession providing they are in different namespaces and in such a case one of the terms would be discarded.
in practice this is unlikely to happen as most ontologies use globally unique term identifiers and this shortcut makes the interface easier to work with and to understand for consumers of obo ontologies, where the usage of uris is not as widespread.
a disadvantage of using web services over local access is that they are slower.
it could be argued that providing an extra layer of abstraction would slow them down even further.
however, in our tests ontocat only adds on average 9% overhead to a bioportal query and less than 1% to an ols query when compared to using the underlying source apis directly.
an ontocat term search takes on average  <dig> ms in bioportal and  <dig> ms in ols.
these timings include the additional overhead ontocat imposes on the repository services  <dig> ms ±  <dig> ms for bioportal and less than  <dig> ms for ols.
moreover, with ontocat the queries can be easily parallelised, intermediate results cached or even whole ontologies downloaded from bioportal for local querying, which results in orders of magnitude efficiency improvements that eclipse these minimal adverse overhead issues.
furthermore, use of both web services provides some redundancy in case of service dropout.
to generate these results a list of  <dig> random  <dig> character long alphanumeric strings was created.
random strings were used in order to prevent the repository from returning a previously cached result and to bypass the internal caching.
these were then all used as a search keyword to query bioportal and ols.
the standard high precision system timer was used to time each query and all the results were then averaged and corrected for average roundtrip time  to give the final figures.
complete code is available in the serviceprofiler class.
please note that this cannot be considered a valid comparison of responsiveness of the two repositories, as the tests have not been performed across all the services and over extended period of time, but rather it is given here as a means of estimating expected ontocat's performance.
ontocat can handle arbitrary large ontologies, as long as owl api has enough dedicated heap space available to parse them.
for example, fma  can be loaded with as little as 2gb of memory dedicated to the java virtual machine , which is not unreasonable to expect from a modern laptop, and even less so on an academic cluster.
if there is not enough memory available ontocat internally will catch the outofmemoryerror exception on ontology loading and will inform the user which jvm settings have to be adjusted.
future work
the current repertoire of supported ontology resources could easily be extended when new resources become available and appropriate use cases are identified.
such services would only need to implement the ontologyservice interface to immediately become aligned with pre-existing resources and allow for their seamless interchangeability.
for example, we envision the creation of a dedicated sparql wrapper to allow for integration with rdf triplestores.
it is also possible to extend the functionality of an individual resource separately without impeding the core functionality.
example  <dig> in the online documentation demonstrates searching of a sub-tree of an ontology, which is possible using the bioportalontologyservice object directly, but was not promoted to the main ontologyservice interface, as this functionality remains specific to bioportal.
this particular feature was implemented when requested by a user, and further extensions could be made in a similar fashion.
CONCLUSIONS
ontocat is a comprehensive software package that allows bioinformaticians to uniformly access ontology terms from diverse public repositories and private file sources using simple java, r and rest web service commands.
ontocat is used in a growing list of applications including the experimental factor ontology  <cit>  development, the extensible genotype and phenotype data platform, xgap  <cit> , the zooma annotation tool http://zooma.sf.net and the arrayexpress  <cit>  and gene expression atlas  <cit>  annotation systems.
availability and requirements
project name: ontocat
home page: http://www.ontocat.org
operating system: platform independent
programming language: java6
license: lgplv3
authors' contributions
ta and ms both contributed equally to the conception and design of ontocat and this manuscript.
hp participated in the design of ontocat and helped to draft the manuscript.
tb provided code review and some of the requirements.
nk contributed to the development of the ontocat java api.
nk and mk developed the ontocat bioconductor/r package.
da developed the rest interface and html search widget.
jv created the ontology manager and browser extension for molgenis database.
na conceived the ranking and caching layer and participated in its implementation.
tb, nk, jv, na, da and mk provided testing of ontocat and contributed to the manuscript.
all authors read and approved the final manuscript.

 ontologies are increasingly used to annotate life science data, to improve search and integration, and to model complex biological knowledge unambiguously. by definition, an ontology is a specification of a representational vocabulary for a shared domain of discourse - definitions of classes, relations, functions, and other objects or in short it is an explicit specification of a conceptualisation. for example, the disease ontology and the nci thesaurus are both examples of ontologies in the disease domain and cancer and malignant neoplasm are examples of equivalent concepts therein. when used this allows for unambiguous attribution of a particular experimental condition or sample characteristic. in recent years the obo foundry community has succeeded in creating a valuable catalogue of orthogonal, cross-linked ontologies for life sciences, of which the gene ontology for integration of gene annotations is a well known example. however, there is still a considerable overlap especially in the areas of anatomy and disease, requiring much querying and integration when using ontologies in practice. for the purpose of this article, ontology querying and integration is defined as integration of ontologies into software applications and the practical use of ontologies to annotate real data. this clarification is necessary as ontology integration can also be understood as the integration of ontologies when building new ontologies by reusing other ontologies, or integration of ontologies by merging different ontologies into a single one that unifies them. bioinformaticians integrating public domain ontologies into their work face the following issues: there are no standardised identifying features that characterise ontologies from the user's perspective; individual ontology resources do not follow the same logical organisation; to search for appropriate ontologies requires expert knowledge; and programmatic ontology search is challenging. a www ontology broker has been proposed to solve some of the issues. this was predated by an important effort in the biomedical domain, namely the unified medical language system, which encompasses a number of controlled vocabularies critical for the biomedical sciences and is still in active use for more than twenty years since its conception in. there are now two major ontology repositories available: the ebi ontology lookup service and the ncbo bioportal. although there is some overlap in content between them; some ontologies are only available in one repository so potentially both have to be queried to access all available ontologies. for example, disease ontology is available in both repositories, but nci thesaurus is not available in ols, and pride controlled vocabulary does not exist in bioportal. table highlights a case where both ols and bioportal serve the same ontology, but differ in features such as accessions, versions, or number of terms available. moreover, many users also develop local ontologies for internal use, which are proprietary and cannot be published online, or are still in development and not suitable for public consumption. those ontologies are often developed in obo or owl. the fma ontology as shown here differs substantially in availability and structure between the two repositories. it has been postulated that manual annotation is no longer sufficient to keep up with the current rate that new data are generated in the biomedical domain. the field is undergoing rapid evolution, with the first generation of ontology development tools gaining wide adoption. most notable examples in this area include protégé, obo-edit, and owl api. our experience is that building services to seamlessly access all these public repositories and local ontologies involves considerable effort, because these resources are still evolving or have rather advanced and heterogeneous programming structures. a new generation of tools geared more towards bioinformaticians is needed, with the focus on flattening the learning curve and making common tasks simpler. here we report the development of the software library for common ontology api tasks that can be easily used from java programs, bioconductor/r and restful web services clients. development as an open source community effort has helped to alleviate the challenges of accessing a fast evolving landscape of ontology resources and has already enabled large scale ontology integration in the experimental factor ontology, arrayexpress, molgenis/xgap and gen2phen http://www.gen2phen.org use cases. implementation ontocat is an application suite that combines access to a large number of terms via a java package, a rest interface, and an r interface, all available under the permissive lgplv or apache licenses for anyone to use and extend. the ontocat java package provides a generic ontologyservice interface to query ontology sources. a code example is also provided in figure ontocat provides simple and easy-to-use api for bioportal and ols web services, and the owl api. table illustrates how the common interface maps to respective functionalities in supported resources. obo ontologies are translated by owl api into valid owl by a dedicated obo parser. this process results in a lossless version of the obo ontology in owl, as in terms of content obo format can be considered a subset of owl. in particular, synonyms and definitions are loaded into synonym and def owl annotations respectively and are then available as synonyms and definitions in ontocat. http://rest.bioontology.org/bioportal/ Δ.getontologyloaddate()?query=url-encoded_query &sexactmatch= &includeproperties= &maxnumhits = 10000000 1).gettermsbyexactname 2).gettermsbyname 3).gettermsbyannotationdata,.getannotationstringvalue()?query = url-encoded query &isexactmatch= &includeproperties= &maxnumhits = 10000000 &email=email_address?conceptid=url-encoded termaccession./search/?query=url-encoded_termaccession getrootterms() &pagenum=pagenum?conceptid = root &email=email_address owlclass.getsuperclasses() Δ search defaults to non-exact matching and excludes properties, but this can be overridden by user with specific search options. the Δ symbol signifies that some additional processing is performed on the original output of the underlying service to integrate the results with the ontocat's ontologyservice interface. for example, in the case of obo synonyms the appropriate property is found among the term's metadata and the additional context information is removed before the values are returned. eager fetching means that when the underlying service returns only partial results, e.g. bioportal's rootpath only provides term accessions, an additional query is issued to fully populate the result set. all hierarchy algorithms where noted are called in a non-recursive way to avoid memory issues for traversing large graphs in a recursive manner. web applications can connect using rest or soap services as shown in figure and demonstrated in the online documentation via a simple html search widget. researchers using r statistics can connect using the bioconductor/r ontocat package. documentation is available at http://www.ontocat.org including programming examples and a complete javadoc. simple demo applications showing ontocat for ontology searches with google web toolkit on the google app engine framework and the molgenis platform are available at http://ontocat-web.appspot.com and http://www.ontocat.org/wiki/ontocatdownload. the java api exposes the results as java objects or java primitives, the r package returns r objects, and the rest interface returns xml or json. the basic ontologyservice interface is further enhanced by a number of easy to use decorators, which extend the primary functionality of the underlying resources to add caching, allow integrated searches across multiple ontology services or perform more specialised tasks like translation and sorting: cachedservicedecorator adds two caching layers to every request relayed through the decorator. all requests test the first cache with a hours expiry first. if no record is found the request is passed through to the original provider. if the original provider query fails the results are returned from the eternal cache. this provides a fallback mechanism if an ontology resource becomes temporarily unavailable, e.g. due to maintenance downtime. compositedecorator allows searching across multiple ontology resources using a single ontologyservice interface, effectively establishing another meta layer of abstraction. all underlying resources encompassing different repositories and local files are therefore available from a single access point. an example is provided in figure and in the online documentation. this service is multithreaded and requests are simultaneously sent off to all the underlying resources. as in r the java code cannot be multithreaded a dedicated implementation exists in compositeservicenothreads. sortedsubsetdecorator adds sorting and subsetting capabilities to any search in the underlying service. this allows the prioritization and ranking of terms when searching over a specific selection of ontologies. the service is instantiated with a list of ontology accessions indicating suggested priority of use. all searches performed with the decorated ontologyservice will be truncated to only include the results from this initial list of ontologies, and ranked in the original order the ontologies were specified. translatedontologyservice allows the mapping of term accessions from one local identifier namespace to a different one, e.g. between bioportal and ols schemas as shown in table this facilitates combining different ontologies under a single schema and resolves format inconsistencies, e.g. owl ncbitaxon_ versus obo ncbitaxon: behind the scenes an ontologyidtranslator encapsulates a set of user defined ontologyidmappings. each mapping consists of a regular expression that uniquely identifies a term as belonging to a particular ontology, and another regular expression to translate the term accessions and ontology accessions into the required format. respective example code snippets are provided in the online documentation http://www.ontocat.org/wiki/ontocatguide. use of the decorator design pattern allows other ontology users to quickly extend ontocat, implementing additional functionality such as custom search filters.  ontocat has proven a valuable toolbox to search and integrate ontologies from heterogeneous sources on a large scale. example use cases of ontocat for integrating ontologies with data include: harmonising and promoting consistency in data annotations, facilitating automated annotations, inferring additional information based on the knowledge conceptualisation, supporting complex user queries and user interfaces, nonsense detection and integrating external data. we report successful applications in the following real world scenarios: use case: updating ontology properties the experimental factor ontology is an application focused ontology modelling the experimental factors in functional genomics experiments available from the ebi databases arrayexpress and the gene expression atlas. the development of efo involves construction of mappings to multiple existing domain specific ontologies, such as the disease ontology and cell type ontology. this is achieved using a combination of automated downloads of relevant ontology terms using ontocat. periodically all the established cross-references in efo to external ontologies have to be re-evaluated against bioportal in order to detect changes in source ontologies in addition to importing new and extra annotations such as new synonyms and external definitions for efo terms. multithreading the ontocat requests allows our annotators to process and import extra information from over external ontology terms in less than minutes. legacy obo-like term accessions proved to be the biggest challenge, as they are not directly resolvable through bioportal. for this reason custom implementations of the translatedontologyservice and ontologyidtranslator classes were created saving great amounts of manual annotation and checking, and are available in the uk.ac.ebi.efo.bioportal package. use case: annotating user supplied experimental values with ontology terms the arrayexpress archive and the gene expression atlas together contain over one million unique experiment annotations. these are all annotated with ontology terms from the ebi's pre-release version of the application ontology efo, and where they do not exist in efo they have to be checked against publicly available ontologies. this previously manual process has now been automated using the zooma http://zooma.sf.net application, which extracts a list of unmapped terms from the source database and queries the local efo pre-release owl file and existing mapped data inside local databases. it returns perfect matches as automatic mappings, and also launches queries at bioportal and ols for unmapped terms. if several mappings to efo are possible, these experiment annotations are flagged as requiring curation and periodically mapped by a member of the atlas curation team. if no mappings to efo were present, but possible mappings were acquired from other ontologies, then these are flagged as new suggestions and used in the development of efo. use case: local ontology management ontocat has also been applied using the molgenis software, and in particular on the extensible genotype and phenotype data platform, xgap. a user interface for ontology term search and management has been deployed as part of molgenis code generation software and is used in xgap and other models to allow users to search publically available ontologies and download terms to unambiguously annotate their experimental genotype, qtl or gwas data http://www.xgap.org. in addition a small html search widget can be used by bioinformaticians to add ontocat search and term selection anywhere in their web applications. here the user is provided with a'search' box where they can type in keywords and then a selection of matching candidate terms is loaded from ols, bioportal, owl or obo files for the user to choose from. working examples of both systems are provided in the online documentation http://www.ontocat.org/wiki/ontocatguide. use case: data analysis ontologies are used in data analysis as well as for annotation purposes and a new bioconductor package ontocat http://www.ontocat.org/wiki/r is now available to read in and query owl/obo format ontologies into r for use in downstream analyses. the ontocat package was released in bioconductor and comes with built-in offline support for efo and also supports online bioportal and ols ontology queries. discussion simplicity and ease of use ontocat was designed to make common use cases easy to implement while still enabling implementation of advanced algorithms. many of such common tasks are demonstrated in code examples that are provided in the online documentation http://www.ontocat.org/wiki/ontocatguide. ontocat was developed as a common access point for available resources and therefore does not incorporate all of their rich feature sets. new features are added to ontocat only when new use cases demand it and only for cases where the functionality in question is available across all the supported ontology resources or can be in some way emulated. the advantage of this approach is the ontologyservice interface is more stable keeping the api very close to programmer's practice. complexity is represented as a number of public methods available in the respective java api interface or different web services signatures where the former is not available. richness is measured as a number of hits returned from a non exact query for'thymus'. a logarithm of richness and complexity quotient is provided as a single score to judge the relation between the two. it is higher the richer the source and less complex it is to access. to further lower the barrier to practical use we followed the convention over configuration design approach. whenever possible a default behaviour requiring zero configuration can be used by the developer minimizing the number of decisions that are needed to made, while not losing the flexibility of defining custom settings when necessary. this principle is strictly adhered throughout the package, but one notable example is the implementation of the simple knowledge organization system properties. w3c recommends their usage to annotate definitions and synonyms in owl, but few owl ontologies adhere to this. ontocat fully supports skos properties. whenever they are employed in an ontology; label, synonym and definition annotations will be recognised automatically. however, it is still possible to specify custom uri fragments on a per ontology basis when using a local file source. use of synonyms is another common task that has considerable significance in text mining activities. the obo standard for denoting synonyms and definitions is also fully supported without additional configuration. however, extra information available in obo, in the form of cross-references to describe the origins of the synonym, synonym category and scope, are stripped from the results to be consistent with output from other services. the raw values can still be accessed through getannotations() if required. generally speaking ontologies consist of individuals, classes, attributes, and relations. in order to avoid the confusion in the implementation - the word "concept" is avoided altogether in the implementation, and "term" is used instead to denote both individuals and concepts. here an ontology term is defined as a tuple consisting of term accession, term label, and ontology accession that the particular term belongs to. ideally a term accession should be enough to uniquely identify a term thereby rendering term label and ontology accession redundant. however, this is not the case when label is the accession as shown for the fma ontology in bioportal. storing an ontology accession helps to resolve the actual ontology the term belongs to. the label is only recorded for convenience as in most cases it is used for text mining, query support or indexing. in fact, in this case the label forms the fragment of the term uri, but the term cannot be retrieved solely by its uri as the rest query additionally requires the bioportal-assigned ontology accession. in theory a uri should be enough to uniquely identify an ontology term across all services solving the complex issue of integrating data annotated using different ontology resources and in the semantic web applications; wide adoption would render the translatedontologyservice unnecessary. in bioportal it is already possible to use uris in place of the short term accessions, however at present terms cannot be retrieved solely by their uris as the rest interface requires the bioportal-assigned ontology accession to be provided additionally. while this is a minor issue that is likely to be resolved in the future, there are a number of other factors preventing wide adoption of resource identifiers. although owl ontologies fully support term uris already, obo format provides only rudimentary support. obo community is in the process of embracing persistent uniform resource locators to encode namespaces and this issue is likely to be mitigated in the future. however, while all purls are uris, not all uris are purls, in particular uris are not limited to http protocol. to add to the confusion owl specification replaced uris with internationalized resource identifier, which potentially are not backward compatible with uris. ideally, a consensus is also required in whether and how to report the ontology version within the uri and there is also the issue of uri stability between versions, e.g.: • fma - http://sig.uw.edu/fma#anatomical_entity • fma - http://sig.biostr.washington.edu/fma #anatomical_entity • fma - http://bioontology.org/projects/ontologies/fma/fma20owldlcomponent#anatomical_entity common functionality and integration no term-level versioning information is stored at present as we have no use cases where this would be particularly useful. this information is only available through bioportal, no such feature exists in ols, and there are no standards to code against to identify versions in owl. a common practice in the community is that any substantial change to a term is recorded by assigning a new term accession and obsoleting the original one. it is not strictly defined what makes a change substantial, e.g. debatable whether changing a class' position in ontology hierarchy warrants a new accession. alternatively, term annotations could be used as a proxy for detecting changes. a version clash could be detected where a single annotation changes between two retrievals of the same ontology term. bioportal exclusively provides access to previous versions of ontologies, however their feature set is limited compared to the most recent versions, i.e., hierarchy and search services are not available. for example, for ontologies following a daily release cycle it is impractical to reindex them so often. however, since bioportal stores all the ontologies that were ever processed in a downloadable format, it is possible to use this facility by passing any of the version links provided in the bioportal's ontology summary view into the ontocat's fileontologyservice. this allows working with a specific version of the ontology, not necessarily the latest one, including hierarchy and search functionalities. it is particularly useful in ontology development process for regression testing. example in the online documentation shows how two different versions of efo can be compared in such a way. replicas of ontologies, i.e., the same ontology present in both repositories, are treated as different ontologies as they have different ontology accessions. bioportal assigns unique numeric identifiers, whereas ols uses the abbreviation of the ontology name. these ontology accessions cannot be resolved against each other automatically and in practice this should not be attempted due to differences shown in table in fact, not a single ontology between bioportal and ols shares the same ontology accession thus a manual mapping is required. example in the online documentation demonstrates how one ontology namespace could be translated into another using the aforementioned translatedontologyservice and the two replicas integrated. when searching across both the repositories combined it is also possible to ignore one of the copies selectively with the sortedsubsetdecorator. due to significant differences in the same ontology between the sources as demonstrated in table integrating the results is not recommended in practice. nevertheless, replication is handled gracefully without additional overhead because of the unique ontology accessions. that is if a user tries to access the term go: given its term and ontology accessions, only a single version specific to ols will be returned. the following features were implemented directly in ontocat as the underlying ontology resources did not support them, and we had use cases for these. • neither the ols client nor owl api provide getsynonyms(), getdefinitions (), getallparents(), getallchildren(), and getallterms() methods natively; these were implemented using available meta data. the functionality of searching annotations across the whole repository does not exist in ols either and cannot easily be emulated. a warning is issued whenever a user attempts this. • the owl api does not support search methods natively. these were implemented to provide the full functionality of searching properties and non exact matching. for example, a search for'thymus' with search options: non exact, not including properties involves iterating through all the classes' labels in an ontology to verify which label contains the specified keyword. a class label is defined in this context in order of preference and availability as a user-specified property, rdfs:label, skos:preflabel, or a fragment of the class uri. only in-memory caching of ontology terms is performed, and the whole cache is searched when a query is issued. we have not observed scalability issues on the local level when using ontologies up to terms that would warrant building an index to aid the queries. however, users could potentially employ ontocat as a means of populating an external index, e.g. lucene-based http://lucene.apache.org, which we also did to enable query expansion in our molgenis database. the in-memory cache is used to access owl classes by their accessions as a convenience method for bypassing the owl api requirement for fetching a class by its full uri. it is in theory potentially unsafe and could lead to collisions, i.e., owl format allows for two classes to share the accession providing they are in different namespaces and in such a case one of the terms would be discarded. in practice this is unlikely to happen as most ontologies use globally unique term identifiers and this shortcut makes the interface easier to work with and to understand for consumers of obo ontologies, where the usage of uris is not as widespread. a disadvantage of using web services over local access is that they are slower. it could be argued that providing an extra layer of abstraction would slow them down even further. however, in our tests ontocat only adds on average 9% overhead to a bioportal query and less than 1% to an ols query when compared to using the underlying source apis directly. an ontocat term search takes on average ms in bioportal and ms in ols. these timings include the additional overhead ontocat imposes on the repository services ms ± ms for bioportal and less than ms for ols. moreover, with ontocat the queries can be easily parallelised, intermediate results cached or even whole ontologies downloaded from bioportal for local querying, which results in orders of magnitude efficiency improvements that eclipse these minimal adverse overhead issues. furthermore, use of both web services provides some redundancy in case of service dropout. to generate these results a list of random character long alphanumeric strings was created. random strings were used in order to prevent the repository from returning a previously cached result and to bypass the internal caching. these were then all used as a search keyword to query bioportal and ols. the standard high precision system timer was used to time each query and all the results were then averaged and corrected for average roundtrip time to give the final figures. complete code is available in the serviceprofiler class. please note that this cannot be considered a valid comparison of responsiveness of the two repositories, as the tests have not been performed across all the services and over extended period of time, but rather it is given here as a means of estimating expected ontocat's performance. ontocat can handle arbitrary large ontologies, as long as owl api has enough dedicated heap space available to parse them. for example, fma can be loaded with as little as 2gb of memory dedicated to the java virtual machine, which is not unreasonable to expect from a modern laptop, and even less so on an academic cluster. if there is not enough memory available ontocat internally will catch the outofmemoryerror exception on ontology loading and will inform the user which jvm settings have to be adjusted. future work the current repertoire of supported ontology resources could easily be extended when new resources become available and appropriate use cases are identified. such services would only need to implement the ontologyservice interface to immediately become aligned with pre-existing resources and allow for their seamless interchangeability. for example, we envision the creation of a dedicated sparql wrapper to allow for integration with rdf triplestores. it is also possible to extend the functionality of an individual resource separately without impeding the core functionality. example in the online documentation demonstrates searching of a sub-tree of an ontology, which is possible using the bioportalontologyservice object directly, but was not promoted to the main ontologyservice interface, as this functionality remains specific to bioportal. this particular feature was implemented when requested by a user, and further extensions could be made in a similar fashion.  ontocat is a comprehensive software package that allows bioinformaticians to uniformly access ontology terms from diverse public repositories and private file sources using simple java, r and rest web service commands. ontocat is used in a growing list of applications including the experimental factor ontology development, the extensible genotype and phenotype data platform, xgap, the zooma annotation tool http://zooma.sf.net and the arrayexpress and gene expression atlas annotation systems. availability and requirements project name: ontocat home page: http://www.ontocat.org operating system: platform independent programming language: java6 license: lgplv3 authors' contributions ta and ms both contributed equally to the conception and design of ontocat and this manuscript. hp participated in the design of ontocat and helped to draft the manuscript. tb provided code review and some of the requirements. nk contributed to the development of the ontocat java api. nk and mk developed the ontocat bioconductor/r package. da developed the rest interface and html search widget. jv created the ontology manager and browser extension for molgenis database. na conceived the ranking and caching layer and participated in its implementation. tb, nk, jv, na, da and mk provided testing of ontocat and contributed to the manuscript. all authors read and approved the final manuscript. 
each resource is wrapped behind easy to learn java, bioconductor/r and rest web service commands enabling reuse and integration of ontology software efforts despite variation in technologies. ontocat provides a seamless programming interface to query heterogeneous ontology resources including ols and bioportal, as well as user-specified local owl and obo files. ontocat provides a robust, configurable solution for accessing ontology terms specified locally and from remote services, is available as a stand-alone tool and has been tested thoroughly in the arrayexpress, molgenis, efo and gen2phen phenotype use cases.
 ontologies have become an essential asset in the bioinformatics toolbox and a number of ontology access resources are now available, for example, the ebi ontology lookup service and the ncbo bioportal. however, these resources differ substantially in mode, ease of access, and ontology content. this makes it relatively difficult to access each ontology source separately, map their contents to research data, and much of this effort is being replicated across different research groups.  ontocat provides a seamless programming interface to query heterogeneous ontology resources including ols and bioportal, as well as user-specified local owl and obo files. each resource is wrapped behind easy to learn java, bioconductor/r and rest web service commands enabling reuse and integration of ontology software efforts despite variation in technologies. it is also available as a stand-alone molgenis database and a google app engine application.  ontocat provides a robust, configurable solution for accessing ontology terms specified locally and from remote services, is available as a stand-alone tool and has been tested thoroughly in the arrayexpress, molgenis, efo and gen2phen phenotype use cases. availability http://www.ontocat.org 