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

View Source

A schedule defines a repeating time period used to describe a regularly occurring SEO.JSONLD.Event. At a minimum a schedule will specify repeatFrequency which describes the interval between occurrences of the event. Additional information can be provided to specify the schedule more precisely. This includes identifying the day(s) of the week or month when the recurring event will take place, in addition to its start and end time. Schedules may also have start and end dates to indicate when they are active, e.g. to define a limited calendar of events.

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

Summary

Types

t()

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

Types

attrs()

@type attrs() ::
  %{
    optional(:by_day) =>
      String.t()
      | :friday
      | :monday
      | :public_holidays
      | :saturday
      | :sunday
      | :thursday
      | :tuesday
      | :wednesday,
    optional(:by_month) => integer(),
    optional(:by_month_day) => integer(),
    optional(:by_month_week) => integer(),
    optional(:duration) =>
      Duration.t() | String.t() | SEO.JSONLD.QuantitativeValue.t() | map(),
    optional(:end_date) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
    optional(:end_time) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
    optional(:except_date) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
    optional(:repeat_count) => integer(),
    optional(:repeat_frequency) => String.t() | Duration.t(),
    optional(:schedule_timezone) => String.t(),
    optional(:start_date) =>
      Date.t() | String.t() | DateTime.t() | NaiveDateTime.t(),
    optional(:start_time) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
    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()
  }
  | [
      by_day:
        String.t()
        | :friday
        | :monday
        | :public_holidays
        | :saturday
        | :sunday
        | :thursday
        | :tuesday
        | :wednesday,
      by_month: integer(),
      by_month_day: integer(),
      by_month_week: integer(),
      duration:
        Duration.t() | String.t() | SEO.JSONLD.QuantitativeValue.t() | map(),
      end_date: DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
      end_time: DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
      except_date: DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
      repeat_count: integer(),
      repeat_frequency: String.t() | Duration.t(),
      schedule_timezone: String.t(),
      start_date: Date.t() | String.t() | DateTime.t() | NaiveDateTime.t(),
      start_time: DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
      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 "Schedule", 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 Schedule JSON-LD map.

Fields

  • :by_day - Defines the day(s) of the week on which a recurring SEO.JSONLD.Event takes place. May be specified using either DayOfWeek, or alternatively Text conforming to iCal's syntax for byDay recurrence rules. One of: :friday, :monday, :public_holidays, :saturday, :sunday, :thursday, :tuesday, :wednesday.
  • :by_month - Defines the month(s) of the year on which a recurring SEO.JSONLD.Event takes place. Specified as an Integer between 1-12. January is 1.
  • :by_month_day - Defines the day(s) of the month on which a recurring SEO.JSONLD.Event takes place. Specified as an Integer between 1-31.
  • :by_month_week - Defines the week(s) of the month on which a recurring Event takes place. Specified as an Integer between 1-5. For clarity, byMonthWeek is best used in conjunction with byDay to indicate concepts like the first and third Mondays of a month.
  • :duration - The duration of the item (movie, audio recording, event, etc.) in ISO 8601 duration format.
  • :end_date - The end date and time of the item (in ISO 8601 date format).
  • :end_time - The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to December. For media, including audio and video, it's the time offset of the end of a clip within a larger file.

Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.

  • :except_date - Defines a Date or DateTime during which a scheduled SEO.JSONLD.Event will not take place. The property allows exceptions to a SEO.JSONLD.Schedule to be specified. If an exception is specified as a DateTime then only the event that would have started at that specific date and time should be excluded from the schedule. If an exception is specified as a Date then any event that is scheduled for that 24 hour period should be excluded from the schedule. This allows a whole day to be excluded from the schedule without having to itemise every scheduled event.
  • :repeat_count - Defines the number of times a recurring SEO.JSONLD.Event will take place.
  • :repeat_frequency - Defines the frequency at which SEO.JSONLD.Events will occur according to a schedule SEO.JSONLD.Schedule. The intervals between events should be defined as a Duration of time.
  • :schedule_timezone - Indicates the timezone for which the time(s) indicated in the SEO.JSONLD.Schedule are given. The value provided should be among those listed in the IANA Time Zone Database.
  • :start_date - The start date and time of the item (in ISO 8601 date format).
  • :start_time - The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.

Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.

Inherited properties

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