labimotion 2.0.3 → 2.1.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/labimotion/apis/generic_dataset_api.rb +20 -3
- data/lib/labimotion/apis/generic_element_api.rb +22 -2
- data/lib/labimotion/apis/generic_klass_api.rb +40 -1
- data/lib/labimotion/apis/labimotion_api.rb +1 -3
- data/lib/labimotion/apis/labimotion_hub_api.rb +10 -83
- data/lib/labimotion/apis/segment_api.rb +5 -3
- data/lib/labimotion/constants.rb +0 -7
- data/lib/labimotion/entities/application_entity.rb +7 -80
- data/lib/labimotion/entities/dataset_entity.rb +8 -3
- data/lib/labimotion/entities/dataset_klass_entity.rb +3 -2
- data/lib/labimotion/entities/element_entity.rb +1 -1
- data/lib/labimotion/entities/element_klass_entity.rb +2 -2
- data/lib/labimotion/entities/element_revision_entity.rb +1 -1
- data/lib/labimotion/entities/eln_element_entity.rb +2 -2
- data/lib/labimotion/entities/generic_klass_entity.rb +8 -9
- data/lib/labimotion/entities/generic_public_entity.rb +5 -3
- data/lib/labimotion/entities/klass_revision_entity.rb +9 -4
- data/lib/labimotion/entities/properties_entity.rb +1 -0
- data/lib/labimotion/entities/segment_entity.rb +5 -2
- data/lib/labimotion/entities/segment_revision_entity.rb +2 -2
- data/lib/labimotion/entities/vocabulary_entity.rb +2 -2
- data/lib/labimotion/helpers/dataset_helpers.rb +6 -4
- data/lib/labimotion/helpers/element_helpers.rb +6 -4
- data/lib/labimotion/helpers/segment_helpers.rb +2 -2
- data/lib/labimotion/libs/data/mapper/Chemwiki.json +2 -2
- data/lib/labimotion/libs/properties_handler.rb +10 -0
- data/lib/labimotion/libs/template_hub.rb +10 -28
- data/lib/labimotion/libs/vocabulary_handler.rb +8 -6
- data/lib/labimotion/models/concerns/datasetable.rb +3 -3
- data/lib/labimotion/models/concerns/generic_klass.rb +16 -0
- data/lib/labimotion/models/concerns/segmentable.rb +44 -7
- data/lib/labimotion/models/dataset_klass.rb +15 -2
- data/lib/labimotion/models/dataset_klasses_revision.rb +1 -4
- data/lib/labimotion/models/element.rb +7 -1
- data/lib/labimotion/models/element_klass.rb +10 -1
- data/lib/labimotion/models/element_klasses_revision.rb +2 -3
- data/lib/labimotion/models/segment_klass.rb +10 -4
- data/lib/labimotion/models/segment_klasses_revision.rb +1 -4
- data/lib/labimotion/version.rb +2 -2
- metadata +5 -7
- data/lib/labimotion/libs/data/layer/StdDataset.json +0 -212
- data/lib/labimotion/models/concerns/klass_revision.rb +0 -23
- data/lib/labimotion/models/template_submission.rb +0 -52
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"layers": {
|
|
3
|
-
"std_general": {
|
|
4
|
-
"wf": false,
|
|
5
|
-
"key": "std_general",
|
|
6
|
-
"std": true,
|
|
7
|
-
"cols": 4,
|
|
8
|
-
"color": "default",
|
|
9
|
-
"label": "Standard General description",
|
|
10
|
-
"style": "panel_generic_heading",
|
|
11
|
-
"fields": [
|
|
12
|
-
{
|
|
13
|
-
"type": "text",
|
|
14
|
-
"field": "title",
|
|
15
|
-
"label": "title",
|
|
16
|
-
"default": "",
|
|
17
|
-
"ontology": {
|
|
18
|
-
"id": "afo:class:http://purl.allotrope.org/ontologies/result#AFR_0001080",
|
|
19
|
-
"iri": "http://purl.allotrope.org/ontologies/result#AFR_0001080",
|
|
20
|
-
"type": "class",
|
|
21
|
-
"label": "title",
|
|
22
|
-
"obo_id": "AFR:0001080",
|
|
23
|
-
"short_form": "AFR_0001080",
|
|
24
|
-
"description": [
|
|
25
|
-
"A title is a prefix or suffix added to a personal name. A title can be a title of honor, that is a title bestowed as an award, a honorary title (academic), that is a recognition of contributions by a non-employee or employee, a hereditary title, that is a title that remains in a family or a job title, that is a designation of a person's position in an organization. [Wikipedia]"
|
|
26
|
-
],
|
|
27
|
-
"ontology_name": "afo",
|
|
28
|
-
"ontology_prefix": "AFO"
|
|
29
|
-
},
|
|
30
|
-
"position": 1,
|
|
31
|
-
"required": false,
|
|
32
|
-
"sub_fields": [],
|
|
33
|
-
"text_sub_fields": []
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"type": "text",
|
|
37
|
-
"field": "data_type",
|
|
38
|
-
"label": "Type of the data ",
|
|
39
|
-
"default": "",
|
|
40
|
-
"readonly": true,
|
|
41
|
-
"position": 2,
|
|
42
|
-
"required": false,
|
|
43
|
-
"sub_fields": [],
|
|
44
|
-
"description": "Ontologies!!!! type of entity",
|
|
45
|
-
"placeholder": "e.g. sample or reaction analysis",
|
|
46
|
-
"text_sub_fields": []
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"type": "text",
|
|
50
|
-
"field": "date",
|
|
51
|
-
"label": "date",
|
|
52
|
-
"default": "",
|
|
53
|
-
"position": 3,
|
|
54
|
-
"required": false,
|
|
55
|
-
"sub_fields": [],
|
|
56
|
-
"text_sub_fields": []
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"type": "text",
|
|
60
|
-
"field": "time",
|
|
61
|
-
"label": "starting time",
|
|
62
|
-
"default": "",
|
|
63
|
-
"position": 4,
|
|
64
|
-
"required": false,
|
|
65
|
-
"sub_fields": [],
|
|
66
|
-
"text_sub_fields": []
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"type": "text",
|
|
70
|
-
"field": "contributor",
|
|
71
|
-
"label": "contributor",
|
|
72
|
-
"default": "",
|
|
73
|
-
"position": 5,
|
|
74
|
-
"required": false,
|
|
75
|
-
"sub_fields": [],
|
|
76
|
-
"description": "",
|
|
77
|
-
"text_sub_fields": []
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"type": "text",
|
|
81
|
-
"field": "creator",
|
|
82
|
-
"label": "creator",
|
|
83
|
-
"default": "",
|
|
84
|
-
"position": 6,
|
|
85
|
-
"required": false,
|
|
86
|
-
"sub_fields": [],
|
|
87
|
-
"description": "the person who upload the analysis",
|
|
88
|
-
"text_sub_fields": []
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"type": "text",
|
|
92
|
-
"field": "operator",
|
|
93
|
-
"label": "operator",
|
|
94
|
-
"default": "",
|
|
95
|
-
"position": 7,
|
|
96
|
-
"required": false,
|
|
97
|
-
"sub_fields": [],
|
|
98
|
-
"text_sub_fields": []
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"type": "text",
|
|
102
|
-
"field": "comments",
|
|
103
|
-
"label": "comments",
|
|
104
|
-
"default": "",
|
|
105
|
-
"position": 8,
|
|
106
|
-
"required": false,
|
|
107
|
-
"sub_fields": [],
|
|
108
|
-
"text_sub_fields": []
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"opid": 8,
|
|
112
|
-
"type": "text",
|
|
113
|
-
"field": "Producer",
|
|
114
|
-
"label": "Producer of the sample",
|
|
115
|
-
"is_voc": true,
|
|
116
|
-
"source": "Segment",
|
|
117
|
-
"default": "",
|
|
118
|
-
"field_id": "Producer",
|
|
119
|
-
"layer_id": "bsi",
|
|
120
|
-
"ontology": {
|
|
121
|
-
"id": "schema:property:https://schema.org/producer",
|
|
122
|
-
"iri": "https://schema.org/producer",
|
|
123
|
-
"type": "property",
|
|
124
|
-
"label": "producer",
|
|
125
|
-
"obo_id": "schema:producer",
|
|
126
|
-
"short_form": "schema_producer",
|
|
127
|
-
"description": [
|
|
128
|
-
"The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.)."
|
|
129
|
-
],
|
|
130
|
-
"ontology_name": "schema",
|
|
131
|
-
"ontology_prefix": "schema"
|
|
132
|
-
},
|
|
133
|
-
"position": 9,
|
|
134
|
-
"source_id": "dce363d5-56d0-4324-9914-0476be999016",
|
|
135
|
-
"identifier": "357b7cd3-ca47-49e0-be47-154d907c2cf5",
|
|
136
|
-
"sub_fields": [],
|
|
137
|
-
"text_sub_fields": []
|
|
138
|
-
}
|
|
139
|
-
],
|
|
140
|
-
"position": -2,
|
|
141
|
-
"condition": "",
|
|
142
|
-
"wf_position": 0
|
|
143
|
-
},
|
|
144
|
-
"std_sample_details": {
|
|
145
|
-
"wf": false,
|
|
146
|
-
"key": "std_sample_details",
|
|
147
|
-
"cols": 3,
|
|
148
|
-
"std": true,
|
|
149
|
-
"color": "none",
|
|
150
|
-
"label": "Standard Sample details",
|
|
151
|
-
"style": "panel_generic_heading",
|
|
152
|
-
"fields": [
|
|
153
|
-
{
|
|
154
|
-
"type": "text",
|
|
155
|
-
"field": "label",
|
|
156
|
-
"label": "label",
|
|
157
|
-
"default": "",
|
|
158
|
-
"position": 1,
|
|
159
|
-
"required": false,
|
|
160
|
-
"sub_fields": [],
|
|
161
|
-
"text_sub_fields": []
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"type": "text",
|
|
165
|
-
"field": "id",
|
|
166
|
-
"label": "id",
|
|
167
|
-
"default": "",
|
|
168
|
-
"position": 2,
|
|
169
|
-
"required": false,
|
|
170
|
-
"sub_fields": [],
|
|
171
|
-
"text_sub_fields": []
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"type": "text",
|
|
175
|
-
"field": "amount",
|
|
176
|
-
"label": "amount",
|
|
177
|
-
"default": "",
|
|
178
|
-
"position": 3,
|
|
179
|
-
"required": false,
|
|
180
|
-
"sub_fields": [],
|
|
181
|
-
"text_sub_fields": []
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"type": "text",
|
|
185
|
-
"field": "volume",
|
|
186
|
-
"label": "volume",
|
|
187
|
-
"default": "",
|
|
188
|
-
"position": 4,
|
|
189
|
-
"required": false,
|
|
190
|
-
"sub_fields": [],
|
|
191
|
-
"text_sub_fields": []
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"type": "text",
|
|
195
|
-
"field": "size",
|
|
196
|
-
"label": "size",
|
|
197
|
-
"default": "",
|
|
198
|
-
"position": 5,
|
|
199
|
-
"required": false,
|
|
200
|
-
"sub_fields": [],
|
|
201
|
-
"text_sub_fields": []
|
|
202
|
-
}
|
|
203
|
-
],
|
|
204
|
-
"position": -1,
|
|
205
|
-
"timeRecord": "",
|
|
206
|
-
"wf_position": 0
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
"version": "0.1",
|
|
210
|
-
"select_options": {
|
|
211
|
-
}
|
|
212
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Labimotion
|
|
4
|
-
# Shared concern for all Klass Revision models
|
|
5
|
-
# Provides a unified interface to access the parent klass object
|
|
6
|
-
module KlassRevision
|
|
7
|
-
extend ActiveSupport::Concern
|
|
8
|
-
|
|
9
|
-
# Returns the associated klass object (ElementKlass, SegmentKlass, or DatasetKlass)
|
|
10
|
-
def klass
|
|
11
|
-
return element_klass if respond_to?(:element_klass)
|
|
12
|
-
return segment_klass if respond_to?(:segment_klass)
|
|
13
|
-
return dataset_klass if respond_to?(:dataset_klass)
|
|
14
|
-
|
|
15
|
-
nil
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Increments the submitted counter and saves the record
|
|
19
|
-
def increment_submitted!
|
|
20
|
-
increment!(:submitted)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# == Schema Information
|
|
4
|
-
#
|
|
5
|
-
# Table name: template_submissions
|
|
6
|
-
#
|
|
7
|
-
# id :bigint not null, primary key
|
|
8
|
-
# template_klass :string not null
|
|
9
|
-
# template :jsonb not null, default: {}
|
|
10
|
-
# metadata :jsonb not null, default: {}
|
|
11
|
-
# origin :string not null
|
|
12
|
-
# state :integer not null, default: 0
|
|
13
|
-
# created_at :datetime not null
|
|
14
|
-
# updated_at :datetime
|
|
15
|
-
# deleted_at :datetime
|
|
16
|
-
#
|
|
17
|
-
# Indexes
|
|
18
|
-
#
|
|
19
|
-
# idx_template_submissions_template (template) USING gin
|
|
20
|
-
# idx_template_submissions_metadata (metadata) USING gin
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
module Labimotion
|
|
24
|
-
class TemplateSubmission < ApplicationRecord
|
|
25
|
-
acts_as_paranoid
|
|
26
|
-
|
|
27
|
-
# State enum
|
|
28
|
-
enum state: {
|
|
29
|
-
pending: 0,
|
|
30
|
-
approved: 1,
|
|
31
|
-
rejected: 2,
|
|
32
|
-
released: 3
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
# Validations
|
|
36
|
-
validates :template_klass, presence: true
|
|
37
|
-
validates :template, presence: true
|
|
38
|
-
validates :metadata, presence: true
|
|
39
|
-
validates :origin, presence: true
|
|
40
|
-
|
|
41
|
-
# Scopes
|
|
42
|
-
scope :by_template_klass, ->(klass) { where(template_klass: klass) }
|
|
43
|
-
scope :by_state, ->(state) { where(state: state) }
|
|
44
|
-
scope :by_origin, ->(origin) { where(origin: origin) }
|
|
45
|
-
scope :by_email, ->(email) { where("metadata->'submission'->>'email' = ?", email) }
|
|
46
|
-
scope :by_contact_email, ->(email) { where("metadata->'submission'->>'contact_email' = ?", email) }
|
|
47
|
-
scope :by_any_email, lambda { |email|
|
|
48
|
-
where("metadata->'submission'->>'email' = ? OR metadata->'submission'->>'contact_email' = ?", email, email)
|
|
49
|
-
}
|
|
50
|
-
scope :recent, -> { order(created_at: :desc) }
|
|
51
|
-
end
|
|
52
|
-
end
|