Changed name to Species to OntologyTerm, removed DbIds not in 2.1 mod…#616
Changed name to Species to OntologyTerm, removed DbIds not in 2.1 mod…#616daveneti merged 6 commits intoLzLang-patch-1from
Conversation
…el, matched ObservationUnitLevel etc with model.
There was a problem hiding this comment.
Hey @daveneti,
just reviewed your changes and there are only small changes needed.
It would certainly be helpful to adjust the validator so that it checks the associations.
For example, you could automatically check whether a referencedAttribute is present and whether the type of the reverse association is correct.
(If the validator is not already doing this)
| "ExternalReference": { | ||
| "properties": { | ||
| "externalReferenceDbId": { | ||
| "referenceId": { |
There was a problem hiding this comment.
Wouldn't it make sense to use referenceDbId here so that it is standardized or would that lead to a model change?
There was a problem hiding this comment.
It the OpenAPI specification it is 'referenceId' so we should keep it to that. Also I think it is technically not a DbId but can be any ID.
| @@ -455,9 +440,6 @@ | |||
| "referencedAttribute": "growthFacility" | |||
There was a problem hiding this comment.
You changed the relationship in "Study" from "one-to-many" to "many-to-one".
Reverse association should be "one-to-many" than
There was a problem hiding this comment.
A study has one growth facility, but a growth facility may have several studies so
study -> growth facility is many-to-one
growth facilities->study will be one-to-many, correct :)
| "referencedAttribute": "study", | ||
| "items": { | ||
| "$ref": "../BrAPI-Core/Study.json#/$defs/ObservationLevels", | ||
| "$ref": "../BrAPI-Common/ObservationUnitHierarchyLevel.json#/$defs/ObservationUnitHierarchyLevel", |
There was a problem hiding this comment.
You have here a association to ObservationUnitHierarchyLevel but no referencedAttribute nor reverse association.
Is that correct and wanted?
There was a problem hiding this comment.
I am not sure it is needed. It is not in the model. Actually many of the reverse associations are not in the model, we need to discuss with @BrapiCoordinatorSelby about what we should do about this.
| "referencedAttribute": "reference", | ||
| "items": { | ||
| "$ref": "../BrAPI-Common/SourceGermplasm.json#/$defs/SourceGermplasm", | ||
| "$ref": "../BrAPI-Germplasm/Germplasm.json#/$defs/Germplasm", |
There was a problem hiding this comment.
There is no reverse association, is that intentional?
There was a problem hiding this comment.
See the above comment about reverse associations. If you need something like that in your GraphQL schema we could add an option to auto generate reverse associations. I still think reverse associations should be explicitly defined and model dependent. We should review them all.
| "relationshipType": "one-to-one", | ||
| "referencedAttribute": "reference", | ||
| "$ref": "../BrAPI-Common/Species.json#/$defs/Species" | ||
| "$ref": "../BrAPI-Common/OntologyTerm.json#/$defs/OntologyTerm" |
| "germplasm": { | ||
| "$ref": "Germplasm.json#/$defs/Germplasm", | ||
| "description": "The ID which uniquely identifies a germplasm", | ||
| "referencedAttribute": "parentPedigreeNodes", |
There was a problem hiding this comment.
reverse association uses "$ref": "PedigreeNode.json#/$defs/PedigreeNode",
| "properties": { | ||
| "observationUnit": { | ||
| "description": "The an observation unit\n<br/>If this level has on ObservationUnit associated with it, record the observationUnitDbId here. This is intended to construct a strict hierarchy of observationUnits. \n<br/>If there is no ObservationUnit associated with this level, this field can set to NULL or omitted from the response.", | ||
| "$ref": "../BrAPI-Phenotyping/ObservationUnit.json#/$defs/ObservationUnit", |
There was a problem hiding this comment.
No referencedAttribute, is that intentional?
There was a problem hiding this comment.
See comments about referenced attributes
| } | ||
| } | ||
| }, | ||
| "title": "ObservationUnitLevelRelationship", |
There was a problem hiding this comment.
No title nor type for the model?
There was a problem hiding this comment.
no type is needed because it is an 'allof' schema, but it could have a title, although it is option can defaults the to name. I did not put titles in any of the 'allof' schemas.
| }, | ||
| "validValues": { | ||
| "relationshipType": "one-to-many", | ||
| "relationshipType": "one-to-one", |
There was a problem hiding this comment.
reverse association is still many-to-one
There was a problem hiding this comment.
I think it is 1 to 1, always. The 'ValidValues' entity is always associated with a Scale. It is a Composition association. It only exists with a single Scale object and no other.
| @@ -296,21 +308,14 @@ | |||
| "referencedAttribute": "availableFormats" | |||
There was a problem hiding this comment.
relationshipType is still many-to-one, reverse is many-to-many
There was a problem hiding this comment.
A single VarientSet can have multiple formats so one-to-many
A format can be shared between VarientSets, so many-to-many
@LzLang it should check references. I am also adding a CI so that the validator is run on commit. wait for @BrapiCoordinatorSelby permission. |
Changed name to Species to OntologyTerm, removed DbIds not in 2.1 model, matched ObservationUnitLevel etc with model.