openactive-archive / opportunity-api

Repository for the Opportunity API specification
0 stars 0 forks source link

Filtering Events with Collections #7

Open nickevansuk opened 6 years ago

nickevansuk commented 6 years ago

Use Case

As an API consumer, I want to be able to query for Events which have activities which are part of a collection, and display these collections alongside Events to show which categories they include.

Why is this not covered by existing properties?

Events are currently not linked to Collections, as the there is no inverse to skos:member.

Proposal

To display collections, add a collection property to skos:Concept, to allow activities to include related Collections.

To query for Events, use a filter such as activity.collection=9ee740d4-b3b0-43ad-94b2-27f398ba5f2f

Example

{
  "type": "Event",
  "activity": [
    {
      "id": "http://openactive.io/activity-list/#22584a2a-fafc-4710-863c-8a1fc3f96b2c",
      "type": "Concept",
      "prefLabel": "Aikido",
      "inScheme": "http://openactive.io/activity-list/",
      "collection": [
        {
          "id": "http://emduk.org/openactive-collection/#9ee740d4-b3b0-43ad-94b2-27f398ba5f2f",
          "type": "skos:Collection",
          "prefLabel": "Holistic Activities",
          "definition": "Stuff that makes you feel whole",
        }
      ]
    }
  ]
}