-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #482 from dgidb/dataset-version
Add support for GA4GH service info query
- Loading branch information
Showing
8 changed files
with
142 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,10 @@ export const Contact = () => { | |
<div className="contact-section-container doc-section"> | ||
<div> | ||
<p> | ||
DGIdb was developed at The McDonnell Genome Institute, Washington | ||
University School of Medicine. If you have a source of information | ||
related to the druggable genome you would like us to incorporate, | ||
please contact us at{' '} | ||
DGIdb was initially developed at The McDonnell Genome Institute, | ||
Washington University School of Medicine. If you have a source of | ||
information related to the druggable genome you would like us to | ||
incorporate, please contact us at{' '} | ||
<Link href="mailto:[email protected]">[email protected].</Link> | ||
</p> | ||
<p> | ||
|
@@ -24,12 +24,8 @@ export const Contact = () => { | |
|
||
<div className="left-section"> | ||
<h4> | ||
<Link | ||
href="http://genome.wustl.edu/" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
The McDonnell Genome Institute | ||
<Link href="https://griffithlab.org" target="_blank" rel="noreferrer"> | ||
The Griffith Laboratory | ||
</Link> | ||
</h4> | ||
<p>Washington University</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
module Types | ||
class MetaType < Types::BaseObject | ||
field :id, String, null: false, description: 'Unique identifier for service.' | ||
field :data_version, String, null: false, description: 'Version of the data being served by DGIdb' | ||
field :name, String, null: false, description: 'Human readable name of the service' | ||
field :type, Types::ServiceType, null: false | ||
field :description, String, null: false | ||
field :organization, Types::OrganizationType, null: false | ||
field :contact_url, String, null: false, description: 'URL of the contact for the provider of this service' | ||
field :documentation_url, String, null: false, description: 'URL of the documentation of this service' | ||
field :created_at, GraphQL::Types::ISO8601DateTime, null: false, description: 'Timestamp describing when the service was first deployed and available' | ||
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false, description: 'Timestamp describing when the service was last updated' | ||
field :environment, String, null: false, description: 'Environment the service is running in' | ||
field :version, String, null: false, description: 'Version of the service being described' | ||
|
||
def id | ||
'org.dgidb.graphql' | ||
end | ||
|
||
def data_version | ||
DATA_VERSION | ||
end | ||
|
||
def name | ||
'DGIdb' | ||
end | ||
|
||
def type | ||
{} | ||
end | ||
|
||
def description | ||
"An open-source search engine for drug-gene interactions and the druggable genome." | ||
end | ||
|
||
def organization | ||
{} | ||
end | ||
|
||
def contact_url | ||
"mailto:[email protected]" | ||
end | ||
|
||
def documentation_url | ||
'https://dgidb.org/api/graphiql' | ||
end | ||
|
||
def created_at | ||
#version 5.0.0 initial release on GitHub | ||
DateTime.parse("October 20, 2023 8:51 AM CDT") | ||
end | ||
|
||
def updated_at | ||
DateTime.parse(github_release&.dig("published_at")) | ||
end | ||
|
||
def environment | ||
Rails.env | ||
end | ||
|
||
def version | ||
github_release&.dig("tag_name") | ||
end | ||
|
||
private | ||
def github_release | ||
@rel ||= GithubRelease.current | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Types | ||
class OrganizationType < Types::BaseObject | ||
field :name, String, null: false, description: 'Name of the organization responsible for the service' | ||
field :url, String, null: false, description: 'URL of the website of the organization' | ||
|
||
def name | ||
'Wagner and Griffith laboratories' | ||
end | ||
|
||
def url | ||
'https://dgidb.org/about#contact' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Types | ||
class ServiceType < Types::BaseObject | ||
field :group, String, null: false, description: 'Namespace in reverse domain name format.' | ||
field :artifact, String, null: false, description: 'Name of the API or GA4GH specification implemented.' | ||
field :version, String, null: false, description: 'API Version (semantic)' | ||
|
||
def group | ||
'org.dgidb' | ||
end | ||
|
||
def artifact | ||
'DGIdb GraphQL' | ||
end | ||
|
||
def version | ||
GithubRelease.current&.dig("tag_name") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class GithubRelease | ||
def self.current | ||
Rails.cache.fetch("current_github_release", expires_in: 12.hours) do | ||
fetch_release | ||
end | ||
end | ||
|
||
private | ||
def self.fetch_release | ||
uri = URI.parse('https://api.github.com/repos/dgidb/dgidb-v5/releases?per_page=1') | ||
resp = Net::HTTP.get_response(uri) | ||
if resp.code == '200' | ||
JSON.parse(resp.body).first | ||
else | ||
nil | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
file = File.join(Rails.root, 'data_version.yml') | ||
data = YAML.load_file(file) | ||
|
||
DATA_VERSION = data.dig('version') | ||
|
||
if DATA_VERSION.nil? | ||
raise StandardError.new("Missing or malformed data_version.yml. Expect file at Rails.root with a version: key") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: Dec-2023 |