Skip to content

Make the relationship between Sample and Investigation many-to-many #231

@RKrahl

Description

@RKrahl

We have the Sample class in our schema to represent "a sample to be used in an investigation". It has many-to-one relationship with Investigation, e.g. each sample must be related to one and only one investigation.

While this is certainly suitable for most situations, it may be problematic in some cases: if one individual sample has been the subject of more then one investigation, there is currently no way to properly represent this in our schema. I'd like to remind that we occasionally also have rather prominent samples such as archeological artifacts or pieces of art and it is not so improbable that the same item might be investigated more then once by independent groups using different techniques trying to answer unrelated questions.

I therefore suggest to add the following class to the schema:

InvestigationSample

Represents a many-to-many relationship between an investigation and a sample that has been used in that investigation

Constraint: investigation, sample

Relationships:

Card Class Field
1,1 Investigation investigation
1,1 Sample sample

As a result, the samples relationship in Investigation would be changed to have the type InvestigationSample rather then Sample. The Sample class would need to be modified as follows:

Sample

A sample to be used in one or more investigations

Constraint: facility, name

Relationships:

Card Class Field
1,1 Facility facility
0,* Dataset datasets
0,1 SampleType type
0,* SampleParameter parameters
0,* InvestigationSample investigationSamples

Other fields:

Field Type Description
name String[255] NOT NULL
pid String[255] A persistent identifier attributed to this sample

E.g. the many-to-one relation with Investigation would be replaced by a one-to-many relation with InvestigationSample and I suggest to add a relationship with Facility just for the sake of consistency with the current schema where most things are related directly or indirectly to the facility on top. The uniqueness constraint would need to be adapted as well. The attributes of Sample would remain unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementschemathis involves changes to the ICAT schema

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions