Skip to content

Commit

Permalink
Merge branch 'seek-1.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Jan 13, 2025
2 parents 5870543 + cd05bbf commit 9c9a943
Show file tree
Hide file tree
Showing 9 changed files with 550 additions and 292 deletions.
2 changes: 1 addition & 1 deletion app/controllers/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def populate_template

begin
running!
PopulateTemplatesJob.new.queue_job
PopulateTemplatesJob.perform_later(@current_user)
rescue StandardError
done!
end
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/populate_templates_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
class PopulateTemplatesJob < ApplicationJob
queue_with_priority 1
queue_as QueueNames::TEMPLATES
def perform
def perform(user)
return unless Seek::Config.isa_json_compliance_enabled

Seek::IsaTemplates::TemplateExtractor.extract_templates
Seek::IsaTemplates::TemplateExtractor.extract_templates(user)
end
end
248 changes: 138 additions & 110 deletions lib/seek/isa_templates/template_attributes_schema.json
Original file line number Diff line number Diff line change
@@ -1,112 +1,140 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "ISA tempalte attribute schema",
"description": "JSON-schema representing an ISA template attribute in DataHub",
"type": "object",
"properties": {
"iri": {
"anyOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "null"
}
]
},
"name": { "type": "string" },
"description": { "type": "string" },
"required": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"ontology": {
"anyOf": [
{
"type": "object",
"properties": {
"name": { "type": "string" },
"version": {
"anyOf": [{ "type": "string" }, { "type": "number" }]
},
"description": { "type": "string" },
"rootTermURI": { "type": "string", "format": "uri" }
}
},
{
"type": "null"
}
]
},
"dataType": {
"type": "string",
"enum": [
"Date time",
"Date",
"Real number",
"Integer",
"Web link",
"Email address",
"Text",
"String",
"Boolean",
"Registered Sample",
"Registered Sample List",
"Controlled Vocabulary",
"URI",
"Registered Data file",
"ENA custom date"
]
},
"CVList": {
"anyOf": [
{
"type": "array"
},
{
"type": "null"
}
]
},
"isaTag": {
"anyOf": [
{
"type": "string",
"enum": [
"source",
"sample",
"protocol",
"source_characteristic",
"sample_characteristic",
"other_material",
"other_material_characteristic",
"data_file",
"data_file_comment",
"parameter_value"
]
},
{
"type": "null"
}
]
},
"title": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
"$schema": "http://json-schema.org/draft-04/schema",
"title": "ISA tempalte attribute schema",
"description": "JSON-schema representing an ISA template attribute in DataHub",
"type": "object",
"properties": {
"iri": {
"anyOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "null"
}
]
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"required": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"ontology": {
"anyOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"description": {
"type": "string"
},
"rootTermURI": {
"type": "string",
"format": "uri"
}
}
},
{
"type": "null"
}
]
},
"dataType": {
"type": "string",
"enum": [
"Date time",
"Date",
"Real number",
"Integer",
"Web link",
"Email address",
"Text",
"String",
"Boolean",
"Registered Sample",
"Registered Sample List",
"Controlled Vocabulary",
"URI",
"Registered Data file",
"ENA custom date"
]
},
"allowCVFreeText": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"CVList": {
"anyOf": [
{
"type": "array"
},
{
"type": "null"
}
]
},
"isaTag": {
"anyOf": [
{
"type": "string",
"enum": [
"source",
"sample",
"protocol",
"source_characteristic",
"sample_characteristic",
"other_material",
"other_material_characteristic",
"data_file",
"data_file_comment",
"parameter_value"
]
},
{
"type": "null"
}
]
},
"title": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
}
Loading

0 comments on commit 9c9a943

Please sign in to comment.