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

View Source

An event happening at a certain time and location, such as a concert, lecture, or festival. Ticketing information may be added via the offers property. Repeated events may be structured as separate Event objects.

Event rich-result example Event rich-result example

Example

SEO.JSONLD.Event.build(%{
  name: "ElixirConf 2024",
  start_date: ~D[2024-08-28],
  end_date: ~D[2024-08-30],
  event_status: :event_scheduled,
  event_attendance_mode: :offline_event_attendance_mode,
  location:
    SEO.JSONLD.Place.build(%{
      name: "Gaylord Rockies",
      address:
        SEO.JSONLD.PostalAddress.build(%{
          street_address: "6700 N Gaylord Rockies Blvd",
          address_locality: "Aurora",
          address_region: "CO",
          postal_code: "80019"
        })
    }),
  organizer: SEO.JSONLD.Organization.build(%{name: "DockYard"}),
  offers:
    SEO.JSONLD.Offer.build(%{
      price: "599",
      price_currency: "USD",
      availability: :in_stock
    })
})

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

Summary

Types

t()

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

Types

attrs()

@type attrs() ::
  %{
    optional(:about) => SEO.JSONLD.Thing.t() | map(),
    optional(:actor) =>
      SEO.JSONLD.Person.t() | map() | SEO.JSONLD.PerformingGroup.t(),
    optional(:aggregate_rating) => SEO.JSONLD.AggregateRating.t() | map(),
    optional(:attendee) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:attendees) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:audience) => SEO.JSONLD.Audience.t() | map(),
    optional(:composer) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:contributor) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:director) => SEO.JSONLD.Person.t() | map(),
    optional(:door_time) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
    optional(:duration) =>
      Duration.t() | String.t() | SEO.JSONLD.QuantitativeValue.t() | map(),
    optional(:end_date) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
    optional(:event_attendance_mode) =>
      :mixed_event_attendance_mode
      | :offline_event_attendance_mode
      | :online_event_attendance_mode,
    optional(:event_schedule) => SEO.JSONLD.Schedule.t() | map(),
    optional(:event_status) =>
      :event_cancelled
      | :event_moved_online
      | :event_postponed
      | :event_rescheduled
      | :event_scheduled,
    optional(:funder) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:funding) => SEO.JSONLD.Grant.t() | map(),
    optional(:has_participation_offer) => SEO.JSONLD.Offer.t() | map(),
    optional(:has_sponsorship_offer) => SEO.JSONLD.Offer.t() | map(),
    optional(:in_language) => String.t() | SEO.JSONLD.Language.t() | map(),
    optional(:is_accessible_for_free) => boolean(),
    optional(:keywords) =>
      SEO.JSONLD.DefinedTerm.t() | map() | String.t() | URI.t(),
    :location =>
      String.t()
      | SEO.JSONLD.PostalAddress.t()
      | map()
      | SEO.JSONLD.VirtualLocation.t()
      | SEO.JSONLD.Place.t(),
    optional(:maximum_attendee_capacity) => integer(),
    optional(:maximum_physical_attendee_capacity) => integer(),
    optional(:maximum_virtual_attendee_capacity) => integer(),
    optional(:offers) => SEO.JSONLD.Offer.t() | map() | SEO.JSONLD.Demand.t(),
    optional(:organizer) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:performer) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:performers) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:previous_start_date) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
    optional(:recorded_in) => SEO.JSONLD.CreativeWork.t() | map(),
    optional(:remaining_attendee_capacity) => integer(),
    optional(:review) => SEO.JSONLD.Review.t() | map(),
    optional(:sponsor) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    :start_date => Date.t() | String.t() | DateTime.t() | NaiveDateTime.t(),
    optional(:sub_event) => t() | map(),
    optional(:sub_events) => t() | map(),
    optional(:super_event) => t() | map(),
    optional(:translator) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:typical_age_range) => String.t(),
    optional(:work_featured) => SEO.JSONLD.CreativeWork.t() | map(),
    optional(:work_performed) => SEO.JSONLD.CreativeWork.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(),
    :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) => t() | map() | SEO.JSONLD.CreativeWork.t(),
    optional(:url) => URI.t() | String.t()
  }
  | [
      about: SEO.JSONLD.Thing.t() | map(),
      actor: SEO.JSONLD.Person.t() | map() | SEO.JSONLD.PerformingGroup.t(),
      aggregate_rating: SEO.JSONLD.AggregateRating.t() | map(),
      attendee: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      attendees: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      audience: SEO.JSONLD.Audience.t() | map(),
      composer: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      contributor: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      director: SEO.JSONLD.Person.t() | map(),
      door_time: DateTime.t() | NaiveDateTime.t() | String.t() | Time.t(),
      duration:
        Duration.t() | String.t() | SEO.JSONLD.QuantitativeValue.t() | map(),
      end_date: DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
      event_attendance_mode:
        :mixed_event_attendance_mode
        | :offline_event_attendance_mode
        | :online_event_attendance_mode,
      event_schedule: SEO.JSONLD.Schedule.t() | map(),
      event_status:
        :event_cancelled
        | :event_moved_online
        | :event_postponed
        | :event_rescheduled
        | :event_scheduled,
      funder: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      funding: SEO.JSONLD.Grant.t() | map(),
      has_participation_offer: SEO.JSONLD.Offer.t() | map(),
      has_sponsorship_offer: SEO.JSONLD.Offer.t() | map(),
      in_language: String.t() | SEO.JSONLD.Language.t() | map(),
      is_accessible_for_free: boolean(),
      keywords: SEO.JSONLD.DefinedTerm.t() | map() | String.t() | URI.t(),
      location:
        String.t()
        | SEO.JSONLD.PostalAddress.t()
        | map()
        | SEO.JSONLD.VirtualLocation.t()
        | SEO.JSONLD.Place.t(),
      maximum_attendee_capacity: integer(),
      maximum_physical_attendee_capacity: integer(),
      maximum_virtual_attendee_capacity: integer(),
      offers: SEO.JSONLD.Offer.t() | map() | SEO.JSONLD.Demand.t(),
      organizer: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      performer: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      performers: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      previous_start_date:
        DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
      recorded_in: SEO.JSONLD.CreativeWork.t() | map(),
      remaining_attendee_capacity: integer(),
      review: SEO.JSONLD.Review.t() | map(),
      sponsor: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      start_date: Date.t() | String.t() | DateTime.t() | NaiveDateTime.t(),
      sub_event: t() | map(),
      sub_events: t() | map(),
      super_event: t() | map(),
      translator: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      typical_age_range: String.t(),
      work_featured: SEO.JSONLD.CreativeWork.t() | map(),
      work_performed: SEO.JSONLD.CreativeWork.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: 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 "Event", 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 Event JSON-LD map.

Fields

  • :about - The subject matter of an object.
  • :actor - An actor (individual or a group), e.g. in TV, radio, movie, video games etc., or in an event. Actors can be associated with individual items or with a series, episode, clip.
  • :aggregate_rating - The overall rating, based on a collection of reviews or ratings, of the item.
  • :attendee - A person or organization attending the event.
  • :attendees - A person attending the event.
  • :audience - An intended audience, i.e. a group for whom something was created.
  • :composer - The person or organization who wrote a composition, or who is the composer of a work performed at some event.
  • :contributor - A secondary contributor to the CreativeWork or Event.
  • :director - A director of e.g. TV, radio, movie, video gaming etc. content, or of an event. Directors can be associated with individual items or with a series, episode, clip.
  • :door_time - The time admission will commence.
  • :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).
  • :event_attendance_mode - The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix. One of: :mixed_event_attendance_mode, :offline_event_attendance_mode, :online_event_attendance_mode.
  • :event_schedule - Associates an SEO.JSONLD.Event with a SEO.JSONLD.Schedule. There are circumstances where it is preferable to share a schedule for a series of repeating events rather than data on the individual events themselves. For example, a website or application might prefer to publish a schedule for a weekly gym class rather than provide data on every event. A schedule could be processed by applications to add forthcoming events to a calendar. An SEO.JSONLD.Event that is associated with a SEO.JSONLD.Schedule using this property should not have startDate or endDate properties. These are instead defined within the associated SEO.JSONLD.Schedule, this avoids any ambiguity for clients using the data. The property might have repeated values to specify different schedules, e.g. for different months or seasons.
  • :event_status - An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled. One of: :event_cancelled, :event_moved_online, :event_postponed, :event_rescheduled, :event_scheduled.
  • :funder - A person or organization that supports (sponsors) something through some kind of financial contribution.
  • :funding - A SEO.JSONLD.Grant that directly or indirectly provide funding or sponsorship for this item. See also ownershipFundingInfo.
  • :has_participation_offer - An offer to participate in the event, for example, Call for Proposals, Call for Speakers, or Call for Performers.
  • :has_sponsorship_offer - An offer to sponsor the event, for example, Sponsorship Prospectus, Sponsorship Opportunities, or Sponsor Packages.
  • :in_language - The language of the content or performance or used in an action. Please use one of the language codes from the IETF BCP 47 standard. See also availableLanguage.
  • :is_accessible_for_free - A flag to signal that the item, event, or place is accessible for free.
  • :keywords - Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
  • :location - The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
  • :maximum_attendee_capacity - The total number of individuals that may attend an event or venue.
  • :maximum_physical_attendee_capacity - The maximum physical attendee capacity of an SEO.JSONLD.Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).
  • :maximum_virtual_attendee_capacity - The maximum virtual attendee capacity of an SEO.JSONLD.Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).
  • :offers - An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use businessFunction to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a SEO.JSONLD.Demand. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
  • :organizer - An organizer of an Event.
  • :performer - A performer at the event—for example, a presenter, musician, musical group or actor.
  • :performers - The main performer or performers of the event—for example, a presenter, musician, or actor.
  • :previous_start_date - Used in conjunction with eventStatus for rescheduled or cancelled events. This property contains the previously scheduled start date. For rescheduled events, the startDate property should be used for the newly scheduled start date. In the (rare) case of an event that has been postponed and rescheduled multiple times, this field may be repeated.
  • :recorded_in - The CreativeWork that captured all or part of this Event.
  • :remaining_attendee_capacity - The number of attendee places for an event that remain unallocated.
  • :review - A review of the item.
  • :sponsor - A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
  • :start_date - The start date and time of the item (in ISO 8601 date format).
  • :sub_event - An Event that is part of this event. For example, a conference event includes many presentations, each of which is a subEvent of the conference.
  • :sub_events - Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.
  • :super_event - An event that this event is a part of. For example, a collection of individual music performances might each have a music festival as their superEvent.
  • :translator - Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
  • :typical_age_range - The typical expected age range, e.g. '7-9', '11-'.
  • :work_featured - A work featured in some event, e.g. exhibited in an ExhibitionEvent. Specific subproperties are available for workPerformed (e.g. a play), or a workPresented (a Movie at a ScreeningEvent).
  • :work_performed - A work performed in some event, for example a play performed in a TheaterEvent.

Inherited properties

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