openactive / implementation-tracker

Activation Issue Tracker for OpenActive Implementations
1 stars 2 forks source link

Open Sessions Example #107

Closed petermeldrum closed 1 year ago

petermeldrum commented 6 years ago
{
   "id":58,
   "state":"updated",
   "kind":"session",
   "modified":"2018-01-16T14:32:45Z",
   "url":"http://differenzuat.com/opensessionsportal/#/Organisation/SessionDetail?OrganisationId=10&SessionId=16",
   "name":"Surat cricket",
   "description":"11 players",
   "image":"http://differenzuat.com/opensessionsapi/Content/Session/Session_20180116014625.jpeg",
   "startDate":"2018-02-19T06:30:00Z",
   "endDate":"2018-02-19T07:00:00Z",
   "duration":"PT30M",
   "activity":[
      "Billiards",
      "Tyga®"
   ],
   "ageRange":"25-30",
   "genderRestriction":"Female",
   "attendeeInstructions":"No",
   "accessibilitySupport":[
      "Learning Disability",
      "Physical impairment",
      "Mental Health Condition",
      "Deaf"
   ],
   "isCoached":true,
   "isAccessibleForFree":true,
   "organizer":{
      "type":"Organization",
      "url":"http://differenzuat.com/opensessionsportal/#/Organisation/OrganisationDetail?OrganisationId=10",
      "name":"Diffrenz Toopers",
      "description":"11 players",
      "logo":"http://differenzuat.com/opensessionsapi/Content/Organisation/Organisation_10.jpeg",
      "sameAs":[
         "www.google.com",
         "satyam62142801"
      ]
   },
   "contributor":{
      "name":"samy",
      "email":"samy@gmail.com",
      "telephone":"+917567791641"
   },
   "beta:isFirstSessionAccessibleForFree":false,
   "location":{
      "address":"surat",
      "geo":{
         "latitude":72.808128,
         "longitude":0
      }
   },
   "leader":{
      "name":"samy"
   }
}
ldodds commented 6 years ago

@petermeldrum am not sure if this is a formatting issue with the github, but it looks like you're mixing up fields from the RPDE spec (state, kind, modified) with those from the modelling spec.

Your RDPE feed should look like:

{
 "next": "...",
 "license": "...",
 "items": [
   {
     "state": "...",
     "modified": "...",
     "type": "...",
     "id": "...",
     "data": {
        ...fields describing the session from the modelling spec...name, url, etc
     }
   },
   {
   ...
   }
 ]
}

So the items array contains a set of objects with a fixed set of properties, all of which are required.

The data property for each of those items provides the detail on the Event that has been created, modified, etc.

The sameAs property also looks incorrect. Its value(s) should be other web pages that also identify the Event. I'm not sure you actually need it, so would suggest removing.

Also, the attendeeInstructions property should have additional instructions for attendees. If you don't have any, then omit the property, rather than including the value "No".

Hope that helps!

petermeldrum commented 6 years ago

Apologies I think part of it is a formatting issue with GitHub. Here's the test endpoint: http://differenzuat.com/opensessionsapi/api/session/GetSessionsForOpenActive

petermeldrum commented 6 years ago

Hi @ldodds, thanks for the feedback.

Just to confirm:

Thanks again,

petermeldrum commented 6 years ago

Hi @ldodds Can I just check whether I have it correct in the previous message.

If we have values then the field should show, if we do not have values then it should be hidden rather than stating No.

Thanks

Pete

nickevansuk commented 6 years ago

Hi @petermeldrum ,

Yep that's right "if we do not have values then it should be hidden rather than stating No.".

The text value "No" would be read as data, and "No" would appear in data consumers websites (e.g. Get Active). Where a property is empty, it should be hidden. If this is particularly hard to do you can also set it to null.

So for an empty property named "emptyProperty" either hide it as follows (it's hidden so you can't see it at all):

{
   "propertyWithValue": "some useful value"
}

or set it to null:

{
   "propertyWithValue": "some useful value",
   "emptyProperty": null
}
petermeldrum commented 6 years ago

Hi @nickevansuk

It turns out that the test data had 'no' written in the fields. The fields will not display if no value is contained. Would you mind taking a final look before I sign off:

http://differenzuat.com/opensessionsapi/api/session/GetSessionsForOpenActive

Thanks again!

petermeldrum commented 6 years ago

Hi @ldodds and @nickevansuk would be really grateful if one of you could confirm Open Sessions new feed is compliant. We are hoping to switch the sites ASAP and I'd like to make sure I have this correct before going live!

nickevansuk commented 6 years ago

In order to have the data conform to the modelling specification, comments are included below:

{
  "next": "http://differenzuat.com/opensessionsapi/api/Session/GetSessionsForOpenActive?afterTimestamp=1520317800&afterId=136",
  "items": [{
    "id": 127,
    "state": "updated",
    "kind": "session",
    "modified": 1520317800, /* must match format of afterTimestamp in next URL */
    "data": {
      "@context": [ /* Add context */
        "https://www.openactive.io/ns/oa.jsonld",
        "https://www.openactive.io/ns-beta/oa.jsonld"
      ],
      "type": "Event", /* Added type */
      "url": "http://differenzuat.com/opensessionsportal/#/Organisation/SessionDetail?OrganisationId=44&SessionId=65",
      "name": "Hartford Football",
      "description": "24 Playerss",
      "image": "http://differenzuat.com/opensessionsapi/Content/Session/Session_20180215045119.jpeg",
      "startDate": "2018-03-06T06:30:00Z",
      "endDate": "2018-03-06T07:00:00Z",
      "duration": "PT30M",
      "activity": [
        "Airgun" /* Are you drawing this from the OpenActive activity list? */
      ],
      "ageRange": "16-55", /* include age range, it's currently missing */
      "genderRestriction": "Mixed", /* lowercase 'mixed' */
      "attendeeInstructions": "-",
      "accessibilitySupport": [
        "Learning Disability",
        "Physical impairment",
        "Visual Impairment",
        "Mental Health Condition",
        "Deaf",
        "Please Ask For More Info"
      ],
      "isCoached": false,
      "meetingPoint": "10 to 11 AM IST",
      "isAccessibleForFree": false,
      "organizer": {
        "type": "Organization",
        "url": "http://differenzuat.com/opensessionsportal/#/Organisation/OrganisationDetail?OrganisationId=44",
        "name": "Tampa River",
        "description": "Good.",
        "sameAs": [
          "www.Google.com" /* Ensure this social media address is well formed (e.g. includes 'http://' or 'https://') */
        ]
      },
      "beta:contactPoint": { /* As the contact details are primarily for a point of contact, suggest using contactPoint */
        "type": "ContactPoint", /* Add type */
        "name": "caru",
        "email": "caru07@yopmail.com",
        "telephone": "7894561230"
      },
      "offers": [{
        "type": "Offer", /* Add type */
        "price": "100.00",
        "priceCurrency": "GBP",
        "acceptedPaymentMethod": [
          "Cash" /* This should be a string from http://schema.org/PaymentMethod such as "http://purl.org/goodrelations/v1#Cash" or "http://purl.org/goodrelations/v1#PaymentMethodCreditCard" not just "Cash" */
        ]
      }],
      "beta:isFirstSessionAccessibleForFree": false,
      "location": {
        "type": "Place" /* Add type */
        "address": {
          "type": "PostalAddress", /* Add type */
          "streetAddress": "Birch Grove",
          "addressLocality": "Waltham Forest", /* City or Borough */
          "addressRegion": "Greater London", /* County */
          "addressCountry": "GB", /* Always 'GB' for UK */
          "postalCode": "E11 4YG"
        },
        "geo": {
          "type": "GeoCoordinates", /* Add type */
          "latitude": 72.808128,
          "longitude": 0
        }
      },
      "leader": {
        "type": "Person", /* Add type */
        "name": "jem"
      }
    }
  }],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}

Three additional comments:

nickevansuk commented 6 years ago

@petermeldrum

Copying your message here:

In "Monthly" and "Yearly" we have two options to schedule sessions. In that second option for both monthly and yearly we can schedule like Monthly : One "First" Monday of every _ Months Yearly : One "First" Monday of every January every year.

Here I cannot find how this data will be set in open active above options.

I cannot find on given URL "https://www.openactive.io/modelling-opportunity-data/#describing-scheduled-events" how this data can be displayed?

See this example for when Bookwhen did the same: https://github.com/openactive/activation/issues/6#issuecomment-312423917

Suggest using the same as Greg

For "every 2nd Thursday of the month":

"eventSchedule": {
  ...
  "byDay": "2TH",
  ...
}

For "First" Monday of every January every year use byMonth.

"eventSchedule": {
  ...
  "byDay": "1MO",
  "byMonth": 1,
  "frequency": "yearly"
  ...
}

@ldodds note we should allow byDay format above in schema as per previous discussion, as this is the second instance of this question.

nickevansuk commented 6 years ago

Apologies also just realised that you're missing the full address block, which must be split down into components:

        "address": {
          "type": "PostalAddress", /* Add type */
          "streetAddress": "Birch Grove",
          "addressLocality": "Waltham Forest", /* City or Borough */
          "addressRegion": "Greater London", /* County */
          "addressCountry": "GB", /* Always 'GB' for UK */
          "postalCode": "E11 4YG"
        },

You should be able to get these address components from your autocomplete.

petermeldrum commented 6 years ago

Hi @nickevansuk @ldodds

We're having a few issues getting the new Open Sessions feed to come through the imin API correctly. One of the issues that the imin team have flagged is that the feed isn't entirely compliant. I'd be really grateful if one of you wouldn't mind having a quick look at our current endpoint and checking for any potential issues that anyone might need to correct or work around when trying to use the feed?

I can pay in chocolate or coffee,

Thanks, Pete

petermeldrum commented 5 years ago

Hi Nick,

As discussed it would be great to get some support to resolve some of the issues with our endpoint identified by the endpoint.

image

image

Resolution: (please see 5.6.8.1- https://www.openactive.io/modelling-opportunity-data/#namespaces) We should be defining either “SessionSeries” - the overall series of events, e.g. Wednesday Yoga “ScheduledSession” - the individual sessions, e.g. Wednesday Yoga on 5th September 2018

petermeldrum commented 5 years ago

We also have a whole bunch of 404 errors:

image

image

image

image

image

petermeldrum commented 5 years ago

image

image

petermeldrum commented 5 years ago

image

image

petermeldrum commented 5 years ago

image

image

nickevansuk commented 5 years ago

@petermeldrum the validator has now been updated so all those errors include better explanations. Let me know if you think that covers it?

Additionally:

Sorry if these answers are indirect, but it helps make sure the tool does my job better than i do :)