src/datasets/dto/create-dataset.dto.ts
Properties |
|
| Readonly Optional classification |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'ACIA information about AUthenticity,COnfidentiality,INtegrity and AVailability requirements of dataset. E.g. AV(ailabilty)=medium could trigger the creation of a two tape copies. Format 'AV=medium,CO=low''})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:207
|
| Readonly Optional comment |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Comment the user has about a given dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:305
|
| Readonly contactEmail |
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, description: 'Email of the contact person for this dataset. The string may contain a list of emails, which should then be separated by semicolons.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:72
|
| Readonly creationTime |
Type : Date
|
Decorators :
@ApiProperty({type: Date, required: true, description: 'Time when dataset became fully available on disk, i.e. all containing files have been written. Format according to chapter 5.6 internet date/time format in RFC 3339. Local times without timezone/offset info are automatically transformed to UTC using the timezone of the API server.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:146
|
| Readonly Optional dataQualityMetrics |
Type : number
|
Decorators :
@ApiProperty({type: Number, required: false, description: 'Data Quality Metrics is a number given by the user to rate the dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:315
|
| Readonly datasetlifecycle |
Type : LifecycleClass
|
Decorators :
@ApiProperty({type: LifecycleClass, required: false, default: undefined, description: 'Describes the current status of the dataset during its lifetime with respect to the storage handling systems.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:286
|
| Readonly Optional datasetName |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'A name for the dataset, given by the creator to carry some semantic meaning. Useful for display purposes e.g. instead of displaying the pid. Will be autofilled if missing using info from sourceFolder.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:197
|
| Readonly Optional description |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Free text explanation of contents of dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:187
|
| Readonly Optional isPublished |
Type : boolean
|
Decorators :
@ApiProperty({type: Boolean, required: false, default: false, description: 'Flag is true when data are made publicly available.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:236
|
| Readonly Optional keywords |
Type : string[]
|
Decorators :
@ApiProperty({type: undefined, required: false, description: 'Array of tags associated with the meaning or contents of this dataset. Values should ideally come from defined vocabularies, taxonomies, ontologies or knowledge graphs.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:178
|
| Readonly Optional license |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Name of the license under which the data can be used.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:216
|
| Readonly Optional numberOfFiles |
Type : number
|
Default value : 0
|
Decorators :
@ApiProperty({type: Number, default: 0, required: false, description: 'Total number of files in all OrigDatablocks for this dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:127
|
| Readonly Optional numberOfFilesArchived |
Type : number
|
Decorators :
@ApiProperty({type: Number, default: 0, required: true, description: 'Total number of files in all Datablocks for this dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:137
|
| Readonly Optional orcidOfOwner |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'ORCID of the owner or custodian. The string may contain a list of ORCIDs, which should then be separated by semicolons.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:63
|
| Readonly owner |
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, description: 'Owner or custodian of the dataset, usually first name + last name. The string may contain a list of persons, which should then be separated by semicolons.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:43
|
| Readonly Optional ownerEmail |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Email of the owner or custodian of the dataset. The string may contain a list of emails, which should then be separated by semicolons.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:53
|
| Readonly Optional packedSize |
Type : number
|
Default value : 0
|
Decorators :
@ApiProperty({type: Number, default: 0, required: false, description: 'Total size of all datablock package files created for this dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:116
|
| Optional pid |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Persistent identifier of the dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:34
|
| Readonly Optional relationships |
Type : RelationshipClass[]
|
Decorators :
@ApiProperty({type: 'array', items: undefined, required: false, default: undefined, description: 'Stores the relationships with other datasets.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:276
|
| Readonly Optional scientificMetadata |
Type : Record<string | >
|
Decorators :
@ApiProperty({type: Object, required: false, default: undefined, description: 'JSON object containing the scientific metadata.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:296
|
| Readonly Optional sharedWith |
Type : string[]
|
Decorators :
@ApiProperty({type: undefined, required: false, default: undefined, description: 'List of users that the dataset has been shared with.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:262
|
| Readonly Optional size |
Type : number
|
Default value : 0
|
Decorators :
@ApiProperty({type: Number, default: 0, required: false, description: 'Total size of all source files contained in source folder on disk when unpacked.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:105
|
| Readonly sourceFolder |
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, description: 'Absolute file path on file server containing the files of this dataset, e.g. /some/path/to/sourcefolder. In case of a single file dataset, e.g. HDF5 data, it contains the path up to, but excluding the filename. Trailing slashes are removed.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:81
|
| Readonly Optional sourceFolderHost |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'DNS host name of file server hosting sourceFolder, optionally including a protocol e.g. [protocol://]fileserver1.example.com'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:91
|
| Readonly Optional techniques |
Type : TechniqueClass[]
|
Decorators :
@ApiProperty({type: 'array', items: undefined, required: false, default: undefined, description: 'Stores the metadata information for techniques.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:249
|
| Readonly type |
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, enum: undefined, description: 'Characterize type of dataset, either 'raw' or 'derived'. Autofilled when choosing the proper inherited models.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:156
|
| Readonly Optional validationStatus |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Defines a level of trust, e.g. a measure of how much data was verified or used by other persons.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:166
|
| Readonly Optional version |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Version of the API used in creation of the dataset.'})
|
|
Defined in src/datasets/dto/create-dataset.dto.ts:225
|
| Readonly Optional accessGroups |
Type : string[]
|
Decorators :
@ApiProperty({type: undefined, required: false, description: 'List of groups which have access to this item.'})
|
|
Inherited from
OwnableDto
|
|
Defined in
OwnableDto:22
|
| Readonly Optional instrumentGroup |
Type : string
|
Decorators :
@ApiProperty({type: String, required: false, description: 'Group of the instrument which this item was acquired on.'})
|
|
Inherited from
OwnableDto
|
|
Defined in
OwnableDto:31
|
| Readonly ownerGroup |
Type : string
|
Decorators :
@ApiProperty({type: String, required: true, description: 'Name of the group owning this item.'})
|
|
Inherited from
OwnableDto
|
|
Defined in
OwnableDto:11
|
import { OwnableDto } from "src/common/dto/ownable.dto";
import { TechniqueClass } from "../schemas/technique.schema";
import { RelationshipClass } from "../schemas/relationship.schema";
import {
IsString,
IsOptional,
IsEmail,
IsFQDN,
IsInt,
IsNumber,
IsDateString,
IsBoolean,
ValidateNested,
IsObject,
IsArray,
IsEnum,
} from "class-validator";
import { ApiProperty, ApiTags, getSchemaPath } from "@nestjs/swagger";
import { DatasetType } from "../dataset-type.enum";
import { Type } from "class-transformer";
import { CreateRelationshipDto } from "./create-relationship.dto";
import { CreateTechniqueDto } from "./create-technique.dto";
import { LifecycleClass } from "../schemas/lifecycle.schema";
@ApiTags("datasets")
export class CreateDatasetDto extends OwnableDto {
@ApiProperty({
type: String,
required: false,
description: "Persistent identifier of the dataset.",
})
@IsOptional()
@IsString()
pid?: string;
@ApiProperty({
type: String,
required: true,
description:
"Owner or custodian of the dataset, usually first name + last name. The string may contain a list of persons, which should then be separated by semicolons.",
})
@IsString()
readonly owner: string;
@ApiProperty({
type: String,
required: false,
description:
"Email of the owner or custodian of the dataset. The string may contain a list of emails, which should then be separated by semicolons.",
})
@IsOptional()
@IsEmail()
readonly ownerEmail?: string;
@ApiProperty({
type: String,
required: false,
description:
"ORCID of the owner or custodian. The string may contain a list of ORCIDs, which should then be separated by semicolons.",
})
@IsOptional()
@IsString()
readonly orcidOfOwner?: string;
@ApiProperty({
type: String,
required: true,
description:
"Email of the contact person for this dataset. The string may contain a list of emails, which should then be separated by semicolons.",
})
@IsEmail()
readonly contactEmail: string;
@ApiProperty({
type: String,
required: true,
description:
"Absolute file path on file server containing the files of this dataset, e.g. /some/path/to/sourcefolder. In case of a single file dataset, e.g. HDF5 data, it contains the path up to, but excluding the filename. Trailing slashes are removed.",
})
@IsString()
readonly sourceFolder: string;
@ApiProperty({
type: String,
required: false,
description:
"DNS host name of file server hosting sourceFolder, optionally including a protocol e.g. [protocol://]fileserver1.example.com",
})
@IsOptional()
@IsFQDN()
readonly sourceFolderHost?: string;
/*
* size and number of files fields should be managed by the system
*/
@ApiProperty({
type: Number,
default: 0,
required: false,
description:
"Total size of all source files contained in source folder on disk when unpacked.",
})
@IsOptional()
@IsInt()
readonly size?: number = 0;
@ApiProperty({
type: Number,
default: 0,
required: false,
description:
"Total size of all datablock package files created for this dataset.",
})
@IsOptional()
@IsInt()
readonly packedSize?: number = 0;
@ApiProperty({
type: Number,
default: 0,
required: false,
description:
"Total number of files in all OrigDatablocks for this dataset.",
})
@IsOptional()
@IsInt()
readonly numberOfFiles?: number = 0;
@ApiProperty({
type: Number,
default: 0,
required: true,
description: "Total number of files in all Datablocks for this dataset.",
})
@IsOptional()
@IsInt()
readonly numberOfFilesArchived?: number;
@ApiProperty({
type: Date,
required: true,
description:
"Time when dataset became fully available on disk, i.e. all containing files have been written. Format according to chapter 5.6 internet date/time format in RFC 3339. Local times without timezone/offset info are automatically transformed to UTC using the timezone of the API server.",
})
@IsDateString()
readonly creationTime: Date;
@ApiProperty({
type: String,
required: true,
enum: [DatasetType.Raw, DatasetType.Derived],
description:
"Characterize type of dataset, either 'raw' or 'derived'. Autofilled when choosing the proper inherited models.",
})
@IsEnum(DatasetType)
readonly type: string;
@ApiProperty({
type: String,
required: false,
description:
"Defines a level of trust, e.g. a measure of how much data was verified or used by other persons.",
})
@IsOptional()
@IsString()
readonly validationStatus?: string;
@ApiProperty({
type: [String],
required: false,
description:
"Array of tags associated with the meaning or contents of this dataset. Values should ideally come from defined vocabularies, taxonomies, ontologies or knowledge graphs.",
})
@IsOptional()
@IsString({
each: true,
})
readonly keywords?: string[];
@ApiProperty({
type: String,
required: false,
description: "Free text explanation of contents of dataset.",
})
@IsOptional()
@IsString()
readonly description?: string;
@ApiProperty({
type: String,
required: false,
description:
"A name for the dataset, given by the creator to carry some semantic meaning. Useful for display purposes e.g. instead of displaying the pid. Will be autofilled if missing using info from sourceFolder.",
})
@IsOptional()
@IsString()
readonly datasetName?: string;
@ApiProperty({
type: String,
required: false,
description:
"ACIA information about AUthenticity,COnfidentiality,INtegrity and AVailability requirements of dataset. E.g. AV(ailabilty)=medium could trigger the creation of a two tape copies. Format 'AV=medium,CO=low'",
})
@IsOptional()
@IsString()
readonly classification?: string;
@ApiProperty({
type: String,
required: false,
description: "Name of the license under which the data can be used.",
})
@IsOptional()
@IsString()
readonly license?: string;
@ApiProperty({
type: String,
required: false,
description: "Version of the API used in creation of the dataset.",
})
@IsOptional()
@IsString()
readonly version?: string;
// it needs to be discussed if this fields is managed by the user or by the system
@ApiProperty({
type: Boolean,
required: false,
default: false,
description: "Flag is true when data are made publicly available.",
})
@IsOptional()
@IsBoolean()
readonly isPublished?: boolean;
@ApiProperty({
type: "array",
items: { $ref: getSchemaPath(TechniqueClass) },
required: false,
default: [],
description: "Stores the metadata information for techniques.",
})
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => CreateTechniqueDto)
readonly techniques?: TechniqueClass[];
// it needs to be discussed if this fields is managed by the user or by the system
@ApiProperty({
type: [String],
required: false,
default: [],
description: "List of users that the dataset has been shared with.",
})
@IsOptional()
@IsString({
each: true,
})
readonly sharedWith?: string[];
// it needs to be discussed if this fields is managed by the user or by the system
@ApiProperty({
type: "array",
items: { $ref: getSchemaPath(RelationshipClass) },
required: false,
default: [],
description: "Stores the relationships with other datasets.",
})
@IsArray()
@IsOptional()
@ValidateNested({ each: true })
@Type(() => CreateRelationshipDto)
readonly relationships?: RelationshipClass[];
@ApiProperty({
type: LifecycleClass,
required: false,
default: {},
description:
"Describes the current status of the dataset during its lifetime with respect to the storage handling systems.",
})
@IsOptional()
readonly datasetlifecycle: LifecycleClass;
@ApiProperty({
type: Object,
required: false,
default: {},
description: "JSON object containing the scientific metadata.",
})
@IsOptional()
@IsObject()
readonly scientificMetadata?: Record<string, unknown>;
@ApiProperty({
type: String,
required: false,
description: "Comment the user has about a given dataset.",
})
@IsOptional()
@IsString()
readonly comment?: string;
@ApiProperty({
type: Number,
required: false,
description:
"Data Quality Metrics is a number given by the user to rate the dataset.",
})
@IsOptional()
@IsNumber()
readonly dataQualityMetrics?: number;
}