Skip to content

Commit 5de56c5

Browse files
ProcessingJob query optimization
1 parent a822fa8 commit 5de56c5

File tree

3 files changed

+280
-66
lines changed

3 files changed

+280
-66
lines changed

dp.gql

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
"""
2+
Represents an auto processed job
3+
"""
4+
type AutoProc @key(fields: "autoProcId autoProcProgramId spaceGroup refinedCellA refinedCellB refinedCellC refinedCellAlpha refinedCellBeta refinedCellGamma", resolvable: false) {
5+
"""
6+
An opaque unique identifier for the auto processing
7+
"""
8+
autoProcId: Int!
9+
"""
10+
An opaque unique identifier for the auto processing program
11+
"""
12+
autoProcProgramId: Int
13+
"""
14+
Space group of the processing job
15+
"""
16+
spaceGroup: String
17+
"""
18+
Refined cell a in the auto processing job
19+
"""
20+
refinedCellA: Float
21+
"""
22+
Refined cell b in the auto processing job
23+
"""
24+
refinedCellB: Float
25+
"""
26+
Refined cell c in the auto processing job
27+
"""
28+
refinedCellC: Float
29+
"""
30+
Refined cell alpha in the auto processing job
31+
"""
32+
refinedCellAlpha: Float
33+
"""
34+
Refined cell beta in the auto processing job
35+
"""
36+
refinedCellBeta: Float
37+
"""
38+
Refined cell gamma in the auto processing job
39+
"""
40+
refinedCellGamma: Float
41+
"""
42+
Fetches the scaling for automatic process
43+
"""
44+
scaling: AutoProcScaling
45+
}
46+
47+
"""
48+
Represents an auto processing integration
49+
"""
50+
type AutoProcIntegration @key(fields: "autoProcIntegrationId dataCollectionId autoProcProgramId refinedXBeam refinedYBeam", resolvable: false) {
51+
"""
52+
An opaque unique identifier for the auto processing integration
53+
"""
54+
autoProcIntegrationId: Int!
55+
"""
56+
An opaque unique identifier for the data collection
57+
"""
58+
dataCollectionId: Int!
59+
"""
60+
An opaque unique identifier for the auto processing program
61+
"""
62+
autoProcProgramId: Int
63+
"""
64+
Refined X position of the beam
65+
"""
66+
refinedXBeam: Float
67+
"""
68+
Refined Y position of the beam
69+
"""
70+
refinedYBeam: Float
71+
"""
72+
Fetches the automatically processed programs
73+
"""
74+
autoProcProgram: AutoProcProgram
75+
}
76+
77+
"""
78+
Represents an auto processed program
79+
"""
80+
type AutoProcProgram @key(fields: "autoProcProgramId processingPrograms processingStatus processingMessage processingJobId", resolvable: false) {
81+
"""
82+
An opaque unique identifier for the auto processing program
83+
"""
84+
autoProcProgramId: Int!
85+
"""
86+
Name of the processing programs
87+
"""
88+
processingPrograms: String
89+
"""
90+
Processing program status
91+
"""
92+
processingStatus: Int
93+
"""
94+
Processing program message
95+
"""
96+
processingMessage: String
97+
"""
98+
An opaque unique identifier for the processing processing job
99+
"""
100+
processingJobId: Int
101+
"""
102+
Fetched the automatic process
103+
"""
104+
autoProc: AutoProc
105+
}
106+
107+
"""
108+
Represents and auto processing scaling
109+
"""
110+
type AutoProcScaling @key(fields: "autoProcScalingId autoProcId", resolvable: false) {
111+
"""
112+
An opaque unique identifier for the auto processing scaling
113+
"""
114+
autoProcScalingId: Int!
115+
"""
116+
An opaque unique identifier for the auto processing
117+
"""
118+
autoProcId: Int
119+
"""
120+
Fetches the scaling statistics
121+
"""
122+
overall: AutoProcScalingStatics
123+
innerShell: AutoProcScalingStatics
124+
outerShell: AutoProcScalingStatics
125+
}
126+
127+
"""
128+
Represents auto processing scaling statics
129+
"""
130+
type AutoProcScalingStatics @key(fields: "autoProcScalingStatisticsId autoProcScalingId scalingStatisticsType resolutionLimitLow resolutionLimitHigh rMerge rMeasAllIPlusIMinus nTotalObservations nTotalUniqueObservations meanIOverSigI completeness multiplicity anomalousCompleteness anomalousMultiplicity ccHalf ccAnomalous", resolvable: false) {
131+
autoProcScalingStatisticsId: Int!
132+
autoProcScalingId: Int
133+
scalingStatisticsType: StatisticsType!
134+
resolutionLimitLow: Float
135+
resolutionLimitHigh: Float
136+
rMerge: Float
137+
rMeasAllIPlusIMinus: Float
138+
nTotalObservations: Int
139+
nTotalUniqueObservations: Int
140+
meanIOverSigI: Float
141+
completeness: Float
142+
multiplicity: Float
143+
anomalousCompleteness: Float
144+
anomalousMultiplicity: Float
145+
ccHalf: Float
146+
ccAnomalous: Float
147+
}
148+
149+
150+
"""
151+
Represents processed image file stored in s3 bucket
152+
"""
153+
type DataProcessing @key(fields: "id", resolvable: false) {
154+
"""
155+
An opaque unique identifier for the collected file attachment
156+
"""
157+
id: Int!
158+
"""
159+
Gives downloadable link for the processed image in the s3 bucket
160+
"""
161+
downloadUrl: String!
162+
}
163+
164+
"""
165+
Datasets subgraph extension
166+
"""
167+
type Datasets @key(fields: "id") {
168+
"""
169+
An opaque unique identifier for the data collection
170+
"""
171+
id: Int!
172+
"""
173+
Fetched all the processed data from data collection during a session
174+
"""
175+
processedData: DataProcessing
176+
"""
177+
Fetched all the processing jobs
178+
"""
179+
processingJobs: [ProcessJob!]
180+
"""
181+
Fetches all the automatic process
182+
"""
183+
autoProcIntegration: [AutoProcIntegration!]
184+
}
185+
186+
187+
188+
189+
"""
190+
Datasets subgraph extension
191+
"""
192+
type ProcessJob @key(fields: "processingJobId", resolvable: false) {
193+
processingJobId: Int
194+
"""
195+
An opaque unique identifier for the data collection
196+
"""
197+
dataCollectionId: Int
198+
"""
199+
Processing job display name
200+
"""
201+
displayName: String
202+
"""
203+
Represents if the job is automatic or downstream
204+
"""
205+
automatic: Int
206+
processingJobParameterId: Int!
207+
parameterKey: String
208+
parameterValue: String
209+
}
210+
211+
"""
212+
Represents a processing job
213+
"""
214+
type ProcessingJob @key(fields: "processingJobId dataCollectionId displayName automatic", resolvable: false) {
215+
"""
216+
An opaque unique identifier for the processing job
217+
"""
218+
processingJobId: Int!
219+
"""
220+
An opaque unique identifier for the data collection
221+
"""
222+
dataCollectionId: Int
223+
"""
224+
Processing job display name
225+
"""
226+
displayName: String
227+
"""
228+
Represents if the job is automatic or downstream
229+
"""
230+
automatic: Int
231+
}
232+
233+
"""
234+
Represents a processing job parameters
235+
"""
236+
type ProcessingJobParameter @key(fields: "processingJobParameterId processingJobId parameterKey parameterValue", resolvable: false) {
237+
processingJobParameterId: Int!
238+
processingJobId: Int
239+
parameterKey: String
240+
parameterValue: String
241+
}
242+
243+
244+
enum StatisticsType {
245+
OVERALL
246+
INNER_SHELL
247+
OUTER_SHELL
248+
}
249+
250+
251+
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
252+
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
253+
extend schema @link(
254+
url: "https://specs.apollo.dev/federation/v2.3",
255+
import: ["@key", "@tag", "@shareable", "@inaccessible", "@override", "@external", "@provides", "@requires", "@composeDirective", "@interfaceObject"]
256+
)

processed_data/src/graphql/entities.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl From<data_collection_file_attachment::Model> for DataProcessing {
2727

2828
/// Represents a processing job
2929
#[derive(Clone, Debug, PartialEq, SimpleObject)]
30-
#[graphql(name = "ProcessingJob", unresolvable, complex)]
30+
#[graphql(name = "ProcessingJob", unresolvable)]
3131
pub struct ProcessingJob {
3232
/// An opaque unique identifier for the processing job
3333
pub processing_job_id: u32,
@@ -265,3 +265,13 @@ pub struct DataCollection {
265265
/// An opaque unique identifier for the data collection
266266
pub id: u32,
267267
}
268+
269+
/// Datasets subgraph extension
270+
#[derive(Clone, Debug, PartialEq, SimpleObject)]
271+
#[graphql(name = "ProcessJob", unresolvable = "processingJobId")]
272+
pub struct ProcessJob {
273+
#[graphql(flatten, external)]
274+
pub processing_job: ProcessingJob,
275+
#[graphql(flatten, external)]
276+
pub parameters: ProcessingJobParameter,
277+
}

0 commit comments

Comments
 (0)