diff --git a/api/src/engine/models/experiment/experiment.model.ts b/api/src/engine/models/experiment/experiment.model.ts index 7f2d51e68b3e17c05d68257dd3deeb1967b703c6..eb757d64d9444f4c505705d3d6faa2b7e32c4d72 100644 --- a/api/src/engine/models/experiment/experiment.model.ts +++ b/api/src/engine/models/experiment/experiment.model.ts @@ -3,6 +3,24 @@ import { ResultUnion } from '../result/common/result-union.model'; import { Algorithm } from './algorithm.model'; import { Author } from './author.model'; +@ObjectType() +export class Transformation { + @Field({ description: "Variable's id on which to apply the transformation" }) + id: string; + + @Field({ description: 'Transformation to apply' }) + operation: string; +} + +@ObjectType() +export class Formula { + @Field(() => [Transformation], { nullable: true, defaultValue: [] }) + transformations: Transformation[]; + + @Field(() => [[String]], { nullable: true, defaultValue: [] }) + interactions: string[][]; +} + @ObjectType() export class Experiment { @Field() @@ -53,6 +71,9 @@ export class Experiment { @Field(() => [String], { nullable: true, defaultValue: [] }) filterVariables?: string[]; + @Field(() => Formula, { nullable: true }) + formula?: Formula; + @Field() algorithm: Algorithm; } diff --git a/api/src/schema.gql b/api/src/schema.gql index 7e173aded938434460d9d151fc7d514b8ad8889d..feb05a83c61d70923582af0f62ff6037fe9b33ae 100644 --- a/api/src/schema.gql +++ b/api/src/schema.gql @@ -137,6 +137,19 @@ type Author { fullname: String } +type Transformation { + """Variable's id on which to apply the transformation""" + id: String! + + """Transformation to apply""" + operation: String! +} + +type Formula { + transformations: [Transformation!] + interactions: [[String!]!] +} + type Experiment { id: String! name: String! @@ -154,6 +167,7 @@ type Experiment { variables: [String!]! coVariables: [String!] filterVariables: [String!] + formula: Formula algorithm: Algorithm! } @@ -174,6 +188,7 @@ type PartialExperiment { variables: [String!] coVariables: [String!] filterVariables: [String!] + formula: Formula algorithm: Algorithm } @@ -227,7 +242,7 @@ enum ParamType { } input FormulaTransformation { - name: String! + id: String! operation: String! }