File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
validation_service_api/validation_service Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -517,6 +517,7 @@ class ScientificModel(BaseModel):
517517 images : List [Image ] = None
518518 old_uuid : UUID = None
519519 instances : List [ModelInstance ] = None
520+ validation_count : int = 0
520521
521522 class Config :
522523 schema_extra = {"example" : EXAMPLES ["ScientificModel" ]}
@@ -669,11 +670,13 @@ class ScientificModelSummary(BaseModel):
669670 description : str
670671 date_created : datetime = None
671672 format : List [str ] = None
673+ validation_count : int = 0
672674
673675 @classmethod
674676 def from_kg_query (cls , item , client ):
675677 item .pop ("@context" )
676678 item ["id" ] = client .uuid_from_uri (item ["uri" ])
679+ item ["validation_count" ] = len (item .pop ("validations" , []))
677680 return cls (** item )
678681
679682 @classmethod
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ async def query_models(
118118 format : str = Query (None , description = "Model format expressed as a content type" ),
119119 private : bool = Query (None , description = "Limit the search to public or private models" ),
120120 summary : bool = Query (False , description = "Return only summary information about each model" ),
121+ validated : bool = Query (False , description = "Limit the search to models for which there are validation results" ),
121122 size : int = Query (100 , description = "Maximum number of responses" ),
122123 from_index : int = Query (0 , description = "Index of the first response returned" ),
123124 # from header
@@ -222,7 +223,10 @@ async def query_models(
222223
223224 if summary :
224225 cls = ScientificModelSummary
225- query_label = "VF_ScientificModelSummary"
226+ if validated :
227+ query_label = "VF_ValidatedScientificModelSummary"
228+ else :
229+ query_label = "VF_ScientificModelSummary"
226230 else :
227231 cls = ScientificModel
228232 query_label = "VF_ScientificModel"
You can’t perform that action at this time.
0 commit comments