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

View Source

The act of participating in an exchange of goods and services for monetary compensation. An agent trades an object, product or service with a participant in exchange for a one time or periodic payment.

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

Action inputs and outputs

This type descends from SEO.JSONLD.Action, so build/1 recognizes two pseudo-fields that expand into Schema.org's hyphenated <property>-input / <property>-output shorthand (see Schema.org Actions, Part 4):

  • :inputs — a keyword list of {property, constraints} entries
  • :outputs — likewise, for <property>-output annotations

Constraints are passed to SEO.JSONLD.Actions.input_spec/1.

Summary

Types

t()

A JSON-LD map ready to be nested or rendered. String-keyed, always includes "@type" set to "TradeAction", 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 TradeAction JSON-LD map.

Types

attrs()

@type attrs() ::
  %{
    optional(:price) => String.t() | number(),
    optional(:price_currency) => String.t(),
    optional(:price_specification) => SEO.JSONLD.PriceSpecification.t() | map(),
    optional(:action_process) => SEO.JSONLD.HowTo.t() | map(),
    optional(:action_status) =>
      :active_action_status
      | :completed_action_status
      | :failed_action_status
      | :potential_action_status,
    optional(:agent) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:end_time) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
    optional(:error) => SEO.JSONLD.Thing.t() | map(),
    optional(:instrument) => SEO.JSONLD.Thing.t() | map(),
    optional(:location) =>
      String.t()
      | SEO.JSONLD.PostalAddress.t()
      | map()
      | SEO.JSONLD.VirtualLocation.t()
      | SEO.JSONLD.Place.t(),
    optional(:object) => SEO.JSONLD.Thing.t() | map(),
    optional(:participant) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:provider) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:result) => SEO.JSONLD.Thing.t() | map(),
    optional(:start_time) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
    optional(:target) =>
      URI.t() | String.t() | SEO.JSONLD.EntryPoint.t() | map(),
    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()
  }
  | [
      price: String.t() | number(),
      price_currency: String.t(),
      price_specification: SEO.JSONLD.PriceSpecification.t() | map(),
      action_process: SEO.JSONLD.HowTo.t() | map(),
      action_status:
        :active_action_status
        | :completed_action_status
        | :failed_action_status
        | :potential_action_status,
      agent: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      end_time: DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
      error: SEO.JSONLD.Thing.t() | map(),
      instrument: SEO.JSONLD.Thing.t() | map(),
      location:
        String.t()
        | SEO.JSONLD.PostalAddress.t()
        | map()
        | SEO.JSONLD.VirtualLocation.t()
        | SEO.JSONLD.Place.t(),
      object: SEO.JSONLD.Thing.t() | map(),
      participant: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      provider: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      result: SEO.JSONLD.Thing.t() | map(),
      start_time: DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
      target: URI.t() | String.t() | SEO.JSONLD.EntryPoint.t() | map(),
      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 "TradeAction", 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 TradeAction JSON-LD map.

Fields

  • :price - The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes.

Usage guidelines:

  • Use the priceCurrency property (with 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") instead of including ambiguous symbols such as '$' in the value.
  • Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
  • Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting.
  • Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.

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".

  • :price_specification - One or more detailed price specifications, indicating the unit price and delivery or payment charges.

Inherited properties

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