openactive / realtime-paged-data-exchange

OpenActive Realtime Paged Data Exchange Specification
https://www.openactive.io/realtime-paged-data-exchange/
Other
6 stars 1 forks source link

Bring RPDE in line with JSON-LD and remove duplication #90

Open nickevansuk opened 6 years ago

nickevansuk commented 6 years ago

Proposer

ODI

Requirements

Proposal

Example

{
  "@context": "https://openactive.io/",
  "type": "RealtimePage"
  "next": "http://api.letsride.co.uk/public/v1/rides?afterModified=2018-09-30T18%3A45%3A10.263Z&afterId=http%3A%2F%2Fwww.example.com%2Fevents%2F2710",
  "item": [
    {
      "@id": "http://www.example.com/events/2710",
      "@type": "SessionSeries",
      "@modified": "2018-09-30T18:45:10.242Z",
      "name": "Speedball",
      "offers": [
        {
          "@type": "Offer",
          "@id": "https://example.com/events/2710#/offers/878",
          "validThrough": "2018-10-29T11:00:00Z",
          "validFrom": "2018-10-01T11:00:00Z",
          "description": "Winger space for Speedball.",
          "name": "Speedball winger position",
          "price": 10.00,
          "priceCurrency": "GBP",
          "isCancellable": true,
          "cancellationValidUntil": "2018-10-28T11:00:00Z"
        }
      ],
      "duration": "PT1H",
      "organizer": {
        "@type": "Organization",
        "name": "Central Speedball Association",
        "url": "http://www.speedball-world.com",
        "termsOfService": { "type": "TermsOfService", "url": "url"}
      },
    },
    {
      "@id": "http://www.example.com/events/2710",
      "@type": "SessionSeries",
      "@modified": "2018-09-30T18:45:10.263Z",
      "@deleted": true
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}

Open questions

nickevansuk commented 6 years ago

Now depends on https://github.com/openactive/opportunity-api/issues/10

nickevansuk commented 5 years ago

Just to note that schema.org has since introduced https://schema.org/DataFeed and https://schema.org/DataFeedItem, which are both applicable here.

A suggested mapping of the current RPDE terms to schema.org (also picking up on the points in https://github.com/openactive/realtime-paged-data-exchange/issues/54), is as follows:

RPDE 1.0 Class Property Type
next oa:RealtimePagedDataFeed oa:nextUrl schema:URL
items oa:RealtimePagedDataFeed schema:dataFeedElement Array of schema:DataFeedItem
license oa:RealtimePagedDataFeed schema:license schema:URL
oa:RealtimePagedDataFeed schema:schemaVersion schema:URL
state schema:DataFeedItem oa:itemDeleted schema:Boolean
kind schema:DataFeedItem schema:item.@type schema:Property
id schema:DataFeedItem schema:identifier schema:Text OR schema:Integer
modified schema:DataFeedItem schema:version schema:Integer
data schema:DataFeedItem schema:item schema:Thing

A few notes on this mapping:

{
  "@context": "https://openactive.io/",
  "@type": "RealtimePagedDataFeed",
  "nextUrl": "http://www.example.com/api/rpde/sessions?afterTimestamp=1453931925&afterIdentifier=%7Bd97f73fb-4718-48ee-a6a9-9c7d717ebd85%7D",
  "dataFeedElement": [
    {
      "@type": "DataFeedItem",
      "identifier": "{c15814e5-8931-470c-8a16-ef45afedaece}",
      "version": 1453931101,
      "item": {
        "@type": "Event",
        "@id": "https://bookingsystem.com/hulahoop/e/ev-ssyp-20160509191500",
        "identifier": "session-01jz93i3k1p3",
        "startDate": "2016-05-09T18:15:00Z",
        "endDate": "2016-05-09T19:15:00Z",
        "remainingAttendeeCapacity": 0,
        "url": "https://bookingsystem.com/hulahoop/e/ev-ssyp-20160509191500?r=oa",
        "attendanceCount": 29,
        "location": {
          "@type": "Place",
          "identifier": "location-jbnentuhxsnp",
          "url": "https://leisurecentre.org.uk/leisure-centre/camden/kentish-town-sports-centre",
          "name": "Kentish Town Sports Centre",
          "address": {
            "@type": "PostalAddress",
            "addressLocality": "Camden",
            "addressRegion": "London West",
            "postalCode": "NW5 3DU",
            "streetAddress": "Kentish Town Sports Centre"
          }
        }
      }
    },
    {
      "@type": "DataFeedItem",
      "identifier": "{c15814e5-8931-470c-8a16-ef45afedaece}",
      "version": 1453931925,
      "itemDeleted": true,
      "item": {
        "@type": "Event"
      }
    }
  ],
  "schemaVersion": "https://www.openactive.io/modelling-opportunity-data/2.0",
  "license": "https://creativecommons.org/licenses/by/4.0/"
}