All Implemented Interfaces:
Serializable

@CompoundIndex(def="{name: 1, dataSetId: 1}",unique=true) @CompoundIndex(def="{indexInDataSet: 1, dataSetId: 1}",unique=false) @ValidShadowId(message="variable-management.error.variable.id.pattern") @ValidVariableIdName(message="variable-management.error.variable.valid-variable-name") @ValidRepeatedMeasurementIdentifier(message="variable-management.error.variable.valid-repeated-measurement-identifier") @ValidDerivedVariablesIdentifier(message="variable-management.error.variable.valid-derived-variables-identifier") @UniqueVariableNameInDataSet(message="variable-management.error.variable.unique-variable-name-in-data-set") @RestrictedScaleLevelForDateDataType(message="variable-management.error.variable.restricted-scale-level-for-date-data-type") @ValidResponseValueMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.valid-response-value-must-be-an-iso-date-on-date-data-type") @StatisticsMinimumMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-minimum-must-be-an-iso-date-on-date-data-type") @StatisticsMaximumMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-maximum-must-be-an-iso-date-on-date-data-type") @StatisticsMedianMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-median-must-be-an-iso-date-on-date-data-type") @StatisticsFirstQuartileMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-first-quartile-must-be-an-iso-date-on-date-data-type") @StatisticsThirdQuartileMustBeAnIsoDateOnDateDataType(message="variable-management.error.variable.statistics-third-quartile-must-be-an-iso-date-on-date-data-type") @ValidResponseValueMustBeANumberOnNumericDataType(message="variable-management.error.variable.valid-response-value-must-be-a-number-on-numeric-data-type") @StatisticsMinimumMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-minimum-must-be-a-number-on-numeric-data-type") @StatisticsMaximumMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-maximum-must-be-a-number-on-numeric-data-type") @StatisticsMedianMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-median-must-be-a-number-on-numeric-data-type") @StatisticsFirstQuartileMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-first-quartile-must-be-a-number-on-numeric-data-type") @StatisticsThirdQuartileMustBeANumberOnNumericDataType(message="variable-management.error.variable.statistics-third-quartile-must-be-a-number-on-numeric-data-type") public class Variable extends AbstractShadowableRdcDomainObject
A variable contains the results from at least one Survey. These results can be the responses from participants of an online survey, hence a variable can result from RelatedQuestions. A variable is part of exactly one DataSet.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private @NotEmpty(message="variable-management.error.variable.access-ways.not-empty") List<String>
    The access way of this variable.
    private @I18nStringSize(max=2048,message="variable-management.error.variable.annotations.i18n-string-size") I18nString
    Arbitrary additional text for this variable.
    private @NotEmpty(message="variable-management.error.variable.data-acquisition-project.id.not-empty") String
    The id of the DataAcquisitionProject to which this variable belongs.
    private @NotEmpty(message="variable-management.error.variable.dataPackage-id.not-empty") String
    Id of the DataPackage to which this variable belongs.
    private @NotEmpty(message="variable-management.error.variable.data-set-id-not-empty") String
    The id of the DataSet to which this variable belongs.
    private @NotNull(message="variable-management.error.variable.data-set-number-not-null") Integer
    The number of the DataSet to which this variable belongs.
    private @NotNull(message="variable-management.error.variable.data-type.not-null") I18nString
    The technical type which the ValidResponses have.
    private @Size(max=512,message="variable-management.error.variable.derived-variables-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.derived-variables-identifier-pattern") String
    Identifier used to group variables within this DataSet which have been derived from each other.
    private @Valid Distribution
    The Distribution contains the descriptives of this variable meaning ValidResponses, Missings and Statistics.
    private Boolean
    Flag indicating whether the ValidResponses should be displayed with a thousands separator or not.
    private @Valid FilterDetails
    FilterDetails of a variable describe the condition which must have evaluated to true before a participant was asked a Question resulting in this variable.
    private @Valid GenerationDetails
    GenerationDetails describe how this variable was generated from one or more input variables.
    private String
    The id of the variable which uniquely identifies the variable in this application.
    private @NotNull(message="variable-management.error.variable.data-set-index-not-null") Integer
    The index in the DataSet of this variable.
    private @NotNull(message="variable-management.error.variable.label.not-null") @I18nStringSize(max=512,message="variable-management.error.variable.label.i18n-string-size") I18nString
    The label of the variable should describe its content.
    private @NotEmpty(message="variable-management.error.variable.master-id.not-empty") @Size(max=512,message="variable-management.error.variable.master-id.size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\$]*$",message="variable-management.error.variable.master-id.pattern") String
     
    private @NotEmpty(message="variable-management.error.variable.name.not-empty") @Size(max=32,message="variable-management.error.variable.name.size") @Pattern(regexp="^[_a-zA-Z][_a-zA-Z0-9]*$",message="variable-management.error.variable.name.pattern") String
    The name of the variable as it is used in the DataSet.
    private @Size(max=512,message="variable-management.error.pid.size") @Pattern(message="variable-management.error.pid.pattern",regexp="^21\\.T11998\\/dzhw:([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") String
    The PID of the variable.
    private @Valid List<RelatedQuestion>
    List of RelatedQuestions which have been asked to generate the values of this variable.
    private List<String>
    List of ids of variables which are "related" to this variable.
    private @Size(max=512,message="variable-management.error.variable.repeated-measurement-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.repeated-measurement-pattern") String
    Identifier used to group variables within this DataSet which measure the same across multiple waves.
    private @NotNull(message="variable-management.error.variable.scaleLevel.not-null") I18nString
    The scale level (or level of measurement) classifies the nature of information within the values assigned to this variable (ValidResponses).
    private static final long
     
    private @NotNull(message="variable-management.error.variable.storage-type.not-null") String
    Associated with each data type is a storage type.
    private List<String>
    List of ids of Surveys which have been conducted to create this variable.
    private @NotEmpty(message="variable-management.error.variable.survey-numbers-not-empty") List<Integer>
    List of numbers of Surveys which have been conducted to create this variable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Variable(Variable variable)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Set id on implementation of AbstractShadowableRdcDomainObject.
    protected void
    Set masterId on implementations of AbstractShadowableRdcDomainObject.

    Methods inherited from class eu.dzhw.fdz.metadatamanagement.common.domain.AbstractShadowableRdcDomainObject

    getMasterId, setId, setMasterId

    Methods inherited from class eu.dzhw.fdz.metadatamanagement.common.domain.AbstractRdcDomainObject

    getId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • id

      private String id
      The id of the variable which uniquely identifies the variable in this application. The id must not be empty and must be of the form var-{{dataAcquisitionProjectId}}-ds{{dataSetNumber}}-{{name}}$. The id must not contain more than 512 characters.
    • masterId

      @NotEmpty(message="variable-management.error.variable.master-id.not-empty") @Size(max=512, message="variable-management.error.variable.master-id.size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\$]*$", message="variable-management.error.variable.master-id.pattern") private @NotEmpty(message="variable-management.error.variable.master-id.not-empty") @Size(max=512,message="variable-management.error.variable.master-id.size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\$]*$",message="variable-management.error.variable.master-id.pattern") String masterId
    • pid

      @Size(max=512, message="variable-management.error.pid.size") @Pattern(message="variable-management.error.pid.pattern", regexp="^21\\.T11998\\/dzhw:([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") private @Size(max=512,message="variable-management.error.pid.size") @Pattern(message="variable-management.error.pid.pattern",regexp="^21\\.T11998\\/dzhw:([_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-\\/\\:.]{1,}$)") String pid
      The PID of the variable. Must not contain more than 512 characters. Must match the pattern of a PID "21.T11998/dzhw:{DataPackageID}_{VariableID}:{version}
    • dataAcquisitionProjectId

      @NotEmpty(message="variable-management.error.variable.data-acquisition-project.id.not-empty") private @NotEmpty(message="variable-management.error.variable.data-acquisition-project.id.not-empty") String dataAcquisitionProjectId
      The id of the DataAcquisitionProject to which this variable belongs. The dataAcquisitionProjectId must not be empty.
    • name

      @NotEmpty(message="variable-management.error.variable.name.not-empty") @Size(max=32, message="variable-management.error.variable.name.size") @Pattern(regexp="^[_a-zA-Z][_a-zA-Z0-9]*$", message="variable-management.error.variable.name.pattern") private @NotEmpty(message="variable-management.error.variable.name.not-empty") @Size(max=32,message="variable-management.error.variable.name.size") @Pattern(regexp="^[_a-zA-Z][_a-zA-Z0-9]*$",message="variable-management.error.variable.name.pattern") String name
      The name of the variable as it is used in the DataSet. It must not be empty and must be unique in the DataSet. It must contain only alphanumeric (english) characters and "_". The first character must not be a number. It must not contain more than 32 characters.
    • label

      @NotNull(message="variable-management.error.variable.label.not-null") @I18nStringSize(max=512, message="variable-management.error.variable.label.i18n-string-size") @I18nStringNotEmpty(message="variable-management.error.variable.label.i18n-string-not-empty") private @NotNull(message="variable-management.error.variable.label.not-null") @I18nStringSize(max=512,message="variable-management.error.variable.label.i18n-string-size") I18nString label
      The label of the variable should describe its content. It must be specified in at least one language and it must not contain more than 512 characters.
    • annotations

      @I18nStringSize(max=2048, message="variable-management.error.variable.annotations.i18n-string-size") private @I18nStringSize(max=2048,message="variable-management.error.variable.annotations.i18n-string-size") I18nString annotations
      Arbitrary additional text for this variable. Markdown is supported. Must not contain more than 2048 characters.
    • dataSetId

      @NotEmpty(message="variable-management.error.variable.data-set-id-not-empty") private @NotEmpty(message="variable-management.error.variable.data-set-id-not-empty") String dataSetId
      The id of the DataSet to which this variable belongs. Must not be empty.
    • dataSetNumber

      @NotNull(message="variable-management.error.variable.data-set-number-not-null") private @NotNull(message="variable-management.error.variable.data-set-number-not-null") Integer dataSetNumber
      The number of the DataSet to which this variable belongs. Must not be empty.
    • dataType

      @NotNull(message="variable-management.error.variable.data-type.not-null") @ValidDataType(message="variable-management.error.variable.data-type.valid-data-type") private @NotNull(message="variable-management.error.variable.data-type.not-null") I18nString dataType
      The technical type which the ValidResponses have. Must be one of DataTypes and must not be empty.
    • storageType

      @NotNull(message="variable-management.error.variable.storage-type.not-null") @ValidStorageType(message="variable-management.error.variable.storage-type.valid-storage-type") private @NotNull(message="variable-management.error.variable.storage-type.not-null") String storageType
      Associated with each data type is a storage type. For instance numerics can be stored as integer or double. Must be one of StorageTypes and must not be empty.
    • scaleLevel

      @NotNull(message="variable-management.error.variable.scaleLevel.not-null") @ValidScaleLevel(message="variable-management.error.variable.scaleLevel.valid-scale-level") private @NotNull(message="variable-management.error.variable.scaleLevel.not-null") I18nString scaleLevel
      The scale level (or level of measurement) classifies the nature of information within the values assigned to this variable (ValidResponses). It determines which mathematical operations can be performed with the values. It must be one of ScaleLevels and must not be empty. If the data type of this variable is DataTypes.DATE then the ScaleLevel must be ScaleLevels.ORDINAL, ScaleLevels.INTERVAL or ScaleLevels.NOMINAL.
    • accessWays

      @NotEmpty(message="variable-management.error.variable.access-ways.not-empty") @ValidAccessWays(message="variable-management.error.variable.access-ways.valid-access-ways") private @NotEmpty(message="variable-management.error.variable.access-ways.not-empty") List<String> accessWays
      The access way of this variable. Depends on the sensitivity of the data and describes how the data user will be able to work with the data. Must not be empty and be one of AccessWays.
    • relatedVariables

      private List<String> relatedVariables
      List of ids of variables which are "related" to this variable. The type of relation is arbitrary.
    • indexInDataSet

      @NotNull(message="variable-management.error.variable.data-set-index-not-null") private @NotNull(message="variable-management.error.variable.data-set-index-not-null") Integer indexInDataSet
      The index in the DataSet of this variable. Used for sorting the variables of this DataSet and for displaying successors and predecessors of this variable. Must not be empty and the successor of this variable must have indexInDataSet incremented by one.
    • surveyNumbers

      @NotEmpty(message="variable-management.error.variable.survey-numbers-not-empty") private @NotEmpty(message="variable-management.error.variable.survey-numbers-not-empty") List<Integer> surveyNumbers
      List of numbers of Surveys which have been conducted to create this variable. Must not be empty.
    • repeatedMeasurementIdentifier

      @Size(max=512, message="variable-management.error.variable.repeated-measurement-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$", message="variable-management.error.variable.repeated-measurement-pattern") private @Size(max=512,message="variable-management.error.variable.repeated-measurement-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.repeated-measurement-pattern") String repeatedMeasurementIdentifier
      Identifier used to group variables within this DataSet which measure the same across multiple waves. Must be of the form {{dataAcquisitionProjectId}}-ds{{dataSetNumber}}-{{string}}$. Must not contain more than 512 characters and must contain only (german) alphanumeric characters and "_" and "-".
    • derivedVariablesIdentifier

      @Size(max=512, message="variable-management.error.variable.derived-variables-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$", message="variable-management.error.variable.derived-variables-identifier-pattern") private @Size(max=512,message="variable-management.error.variable.derived-variables-identifier-size") @Pattern(regexp="^[_A-Za-z0-9\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df\\-]*$",message="variable-management.error.variable.derived-variables-identifier-pattern") String derivedVariablesIdentifier
      Identifier used to group variables within this DataSet which have been derived from each other. For instance one variable might be an aggregated version of the other. Must be of the form {{dataAcquisitionProjectId}}-ds{{dataSetNumber}}-{{string}}$. Must not contain more than 512 characters and must contain only (german) alphanumeric characters and "_" and "-".
    • filterDetails

      @Valid private @Valid FilterDetails filterDetails
      FilterDetails of a variable describe the condition which must have evaluated to true before a participant was asked a Question resulting in this variable.
    • generationDetails

      @Valid private @Valid GenerationDetails generationDetails
      GenerationDetails describe how this variable was generated from one or more input variables.
    • distribution

      @Valid private @Valid Distribution distribution
      The Distribution contains the descriptives of this variable meaning ValidResponses, Missings and Statistics.
    • relatedQuestions

      @Valid private @Valid List<RelatedQuestion> relatedQuestions
      List of RelatedQuestions which have been asked to generate the values of this variable.
    • doNotDisplayThousandsSeparator

      private Boolean doNotDisplayThousandsSeparator
      Flag indicating whether the ValidResponses should be displayed with a thousands separator or not. For instance years (1970) are numeric but should not be displayed with a thousands separator. Default value is false indicating that the ValidResponses are displayed with thousands separator.
    • dataPackageId

      @NotEmpty(message="variable-management.error.variable.dataPackage-id.not-empty") private @NotEmpty(message="variable-management.error.variable.dataPackage-id.not-empty") String dataPackageId
      Id of the DataPackage to which this variable belongs.
    • surveyIds

      private List<String> surveyIds
      List of ids of Surveys which have been conducted to create this variable. Must not be empty.
  • Constructor Details

    • Variable

      public Variable(Variable variable)
  • Method Details