Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 1147 fix cv duplication in template json import #2104

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",
kdp-cloud marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading