Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made JoinData spec comparable to the DL draft; tagged JD endpoints with new/existing compared to draft #3

Merged
merged 33 commits into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
46cfab9
converted to v3; extracted milksample to be able to compare better
Apr 5, 2019
3b9188c
converted to v3; extracted milksample to be able to compare better
Apr 5, 2019
2cc36cc
fixed missing branch in schema ref
Apr 5, 2019
4ebd9cc
removed old file
Apr 5, 2019
f5bddac
Merge pull request #1 from alamers/convert-to-v3
alamers Apr 5, 2019
56d31a5
work in progress: splitting off data types and enforce naming convent…
Apr 12, 2019
561af16
converted all files to json schema
Apr 12, 2019
d02d2cf
started fixing references to schemas
Apr 12, 2019
87ee7ab
Merge branch 'convert-to-v3'
Apr 12, 2019
99543f4
more cleaning up
Apr 12, 2019
a1576b9
fixed refs
Apr 12, 2019
3231c6e
hardcoded urls since tool doesnt understand relative links
Apr 12, 2019
39f1f16
used hardcoded refs for now to get to a stable situation
Apr 12, 2019
9233c18
added missing specie code
Apr 12, 2019
4868a68
added sexed semen code
Apr 12, 2019
0c3e861
added missing vendor specific for health activity
Apr 12, 2019
3933866
more vendor specific types
Apr 12, 2019
f21f9a0
more missing types
Apr 12, 2019
1ad1669
more missing types
Apr 12, 2019
04b58cb
more fixes
Apr 12, 2019
02f00dc
more fixes
Apr 16, 2019
406cccb
updated biodiversity
Apr 16, 2019
13134ae
fixed missing Type
Apr 16, 2019
e9d70c4
fixed type
Apr 16, 2019
3d782ef
fixed type
Apr 16, 2019
f8ff18d
fixed address type
Apr 16, 2019
e8e27da
cleanup of url scheme definitions (grouped them together)
Apr 16, 2019
678e271
introduced Resource naming scheme
Apr 16, 2019
fd87670
accidental removal of responseErrors
Apr 16, 2019
b5b0d0b
more fixes
Apr 16, 2019
b92d19f
fixed wrong name
Apr 16, 2019
f2cf1ea
formatted file
Apr 16, 2019
98ba3f2
tagged JD endpoints with existing/new compared to the draft
Apr 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,352 changes: 0 additions & 3,352 deletions JoinData/JoinDataMessages.yml

This file was deleted.

22 changes: 22 additions & 0 deletions JoinData/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# JoinData message spec


This directory contains the JoinData specs, derived from the ICAR ADE XML standard.

The Open API Spec file contains the URL scheme for JoinData. It follows a specific structure that ultimately uses the ICAR ADE JSON messages.

URL scheme vs message types
---------------------------
Each _message_ or _event_ has its own path. Per _path_, the (standardized) parameters are described. There is always a default type for errors (called error). The actual response is build up out of several types:
* The full response for a message xxx is described in a type called xxxResponse. This contains an array of data sources that have responded
* The xxxDataSources type describes the response per data source. It can contain information on the data source itself or errors it produced. There are all generic. It can also contain the actual message.
* The xxxResponseDataSource type describes the actual response. This should be a wrapper to an ICAR defined JSON scheme, e.g. to an xxxResource file.


Naming Conventions
------------------

A message that can be transported by itself should be placed in a file called xxxResource. Basic types that are reused in multiple messages and are not transported by themselves should be placed in a file called xxxType. An enum type should be located in a file called xxxCode.

Typically, most messages have a plural version (e.g. icarGestationsResource) which is simply an array wrapping a singular type (e.g. icarGestationResource). In many cases, the endpoint would be defined on the plural version but this allows for more flexibility.

6 changes: 6 additions & 0 deletions JoinData/icarAnimalIdSchemeCode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "string",
"enum": [
"nl-v1"
]
}
3 changes: 3 additions & 0 deletions JoinData/icarAnimalIdType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
type: string
}
16 changes: 16 additions & 0 deletions JoinData/icarAnimalIdentifierType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"required": [
"id",
"scheme"
],
"type": "object",
"properties": {
"id": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdType.json"
},
"scheme": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdSchemeCode.json"
}
},
"description": "Identifies an animal"
}
34 changes: 34 additions & 0 deletions JoinData/icarAnimalMilkingSampleResource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"type": "object",
"properties": {
"bottleIdentifierType": {
"type": "string",
"description": "The type of bottle identifiertype according to ICAR_BottleIdentifierCode",
"enum": [
"BRC",
"RFD"
]
},
"rackNumber": {
"type": "string",
"description": "Number of the sample rack"
},
"bottlePosition": {
"type": "string",
"description": "Position of the bottle in the sample rack"
},
"bottleIdentifier": {
"type": "string",
"description": "Bottle identifier read from barcode or RFID"
},
"validSampleFillingIndicator": {
"type": "string",
"description": "Indicator of valid sample filling according to ICAR_ValidSampleFillingIndicatorCode list",
"enum": [
"0",
"1",
"2"
]
}
}
}
6 changes: 6 additions & 0 deletions JoinData/icarAnimalMovementDataSetType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalMovementType.json"
}
}
14 changes: 14 additions & 0 deletions JoinData/icarAnimalMovementType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"required": [
"arrival"
],
"type": "object",
"properties": {
"arrival": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarArrivalCoreDataSetType.json"
},
"departure": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarDepartureCoreDataSetType.json"
}
}
}
6 changes: 6 additions & 0 deletions JoinData/icarAnimalMovementsType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalMovementType.json"
}
}
59 changes: 59 additions & 0 deletions JoinData/icarAnimalRegistrationBodyType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"required": [
"identifier",
"registrationDate",
"registrationType"
],
"type": "object",
"properties": {
"registrationType": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarRegistrationCode.json"
},
"registrationDate": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarDateType.json"
},
"identifier": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"specie": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarSpecieCode.json"
},
"gender": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarGenderCode.json"
},
"birth": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarDateType.json"
},
"breed": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarCodeType.json"
},
"sire": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"recipientDam": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"geneticDam": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"number": {
"type": "string",
"description": "A meaningful identification code of the animal, not necessary unique within the location"
},
"earTagNumber": {
"type": "string",
"description": "The ear tag number"
},
"name": {
"type": "string",
"description": "The name of the animal"
},
"officialName": {
"type": "string",
"description": "The official name of the animal"
},
"productionPurpose": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarProductionPurposeCode.json"
}
}
}
64 changes: 64 additions & 0 deletions JoinData/icarAnimalRegistrationResource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"required": [
"identifier",
"registrationDate",
"registrationType"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "A unique identifier for the posted message",
"format": "uuid"
},
"registrationType": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarRegistrationCode.json"
},
"registrationDate": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarDateType.json"
},
"identifier": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"specie": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarSpecieCode.json"
},
"gender": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarGenderCode.json"
},
"birth": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarDateType.json"
},
"breed": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarCodeType.json"
},
"sire": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"recipientDam": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"geneticDam": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarAnimalIdentifierType.json"
},
"number": {
"type": "string",
"description": "A meaningful identification code of the animal, not necessary unique within the location"
},
"earTagNumber": {
"type": "string",
"description": "The ear tag number"
},
"name": {
"type": "string",
"description": "The name of the animal"
},
"officialName": {
"type": "string",
"description": "The official name of the animal"
},
"productionPurpose": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarProductionPurposeCode.json"
}
}
}
12 changes: 12 additions & 0 deletions JoinData/icarArrivalCoreDataSetType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"required": [
"arrivalDate"
],
"type": "object",
"properties": {
"arrivalDate": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarDateType.json"
}
},
"description": "not completely implemented yet!"
}
27 changes: 27 additions & 0 deletions JoinData/icarBiodiversityCollectiveType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "collective number, according to SCAN coding"
},
"name": {
"type": "string",
"description": "name of the collective"
},
"otherProperties": {
"type": "array",
"description": "e.g. if the farmer is member of ANLb (anlb:true)",
"items": {
"type": "object",
"properties": {}
}
},
"packets": {
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarBiodiversityPacketType.json"
}
}
}
}
53 changes: 53 additions & 0 deletions JoinData/icarBiodiversityPacketElementType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"type": "object",
"properties": {
"elementId": {
"type": "string",
"description": "identifier of the element of this report. Per element unieke code. Kan dus niet onder verschillende pakketten en/of collectieven herhaald voorkomen."
},
"ownerlabel": {
"type": "array",
"description": "Verschillende TBO, eigen beheer",
"items": {
"type": "integer"
}
},
"size": {
"type": "string"
},
"value": {
"type": "number",
"description": "Ingetekende oppervlakte/ hoeveelheid van het betreffende BBM",
"format": "double"
},
"unitCode": {
"type": "string",
"description": "UN/CEFACT Common Code for Units of Measurement.",
"enum": [
"H18",
"C62"
]
},
"contractStartDate": {
"type": "string",
"format": "date"
},
"contractEndDate": {
"type": "string",
"format": "date"
},
"lastInspectionDate": {
"type": "string",
"format": "date"
},
"inspectionResult": {
"type": "string",
"enum": [
"1",
"2",
"3",
"4"
]
}
}
}
23 changes: 23 additions & 0 deletions JoinData/icarBiodiversityPacketType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "object",
"properties": {
"packetCode": {
"type": "integer",
"description": "unique code for the bio diversity packet; Afgesproken unieke BBM code voor betreffende pakket uit de BBM coderingslijst."
},
"otherProperties": {
"type": "array",
"description": "e.g. if the packet is member of ANLb (anlb:true)",
"items": {
"type": "object",
"properties": {}
}
},
"elements": {
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/alamers/ICAR/master/JoinData/icarBiodiversityPacketElementType.json"
}
}
}
}
Loading