adewg / ICAR

Standard messages and specifications for animal data exchange in livestock.
https://icar.org/
Apache License 2.0
47 stars 26 forks source link

service-sires API #402

Closed erwinspeybroeck closed 1 year ago

erwinspeybroeck commented 1 year ago

I would like to propose an API te request AI-bull information

We could use the animals-API as a basis.

description: Core schema for representing animal
resourceType* stringUniform resource identifier (URI) or shortname of the logical resourceType. The ResourceType catalog defines the set of allowed resourceTyps. --> what would be the resource type?
@self [...]
meta {...}
location {...} --> should be removed
identifier* {...}
alternativeIdentifiers [...]
specie* [...] --> do we need this?
gender* [...] --> always male, do we need this?
birthDate [...]
primaryBreed {...}
breedFractions {...}
coatColor [...]
coatColorIdentifier {...}
managementTag [...] --> remove?
name [...]
officialName [...]
productionPurpose [...] --> remove?
status [...] --> remove?
reproductionStatus [...] --> remove?
lactationStatus [...] --> remove?
parentage [...]
healthStatus [...] --> remove?

  url would be GET /ai-bulls we would need a parameter to limit the response to one bull --> identifier and scheme No sense in a request for all ai-bulls. In time we could think about parameters regarding a set of bulls (actual bull list for a certain breed from a certain organisation)

We have now an ai-bulls API

[ { "identifier": { "scheme": "eu.bovine", "id": "NL 123456789" }, "alternativeIdentifier": { "scheme": "eu.bovine", "id": "NL 123456789" }, "name": "string", "officialName": "string" } ]

cookeac commented 1 year ago

At first glance this looks to be an implementation decision to implement a special purpose API based on an existing schema (the server would just not populate the fields you have marked with "remove"). Does this need a specification effort, or can you just do this in your implementation?

cookeac commented 1 year ago

Suggestions: GET /service-sires? query parameters for scheme and id, possibly country AB code

Reuse icarAnimalCoreResource, don't fill in optional attributes that do not apply. Expect an array result - because an AB code might define a group of sires used in the same straw(s)

dirbSEGES commented 1 year ago

Hi,

How to understand the difference between this ressource and the resources/icarReproSemenStrawResource.json ?

cookeac commented 1 year ago

The service sires is not a resource, just an API specification that allows a caller to get the list of service sires that have been used for a location (and potentially their sire and dam information). What is returned is an icarAnimalCoreResource for those sires.

In contrast icarReproSemenStrawResource in APIs to manage semen straws, as well as in mating events. These are similar, but not necessarily equivalent.