Difference between revisions of "Queries"
Line 5: | Line 5: | ||
In the Phenoscape application, queries are assembled in a Java program and dispatched through a connection to the database, and executed at the database end. For brevity's sake, the Java program is called the client side and the database side is called the backend henceforth. The database has been implemented using the [http://www.postgresql.org/ PostgreSQL] Relational Database Management System (DBMS). | In the Phenoscape application, queries are assembled in a Java program and dispatched through a connection to the database, and executed at the database end. For brevity's sake, the Java program is called the client side and the database side is called the backend henceforth. The database has been implemented using the [http://www.postgresql.org/ PostgreSQL] Relational Database Management System (DBMS). | ||
− | Query execution in PostgreSQL occurs in four sequential steps. In the first step, the query is transferred from the client side over the network to the database. In the second step, the query is parsed and an execution plan is drawn up by the PostgreSQL DBMS to retrieve the data as efficiently as possible in terms of time and memory utilization. In the third step, the DBMS executes the query as per the drawn up execution strategy and retrieves the results. In the last step, the retrieved results are sent back over the connection to the client side. | + | Query execution in PostgreSQL occurs in four sequential steps. In the first step, the query is transferred from the client side over the network to the database. In the second step, the query is parsed and an execution plan is drawn up by the PostgreSQL DBMS to retrieve the data as efficiently as possible in terms of time and memory utilization. In the third step, the DBMS executes the query as per the drawn up execution strategy and retrieves the results. In the last step, the retrieved results are sent back over the connection to the client side. |
==Relations of interest== | ==Relations of interest== | ||
Line 34: | Line 34: | ||
</javascript> | </javascript> | ||
− | == | + | ==Data Services== |
− | + | This section describes the different data service modules, which are part of the ASIH release and the queries that retrieve the data for these services. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Auto-Completion Service=== | ===Auto-Completion Service=== | ||
Line 54: | Line 48: | ||
===Phenotype Data Service=== | ===Phenotype Data Service=== | ||
− | This service retrieves the details of all the phenotype data in the database. Retrieved data may be filtered by taxon, gene, character, anatomical entity, and publication. | + | This service retrieves the details of all the phenotype data in the database. Retrieved data may be filtered by taxon, gene, character, anatomical entity, and publication. The details of the phenotype data include the exhibiting taxon or gene, the quality and entity associated with the phenotype and the character, of which the quality is a value. |
+ | |||
+ | ===Annotation Data Service=== | ||
+ | This service retrieves all the metadata, which is associated with a specific taxon-phenotype assertion. Given the reification identifier of an assertion, the service retrieves the publication, the specific excerpts of the texts the assertions were based upon, and comments (if any) entered by the curators themselves. | ||
[[Category:Informatics]] | [[Category:Informatics]] | ||
[[Category:Database]] | [[Category:Database]] | ||
[[Category:Queries]] | [[Category:Queries]] |
Revision as of 15:40, 21 August 2009
This section describes the queries that have been implemented for the Phenoscape data services, in addition to the execution details of each queries on the PostgreSQL database.
Contents
Summary
In the Phenoscape application, queries are assembled in a Java program and dispatched through a connection to the database, and executed at the database end. For brevity's sake, the Java program is called the client side and the database side is called the backend henceforth. The database has been implemented using the PostgreSQL Relational Database Management System (DBMS).
Query execution in PostgreSQL occurs in four sequential steps. In the first step, the query is transferred from the client side over the network to the database. In the second step, the query is parsed and an execution plan is drawn up by the PostgreSQL DBMS to retrieve the data as efficiently as possible in terms of time and memory utilization. In the third step, the DBMS executes the query as per the drawn up execution strategy and retrieves the results. In the last step, the retrieved results are sent back over the connection to the client side.
Relations of interest
The relations described in this section are of use in finding information about phenotypes, and are therefore leveraged in the implementation of the phenotype summary and details modules of the Phenoscape application.
Post compositions of Entities and Qualities are used to relate taxa (and genes) and phenotypes through the exhibits relation as shown in (1) and (2). <javascript> Taxon exhibits inheres_in(Quality, Entity) -- (1) Gene exhibits inheres_in(Quality, Entity) -- (2) </javascript> In addition, the OBD database also contains information relating post composed phenotypes to both the Quality and the Entity by different relations as shown in (3) and (4) respectively <javascript> inheres_in(Quality, Entity) is_a Quality -- (3) inheres_in(Quality, Entity) inheres_in Entity -- (4) </javascript> Quality is related to Character by the value_for relation as shown in (5) <javascript> Quality value_for Character -- (5) </javascript>
Phenotypes can also be traced back to the publications and datasets they are extracted from as explained below. Phenotype data summaries and details retrieved by the services modules of Phenoscape are filtered by publications as well.
Every dataset is associated with a publication as shown in (6). The list of link statements posited by a dataset can be retrieved by traversing the relation shown in (7) <javascript> DataSet has_publication Publication -- (6) LinkStatement posited_by Dataset -- (7) </javascript>
Data Services
This section describes the different data service modules, which are part of the ASIH release and the queries that retrieve the data for these services.
Auto-Completion Service
This service find matches for terms entered by the user in a search field. Retrieved matches are used as prompts to auto complete the field. Matches for the entered term can be retrieved by the labels on the term ('bon' can match a term with label 'bony' or 'bone' for example), synonyms, and definitions optionally.
Term Info Service
This service finds all the information relevant to a given term, viz. label, synonyms if any, definitions if any, and lists of parent and child terms that are related to this term.
Phenotype Data Summary Service
This service retrieves the summaries of all the phenotype data in the database. Retrieved data may be filtered by taxon, gene, character, anatomical entity, and publication.
Phenotype Data Service
This service retrieves the details of all the phenotype data in the database. Retrieved data may be filtered by taxon, gene, character, anatomical entity, and publication. The details of the phenotype data include the exhibiting taxon or gene, the quality and entity associated with the phenotype and the character, of which the quality is a value.
Annotation Data Service
This service retrieves all the metadata, which is associated with a specific taxon-phenotype assertion. Given the reification identifier of an assertion, the service retrieves the publication, the specific excerpts of the texts the assertions were based upon, and comments (if any) entered by the curators themselves.