Skip to content

Class: Quantity

Specifies a quantity as a single value to be associated to a financial product, for example a transfer amount resulting from a trade. This data type extends QuantitySchedule and requires that only the single amount value exists.

URI: common_domain_model:Quantity

 classDiagram
    class Quantity
    click Quantity href "../Quantity/"
      QuantitySchedule <|-- Quantity
        click QuantitySchedule href "../QuantitySchedule/"


      Quantity <|-- NonNegativeQuantity
        click NonNegativeQuantity href "../NonNegativeQuantity/"
      Quantity <|-- Money
        click Money href "../Money/"


      Quantity : datedValue





        Quantity --> "*" DatedValue : datedValue
        click DatedValue href "../DatedValue/"



      Quantity : frequency





        Quantity --> "0..1" Frequency : frequency
        click Frequency href "../Frequency/"



      Quantity : multiplier





        Quantity --> "0..1" Measure : multiplier
        click Measure href "../Measure/"



      Quantity : unit





        Quantity --> "0..1" UnitType : unit
        click UnitType href "../UnitType/"



      Quantity : value

Inheritance

Slots

Name Cardinality and Range Description Inheritance
multiplier 0..1
Measure
Defines an optional number that the quantity should be multiplied by to deriv... QuantitySchedule
frequency 0..1
Frequency
Defines the frequency to be used when defining a quantity QuantitySchedule
datedValue *
DatedValue
A schedule of step date and value pairs MeasureSchedule
value 0..1
Decimal
Specifies the value of the measure as a number MeasureBase
unit 0..1
UnitType
Qualifies the unit by which the amount is measured MeasureBase

Usages

used by used in type used
CalculateTransferInstruction quantity range Quantity
ReturnInstruction quantity range Quantity
AvailableInventoryRecord quantity range Quantity
Illiquidity minimumAmount range Quantity
SpecificInconvertibility minimumAmount range Quantity
EventCurrency eventCurrentAmount range Quantity
AssetDeliveryInformation deliveryCapacity range Quantity
CalculationScheduleDeliveryPeriods deliveryCapacity range Quantity
AssetDeliveryProfileBlock deliveryCapacity range Quantity
ResolvablePriceQuantity resolvedQuantity range Quantity

Rules

Rule Applied Preconditions Postconditions Elseconditions

In Subsets

Comments

  • Rosetta condition: AmountOnlyExists — value exists and datedValue is absent
  • Rosetta func: CompareQuantityByUnitOfAmount
  • Rosetta func: FilterQuantity — Filter list of quantities based on unit type.

Identifier and Mapping Information

Annotations

property value
rosetta_functions [{"name":"CompareQuantityByUnitOfAmount","inputs":[{"name":"quantity1","type":"Quantity","cardinality":"0.."},{"name":"op","type":"CompareOp","cardinality":"1..1"},{"name":"quantity2","type":"Quantity","cardinality":"0.."},{"name":"unitOfAmount","type":"UnitType","cardinality":"1..1"}],"output":{"name":"result","type":"boolean","cardinality":"1..1"}},{"name":"FilterQuantity","description":"Filter list of quantities based on unit type.","inputs":[{"name":"quantities","type":"Quantity","cardinality":"0.."},{"name":"unit","type":"UnitType","cardinality":"1..1"}],"output":{"name":"filteredQuantities","type":"Quantity","cardinality":"0.."}}]

Schema Source

Mappings

Mapping Type Mapped Value
self common_domain_model:Quantity
native common_domain_model:Quantity
close gist:Magnitude

LinkML Source

Direct

name: Quantity
annotations:
  rosetta_functions:
    tag: rosetta_functions
    value: '[{"name":"CompareQuantityByUnitOfAmount","inputs":[{"name":"quantity1","type":"Quantity","cardinality":"0..*"},{"name":"op","type":"CompareOp","cardinality":"1..1"},{"name":"quantity2","type":"Quantity","cardinality":"0..*"},{"name":"unitOfAmount","type":"UnitType","cardinality":"1..1"}],"output":{"name":"result","type":"boolean","cardinality":"1..1"}},{"name":"FilterQuantity","description":"Filter
      list of quantities based on unit type.","inputs":[{"name":"quantities","type":"Quantity","cardinality":"0..*"},{"name":"unit","type":"UnitType","cardinality":"1..1"}],"output":{"name":"filteredQuantities","type":"Quantity","cardinality":"0..*"}}]'
description: Specifies a quantity as a single value to be associated to a financial
  product, for example a transfer amount resulting from a trade. This data type extends
  QuantitySchedule and requires that only the single amount value exists.
comments:
- 'Rosetta condition: AmountOnlyExists  value exists and datedValue is absent'
- 'Rosetta func: CompareQuantityByUnitOfAmount'
- 'Rosetta func: FilterQuantity  Filter list of quantities based on unit type.'
in_subset:
- cdm_base_math
from_schema: https://w3id.org/lmodel/common-domain-model
close_mappings:
- gist:Magnitude
is_a: QuantitySchedule
rules:
- postconditions:
    slot_conditions:
      value:
        name: value
        required: true
      datedValue:
        name: datedValue
        required: false
  description: The amount must exist when the quantity represents a single value,
    and the steps must be absent.

Induced

name: Quantity
annotations:
  rosetta_functions:
    tag: rosetta_functions
    value: '[{"name":"CompareQuantityByUnitOfAmount","inputs":[{"name":"quantity1","type":"Quantity","cardinality":"0..*"},{"name":"op","type":"CompareOp","cardinality":"1..1"},{"name":"quantity2","type":"Quantity","cardinality":"0..*"},{"name":"unitOfAmount","type":"UnitType","cardinality":"1..1"}],"output":{"name":"result","type":"boolean","cardinality":"1..1"}},{"name":"FilterQuantity","description":"Filter
      list of quantities based on unit type.","inputs":[{"name":"quantities","type":"Quantity","cardinality":"0..*"},{"name":"unit","type":"UnitType","cardinality":"1..1"}],"output":{"name":"filteredQuantities","type":"Quantity","cardinality":"0..*"}}]'
description: Specifies a quantity as a single value to be associated to a financial
  product, for example a transfer amount resulting from a trade. This data type extends
  QuantitySchedule and requires that only the single amount value exists.
comments:
- 'Rosetta condition: AmountOnlyExists  value exists and datedValue is absent'
- 'Rosetta func: CompareQuantityByUnitOfAmount'
- 'Rosetta func: FilterQuantity  Filter list of quantities based on unit type.'
in_subset:
- cdm_base_math
from_schema: https://w3id.org/lmodel/common-domain-model
close_mappings:
- gist:Magnitude
is_a: QuantitySchedule
attributes:
  multiplier:
    name: multiplier
    description: Defines an optional number that the quantity should be multiplied
      by to derive a total quantity. This number is associated to a unit. For example
      in the case of the Coal (API2) CIF ARA (ARGUS-McCloskey) Futures Contract on
      the CME, where the unit would be contracts, the multiplier value would 1,000
      and the mulitiplier unit would be 1,000 MT (Metric Tons).
    from_schema: https://w3id.org/lmodel/common-domain-model
    rank: 1000
    owner: Quantity
    domain_of:
    - QuantitySchedule
    - FloatingRateProcessingParameters
    range: Measure
  frequency:
    name: frequency
    description: Defines the frequency to be used when defining a quantity. For example
      a quantity may be specified as a number of barrels of oil per day, which needs
      multiplying by the number of days in the relevant period to get the total quantity
      as a number of barrels.
    from_schema: https://w3id.org/lmodel/common-domain-model
    rank: 1000
    owner: Quantity
    domain_of:
    - QuantitySchedule
    - CSAValuationDate
    range: Frequency
  datedValue:
    name: datedValue
    description: A schedule of step date and value pairs. On each step date the associated
      step value becomes effective. The step dates are used to order the steps by
      ascending order. This attribute is optional so the data type may be used to
      define a schedule with a single value.
    from_schema: https://w3id.org/lmodel/common-domain-model
    rank: 1000
    owner: Quantity
    domain_of:
    - MeasureSchedule
    - Schedule
    range: DatedValue
    multivalued: true
    inlined: true
    inlined_as_list: true
  value:
    name: value
    description: Specifies the value of the measure as a number. Optional because
      in a measure vector or schedule, this single value may be omitted.
    from_schema: https://w3id.org/lmodel/common-domain-model
    rank: 1000
    owner: Quantity
    domain_of:
    - MeasureBase
    - Schedule
    - DatedValue
    - Taxonomy
    - TaxonomyClassification
    - CodeValue
    - AdjustmentFactor
    - AccrualFactor
    - DisputeResolution
    - OtherEligibleAndPostedSupport
    - CSAThresholdVariableSet
    - CSAMinimumTransferAmountVariableSet
    - MasterAgreementVariableSet
    range: decimal
  unit:
    name: unit
    description: Qualifies the unit by which the amount is measured. Optional because
      a measure may be unit-less (e.g. when representing a ratio between amounts in
      the same unit).
    from_schema: https://w3id.org/lmodel/common-domain-model
    rank: 1000
    owner: Quantity
    domain_of:
    - MeasureBase
    - Qty
    - Term
    range: UnitType
rules:
- postconditions:
    slot_conditions:
      value:
        name: value
        required: true
      datedValue:
        name: datedValue
        required: false
  description: The amount must exist when the quantity represents a single value,
    and the steps must be absent.