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

One-dimensionalization of data models #613

Merged
merged 7 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
36 changes: 35 additions & 1 deletion Specification/BrAPI-Schema/BrAPI-Common/GeoJSON.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
"type": "object",
"description": "One geometry as defined by GeoJSON (RFC 7946). All coordinates are decimal values on the WGS84 geographic coordinate reference system.\n\nCopied from RFC 7946 Section 3.1.1\n\nA position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or\neasting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element.",
"properties": {
"geometryDbId": {
"description": "Unique identifier for the geometry",
"type": [
"null",
"string"
]
},
"geometry": {
"description": "A geometry as defined by GeoJSON (RFC 7946). In this context, only Point or Polygon geometry are allowed.",
"$ref": "GeoJSONGeometry.json#/$defs/GeoJSONGeometry"
Expand All @@ -14,8 +21,35 @@
"default": "Feature",
"example": "Feature",
"description": "The literal string \"Feature\""
},
"image": {
"description": "Geometry associated with an image",
"$ref": "../BrAPI-Phenotyping/Image.json#/$defs/Image",
"relationshipType": "many-to-one",
"referencedAttribute": "imageLocation"
},
"observation": {
"description": "Geometry associated with an image",
"$ref": "../BrAPI-Phenotyping/Observation.json#/$defs/Observation",
"relationshipType": "many-to-one",
"referencedAttribute": "geoCoordinates"
},
"observationUnit": {
"description": "Geometry associated with an image",
"$ref": "../BrAPI-Phenotyping/ObservationUnit.json#/$defs/ObservationUnitPosition",
"relationshipType": "many-to-one",
"referencedAttribute": "geoCoordinates"
},
"germplasmOrigin": {
"description": "Geometry associated with an image",
"$ref": "../BrAPI-Germplasm/Germplasm.json#/$defs/GermplasmOrigin",
"relationshipType": "many-to-one",
"referencedAttribute": "coordinates"
}
}
},
"required": [
"geometryDbId"
]
}
},
"$id": "https://brapi.org/Specification/BrAPI-Schema/BrAPI-Common/GeoJSON.json",
Expand Down
44 changes: 44 additions & 0 deletions Specification/BrAPI-Schema/BrAPI-Common/SourceGermplasm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$defs": {
"SourceGermplasm": {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this link I would propose to drop SourceGermplasm directly. So in germplasm you would have in Reference and Reference Set

            "sourceGermplasm": {
                "description": "All known corresponding Germplasm",
                "relationshipType": "many-to-many",
                "referencedAttribute": "reference",
                "items": {
                    "$ref": "../BrAPI-Germplasm/Germplasm.json#/$defs/Germplasm",
                },
                "title": "SourceGermplasm",
                "type": [
                    "null",
                    "array"
                ]

Then you could add the back links in Germplasm

"properties": {
"germplasmDbId": {
"description": "The ID which uniquely identifies a `Germplasm` within the given database server",
"type": [
"null",
"string"
]
},
"germplasmName": {
"description": "The human readable name of a `Germplasm`",
"type": [
"null",
"string"
]
},
"reference": {
"description": "Germplasm associated with a reference",
"$ref": "../BrAPI-Genotyping/Reference.json#/$defs/Reference",
"relationshipType": "many-to-one",
"referencedAttribute": "sourceGermplasm"
},
"referenceSet": {
"description": "Germplasm associated with a reference",
"$ref": "../BrAPI-Genotyping/ReferenceSet.json#/$defs/ReferenceSet",
"relationshipType": "many-to-one",
"referencedAttribute": "sourceGermplasm"
}
},
"required": [
"germplasmDbId"
],
"title": "sourceGermplasm",
"type": "object",
"brapi-metadata": {
"primaryModel": false
}
}
},
"$id": "https://brapi.org/Specification/BrAPI-Schema/BrAPI-Common/SourceGermplasm.json",
"$schema": "http://json-schema.org/draft/2020-12/schema"
}
51 changes: 51 additions & 0 deletions Specification/BrAPI-Schema/BrAPI-Common/Species.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$defs": {
"Species": {
"properties": {
"specieDbId": {
"description": "An ontology term describing an attribute.",
"type": [
"null",
"string"
]
},
"term": {
"description": "Ontology term - the label of the ontology term the termId is pointing to.",
"type": [
"null",
"string"
]
},
"termURI": {
"description": "Ontology term identifier - the CURIE for an ontology term. It differs from the standard GA4GH schema's :ref:`id ` in that it is a CURIE pointing to an information resource outside of the scope of the schema or its resource implementation.",
"type": [
"null",
"string"
]
},
"reference": {
"description": "Species associated with a reference",
"$ref": "../BrAPI-Genotyping/Reference.json#/$defs/Reference",
"relationshipType": "many-to-one",
"referencedAttribute": "species"
},
"referenceSet": {
"description": "Species associated with a referenceSet",
"$ref": "../BrAPI-Genotyping/ReferenceSet.json#/$defs/ReferenceSet",
"relationshipType": "many-to-one",
"referencedAttribute": "species"
}
},
"required": [
"specieDbId"
],
"title": "OntologyTerm",
"type": "object",
"brapi-metadata": {
"primaryModel": false
}
}
},
"$id": "https://brapi.org/Specification/BrAPI-Schema/BrAPI-Common/Species.json",
"$schema": "http://json-schema.org/draft/2020-12/schema"
}
14 changes: 12 additions & 2 deletions Specification/BrAPI-Schema/BrAPI-Common/Variable.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"properties": {
"additionalInfo": {
"description": "A free space containing any additional information related to a particular object. A data source may provide any JSON object, unrestricted by the BrAPI specification.",
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the model, from a single to an array of AdditionalInfo, can this be put in v2.2? See in same changes in other entities.

"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo",
"description": "AdditionalInfo"
},
"type": [
"null",
"array"
]
},
"commonCropName": {
"description": "Crop name (examples: \"Maize\", \"Wheat\")",
Expand Down Expand Up @@ -40,8 +48,10 @@
},
"externalReferences": {
"description": "An array of external reference ids. These are references to this piece of data in an external system. Could be a simple string or a URI.",
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference"
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference",
"description": "ExternalReferences"
},
"title": "ExternalReferences",
"type": [
Expand Down
14 changes: 12 additions & 2 deletions Specification/BrAPI-Schema/BrAPI-Core/List.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"properties": {
"additionalInfo": {
"description": "A free space containing any additional information related to a particular object. A data source may provide any JSON object, unrestricted by the BrAPI specification.",
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo"
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo",
"description": "AdditionalInfo"
},
"type": [
"null",
"array"
]
},
"data": {
"description": "The array of DbIds of the BrAPI objects contained in a List",
Expand Down Expand Up @@ -35,8 +43,10 @@
},
"externalReferences": {
"description": "An array of external reference ids. These are references to this piece of data in an external system. Could be a simple string or a URI.",
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference"
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference",
"description": "ExternalReferences"
},
"title": "ExternalReferences",
"type": [
Expand Down
14 changes: 12 additions & 2 deletions Specification/BrAPI-Schema/BrAPI-Core/Location.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
},
"additionalInfo": {
"description": "A free space containing any additional information related to a particular object. A data source may provide any JSON object, unrestricted by the BrAPI specification.",
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo"
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo",
"description": "AdditionalInfo"
},
"type": [
"null",
"array"
]
},
"coordinateDescription": {
"description": "Describes the precision and landmarks of the coordinate values used for a Location. (ex. the site, the nearest town, a 10 kilometers radius circle, +/- 20 meters, etc)",
Expand Down Expand Up @@ -69,8 +77,10 @@
},
"externalReferences": {
"description": "An array of external reference ids. These are references to this piece of data in an external system. Could be a simple string or a URI.",
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference"
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference",
"description": "ExternalReferences"
},
"title": "ExternalReferences",
"type": [
Expand Down
14 changes: 12 additions & 2 deletions Specification/BrAPI-Schema/BrAPI-Core/Person.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"properties": {
"additionalInfo": {
"description": "A free space containing any additional information related to a particular object. A data source may provide any JSON object, unrestricted by the BrAPI specification.",
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo"
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo",
"description": "AdditionalInfo"
},
"type": [
"null",
"array"
]
},
"description": {
"description": "description of this person",
Expand All @@ -22,8 +30,10 @@
},
"externalReferences": {
"description": "An array of external reference ids. These are references to this piece of data in an external system. Could be a simple string or a URI.",
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference"
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference",
"description": "ExternalReferences"
},
"title": "ExternalReferences",
"type": [
Expand Down
14 changes: 12 additions & 2 deletions Specification/BrAPI-Schema/BrAPI-Core/Program.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
},
"additionalInfo": {
"description": "A free space containing any additional information related to a particular object. A data source may provide any JSON object, unrestricted by the BrAPI specification.",
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo"
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/AdditionalInfo.json#/$defs/AdditionalInfo",
"description": "AdditionalInfo"
},
"type": [
"null",
"array"
]
},
"commonCropName": {
"description": "Common name for the crop which this program is for",
Expand All @@ -30,8 +38,10 @@
},
"externalReferences": {
"description": "An array of external reference ids. These are references to this piece of data in an external system. Could be a simple string or a URI.",
"relationshipType": "one-to-many",
"items": {
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference"
"$ref": "../BrAPI-Common/ExternalReference.json#/$defs/ExternalReference",
"description": "ExternalReferences"
},
"title": "ExternalReferences",
"type": [
Expand Down
Loading