SEO.JSONLD.MonetaryAmount (SEO v0.3.0-rc.0)

View Source

A monetary value or range. This type can be used to describe an amount of money such as $50 USD, or a range as in describing a bank account being suitable for a balance between £1,000 and £1,000,000 GBP, or the value of a salary, etc. It is recommended to use SEO.JSONLD.PriceSpecification Types to describe the price of an Offer, Invoice, etc.

Helper for building a Schema.org MonetaryAmount JSON-LD structure.

Summary

Types

t()

A JSON-LD map ready to be nested or rendered. String-keyed, always includes "@type" set to "MonetaryAmount", plus any camelCased field keys the caller provided (see build/1). "@context" is added at render time by SEO.JSONLD.meta/1 on the top-level node only.

Functions

Build a MonetaryAmount JSON-LD map.

Types

attrs()

@type attrs() ::
  %{
    optional(:currency) => String.t(),
    optional(:max_value) => number(),
    optional(:min_value) => number(),
    optional(:valid_from) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
    optional(:valid_through) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
    optional(:value) =>
      SEO.JSONLD.StructuredValue.t() | map() | String.t() | number() | boolean(),
    optional(:additional_type) => String.t() | URI.t(),
    optional(:alternate_name) => String.t(),
    optional(:description) => SEO.JSONLD.TextObject.t() | map() | String.t(),
    optional(:disambiguating_description) => String.t(),
    optional(:identifier) =>
      String.t() | URI.t() | SEO.JSONLD.PropertyValue.t() | map(),
    optional(:image) =>
      URI.t() | String.t() | SEO.JSONLD.ImageObject.t() | map(),
    optional(:main_entity_of_page) =>
      SEO.JSONLD.CreativeWork.t() | map() | URI.t() | String.t(),
    optional(:name) => String.t(),
    optional(:owner) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:potential_action) => SEO.JSONLD.Action.t() | map(),
    optional(:same_as) => URI.t() | String.t(),
    optional(:subject_of) =>
      SEO.JSONLD.Event.t() | map() | SEO.JSONLD.CreativeWork.t(),
    optional(:url) => URI.t() | String.t()
  }
  | [
      currency: String.t(),
      max_value: number(),
      min_value: number(),
      valid_from: DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
      valid_through: DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
      value:
        SEO.JSONLD.StructuredValue.t()
        | map()
        | String.t()
        | number()
        | boolean(),
      additional_type: String.t() | URI.t(),
      alternate_name: String.t(),
      description: SEO.JSONLD.TextObject.t() | map() | String.t(),
      disambiguating_description: String.t(),
      identifier: String.t() | URI.t() | SEO.JSONLD.PropertyValue.t() | map(),
      image: URI.t() | String.t() | SEO.JSONLD.ImageObject.t() | map(),
      main_entity_of_page:
        SEO.JSONLD.CreativeWork.t() | map() | URI.t() | String.t(),
      name: String.t(),
      owner: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      potential_action: SEO.JSONLD.Action.t() | map(),
      same_as: URI.t() | String.t(),
      subject_of: SEO.JSONLD.Event.t() | map() | SEO.JSONLD.CreativeWork.t(),
      url: URI.t() | String.t()
    ]

t()

@type t() :: %{required(String.t()) => term()}

A JSON-LD map ready to be nested or rendered. String-keyed, always includes "@type" set to "MonetaryAmount", plus any camelCased field keys the caller provided (see build/1). "@context" is added at render time by SEO.JSONLD.meta/1 on the top-level node only.

Functions

build(attrs)

@spec build(attrs()) :: t()

Build a MonetaryAmount JSON-LD map.

Fields

  • :currency - The currency in which the monetary amount is expressed.

Use standard formats: ISO 4217 currency format, e.g. "USD"; Ticker symbol for cryptocurrencies, e.g. "BTC"; well known names for Local Exchange Trading Systems (LETS) and other currency types, e.g. "Ithaca HOUR".

  • :max_value - The upper value of some characteristic or property.
  • :min_value - The lower value of some characteristic or property.
  • :valid_from - The date when the item becomes valid.
  • :valid_through - The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.
  • :value - The value of a SEO.JSONLD.QuantitativeValue (including SEO.JSONLD.Observation) or property value node.
  • For SEO.JSONLD.QuantitativeValue and SEO.JSONLD.MonetaryAmount, the recommended type for values is 'Number'.
  • For SEO.JSONLD.PropertyValue, it can be 'Text', 'Number', 'Boolean', or 'StructuredValue'.
  • Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.
  • Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.

Inherited properties

Additional properties are available through the inheritance chain. See each ancestor's docs for its properties: