Skip to content

Commit

Permalink
Merge pull request #430 from cookeac/location-observation-383
Browse files Browse the repository at this point in the history
Define position observations. Resolves #383
  • Loading branch information
cookeac authored May 16, 2024
2 parents df6e1b3 + 679c13d commit 68fa35b
Show file tree
Hide file tree
Showing 7 changed files with 603 additions and 0 deletions.
21 changes: 21 additions & 0 deletions collections/icarGroupPositionObservationEventCollection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"description": "Represents a collection of group position observation events.",

"allOf": [{
"$ref": "../collections/icarResourceCollection.json"
},
{
"type": "object",

"properties": {
"member": {
"type": "array",
"items": {
"$ref": "../resources/icarGroupPositionObservationEventResource.json"
},
"description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case group position observation events."
}
}
}
]
}
21 changes: 21 additions & 0 deletions collections/icarPositionObservationEventCollection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"description": "Represents a collection of animal position observation events.",

"allOf": [{
"$ref": "../collections/icarResourceCollection.json"
},
{
"type": "object",

"properties": {
"member": {
"type": "array",
"items": {
"$ref": "../resources/icarPositionObservationEventResource.json"
},
"description": "As per JSON-LD Hydra syntax, member provides the array of objects, in this case position observation events."
}
}
}
]
}
12 changes: 12 additions & 0 deletions resources/icarGroupPositionObservationEventResource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"description": "This event records that a group of animals was observed in a specific position or location (either a named location or a geographic coordinate).",

"allOf": [
{
"$ref": "../resources/icarGroupEventCoreResource.json"
},
{
"$ref": "../types/icarPositionObservationType.json"
}
]
}
12 changes: 12 additions & 0 deletions resources/icarPositionObservationEventResource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"description": "This event records that an animal was observed in a specific position or location (either a named location or a geographic coordinate).",

"allOf": [
{
"$ref": "../resources/icarAnimalEventCoreResource.json"
},
{
"$ref": "../types/icarPositionObservationType.json"
}
]
}
20 changes: 20 additions & 0 deletions types/icarPositionObservationType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"description": "This type may be included in a position observation event to identify either a named position (such as a barn or pen) or a geographic location.",

"type": "object",

"properties": {
"positionName": {
"type": "string",
"description": "The name of a location, such as a barn, pen, building, or field."
},
"site": {
"type": "string",
"description": "Identifier for a sorting site (icarSortingSiteResource) for this position."
},
"geometry": {
"$ref": "https://geojson.org/schema/Geometry.json",
"description": "A GeoJSON geometry (such as a latitude/longitude point) that specifies the position."
}
}
}
108 changes: 108 additions & 0 deletions url-schemes/exampleUrlScheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -2529,6 +2529,108 @@
}
}
}
},
"/locations/{location-scheme}/{location-id}/position-observations": {
"get": {
"operationId": "get-animal-position-observations",
"summary": "Get position observation events for animals that relate to a given location",
"description": "# Purpose\nProvides the collection of position observation events for animals at the specified location.\n",
"tags": [
"ADE-1.3-management"

Check warning on line 2539 in url-schemes/exampleUrlScheme.json

View workflow job for this annotation

GitHub Actions / Lint (push)

operation-tag-defined

Operation tags must be defined in global tags.
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
},
{
"$ref": "#/components/parameters/date-from"
},
{
"$ref": "#/components/parameters/date-to"
},
{
"$ref": "#/components/parameters/identifier-scheme"
},
{
"$ref": "#/components/parameters/identifier-id"
},
{
"$ref": "#/components/parameters/meta-modified-from"
},
{
"$ref": "#/components/parameters/meta-modified-to"
}
],
"responses": {
"200": {
"description": "Successful. The response contains the animal position observation events for the given location.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarPositionObservationEventCollection"
}
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/locations/{location-scheme}/{location-id}/group-position-observations": {
"get": {
"operationId": "get-group-position-observations",
"summary": "Get position observation events for groups that relate to a given location",
"description": "# Purpose\nProvides the collection of position observation events for groups at the specified location.\n",
"tags": [
"ADE-1.3-management"

Check warning on line 2590 in url-schemes/exampleUrlScheme.json

View workflow job for this annotation

GitHub Actions / Lint (push)

operation-tag-defined

Operation tags must be defined in global tags.
],
"parameters": [
{
"$ref": "#/components/parameters/location-scheme"
},
{
"$ref": "#/components/parameters/location-id"
},
{
"$ref": "#/components/parameters/date-from"
},
{
"$ref": "#/components/parameters/date-to"
},
{
"$ref": "#/components/parameters/identifier-scheme"
},
{
"$ref": "#/components/parameters/identifier-id"
},
{
"$ref": "#/components/parameters/meta-modified-from"
},
{
"$ref": "#/components/parameters/meta-modified-to"
}
],
"responses": {
"200": {
"description": "Successful. The response contains the animal position observation events for the given location.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarGroupPositionObservationEventCollection"
}
}
}
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
}
},
"components": {
Expand Down Expand Up @@ -2712,6 +2814,12 @@
},
"icarAttentionEventCollection": {
"$ref": "../collections/icarAttentionEventCollection.json"
},
"icarPositionObservationEventCollection": {
"$ref": "../collections/icarPositionObservationEventCollection.json"
},
"icarGroupPositionObservationEventCollection": {
"$ref": "../collections/icarGroupPositionObservationEventCollection.json"
}
},
"parameters": {
Expand Down
Loading

0 comments on commit 68fa35b

Please sign in to comment.