Skip to content

Commit

Permalink
Add facilityType and update examples (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickevansuk authored Dec 7, 2021
1 parent 448e0cb commit 1074a32
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 41 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openactive/data-models",
"version": "2.0.255",
"version": "2.0.259",
"description": "Data models used to drive that OpenActive validator, developer documentation, and model libraries",
"homepage": "https://www.openactive.io",
"author": "OpenActive Community <[email protected]>",
Expand Down
38 changes: 15 additions & 23 deletions versions/2.x/examples/facilityuse_example_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
],
"@type": "FacilityUse",
"@id": "http://www.example.org/facility-uses/1",
"name": "Example Leisure Centre Outdoor Tennis",
"description": "Table courts are available to hire for thirty minute slots",
"activity": [
"name": "Outdoor Tennis",
"description": "Tennis courts are available to hire for thirty minute slots",
"facilityType": [
{
"@id": "https://openactive.io/activity-list#f2ea7405-6098-4378-b0fe-4e398a659fc4",
"inScheme": "https://openactive.io/activity-list",
"prefLabel": "Tennis",
"@type": "Concept"
"@type": "Concept",
"@id": "https://openactive.io/facility-types#bba8ae59-d152-40bc-85cc-88c5375696d4",
"prefLabel": "Tennis Court",
"inScheme": "https://openactive.io/facility-types"
}
],
"provider": {
Expand Down Expand Up @@ -155,27 +155,19 @@
"url": "http://example.org/images/1.jpg"
}
],
"beta:sportsActivityLocation": [
"individualFacilityUse": [
{
"@type": "SportsActivityLocation",
"name": "Main Tennis Court 1",
"containedInPlace": "http://www.example.org/api/locations/8958f9b8-2004-4e90-80ff-50c98a9b121d"
"@type": "IndividualFacilityUse",
"@id": "http://www.example.org/facility-uses/1/individual-facility-uses/1",
"name": "Main Tennis Court 1"
},
{
"@type": "SportsActivityLocation",
"name": "Main Tennis Court 2",
"containedInPlace": "http://www.example.org/api/locations/8958f9b8-2004-4e90-80ff-50c98a9b121d"
}
],
"beta:facilitySetting": "https://openactive.io/ns-beta#IndoorFacility",
"beta:facilityType": [
{
"@type": "Concept",
"@id": "https://openactive.io/facility-types#a5ac16fe-06ac-4bc1-93f7-69ff3bfcf3b9",
"prefLabel": "3G Artificial Grass",
"inScheme": "https://openactive.io/facility-types"
"@type": "IndividualFacilityUse",
"@id": "http://www.example.org/facility-uses/1/individual-facility-uses/2",
"name": "Main Tennis Court 2"
}
],
"beta:facilitySetting": "https://openactive.io/ns-beta#OutdoorFacility",
"offers": [
{
"@type": "Offer",
Expand Down
12 changes: 6 additions & 6 deletions versions/2.x/examples/slot_example_1.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"next": "http://www.example.org/feeds/facility-uses/events?afterChangeNumber=44254329",
"next": "http://www.example.org/feeds/individual-facility-use-slots?afterChangeNumber=44254329",
"items": [
{
"state": "updated",
"kind": "FacilityUse/Slot",
"kind": "IndividualFacilityUse/Slot",
"id": "009/2018-03-01T10:00:00Z",
"modified": 44234351,
"data": {
"@context": "https://openactive.io/",
"@type": "Slot",
"@id": "http://www.example.org/api/facility-uses/432#/event/2018-03-01T10:00:00Z",
"facilityUse": "http://www.example.org/api/facility-uses/432",
"@id": "http://www.example.org/facility-uses/1/individual-facility-uses/1#/slots/2018-03-01T10:00:00Z",
"facilityUse": "http://www.example.org/facility-uses/1/individual-facility-uses/1",
"startDate": "2018-03-01T11:00:00Z",
"endDate": "2018-03-01T11:30:00Z",
"duration": "PT30M",
"remainingUses": 3,
"maximumUses": 6,
"remainingUses": 1,
"maximumUses": 1,
"offers": [
{
"@type": "Offer",
Expand Down
42 changes: 37 additions & 5 deletions versions/2.x/models/FacilityUse.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@
"id",
"url",
"name",
"activity",
"location",
"provider"
],
"requiredOptions": [
{
"description": [
"Support for the `facilityType` property has been added to tooling and documentation ahead of inclusion in the next point release of the OpenActive Modelling Opportunity Data specification, as agreed on [the W3C call 2021-06-02](https://github.com/openactive/facility-types/issues/1#issuecomment-853759213). On this basis of this discussion, following the next point release, only `facilityType` will be required."
],
"options": [
"facilityType",
"activity"
]
}
],
"recommendedFields": [
"description",
"image",
Expand Down Expand Up @@ -41,7 +51,7 @@
"type",
"url",
"name",
"activity",
"facilityType",
"location"
],
"shallNotInclude": [
Expand All @@ -59,6 +69,7 @@
"name",
"description",
"image",
"facilityType",
"activity",
"location",
"event",
Expand Down Expand Up @@ -105,6 +116,23 @@
}
]
},
"facilityType": {
"fieldName": "facilityType",
"sameAs": "https://openactive.io/facilityType",
"model": "ArrayOf#Concept",
"description": [
"Specifies the types of facility being described.",
"NOTE: this property has been added to tooling and documentation ahead of inclusion in the next point release of the OpenActive Modelling Opportunity Data specification, as agreed on [the W3C call 2021-06-02](https://github.com/openactive/facility-types/issues/1#issuecomment-853759213)."
],
"example": [
{
"@type": "Concept",
"@id": "https://openactive.io/facility-types#bba8ae59-d152-40bc-85cc-88c5375696d4",
"prefLabel": "Tennis Court",
"inScheme": "https://openactive.io/facility-types"
}
]
},
"activity": {
"fieldName": "activity",
"sameAs": "https://openactive.io/activity",
Expand All @@ -119,7 +147,8 @@
"prefLabel": "Badminton",
"inScheme": "https://openactive.io/activity-list"
}
]
],
"deprecationGuidance": "Use `facilityType` instead of `activity` within `FacilityUse` and `IndividualFacilityUse`, as the `facilityType` controlled vocabulary has been designed specifically for facilities."
},
"attendeeInstructions": {
"fieldName": "attendeeInstructions",
Expand Down Expand Up @@ -222,10 +251,13 @@
"example": [
{
"@type": "IndividualFacilityUse",
"@id": "http://www.example.org/facility-uses/1",
"@id": "http://www.example.org/facility-uses/1/individual-facility-uses/1",
"name": "Tennis Court 1"
}
]
],
"inheritsTo": {
"exclude": ["id", "identifier", "individualFacilityUse", "name"]
}
},
"location": {
"fieldName": "location",
Expand Down
22 changes: 17 additions & 5 deletions versions/2.x/models/IndividualFacilityUse.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,24 @@
"id",
"url",
"name",
"activity",
"location",
"provider"
],
"requiredOptions": [
{
"description": [
"Support for the `facilityType` property has been added to tooling and documentation ahead of inclusion in the next point release of the OpenActive Modelling Opportunity Data specification, as agreed on [the W3C call 2021-06-02](https://github.com/openactive/facility-types/issues/1#issuecomment-853759213). On this basis of this discussion, following the next point release, only `facilityType` will be required."
],
"options": [
"facilityType",
"activity"
]
}
],
"recommendedFields": [
"description",
"image",
"hoursAvailable",
"aggregateFacilityUse",
"event"
"hoursAvailable"
],
"notInSpec": [
"individualFacilityUse"
Expand All @@ -31,6 +39,7 @@
"name",
"description",
"image",
"facilityType",
"activity",
"location",
"event",
Expand Down Expand Up @@ -58,7 +67,10 @@
"model": "#FacilityUse",
"description": [
"Inverse of the oa:individualFacilityUse property. Relates an oa:IndividualFacilityUse (e.g. an opportunity to play tennis on a specific court) to a oa:FacilityUse (e.g. an opportunity to play tennis at a specific location)."
]
],
"inheritsFrom": {
"exclude": ["id", "identifier", "aggregateFacilityUse", "name"]
}
},
"event": {
"fieldName": "event",
Expand Down

0 comments on commit 1074a32

Please sign in to comment.