diff --git a/.gitignore b/.gitignore index a9d1b4c..9cf2022 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ __pycache__/ .ipynb_checkpoints/ local_tools/ /docs/build/ +backup/ +nginx/ diff --git a/src/app/api/analytics/analytics.py b/src/app/api/analytics/analytics.py index e1d58f4..89689f5 100644 --- a/src/app/api/analytics/analytics.py +++ b/src/app/api/analytics/analytics.py @@ -100,6 +100,7 @@ class MaterialFieldValidation(BaseModel): class MaterialValidationStats(ElasticValidationStats[MaterialFieldValidation]): subjects: Optional[MaterialFieldValidation] license: Optional[MaterialFieldValidation] - ads_qualifier: Optional[MaterialFieldValidation] + url: Optional[MaterialFieldValidation] + publisher: Optional[MaterialFieldValidation] + intended_end_user_role: Optional[MaterialFieldValidation] material_type: Optional[MaterialFieldValidation] - object_type: Optional[MaterialFieldValidation] diff --git a/src/app/api/score/models.py b/src/app/api/score/models.py index 96bf660..c252a03 100644 --- a/src/app/api/score/models.py +++ b/src/app/api/score/models.py @@ -33,38 +33,38 @@ class MissingCollectionProperties(BaseModel): class MissingMaterialProperties(BaseModel): total: int = Field(default=0, ge=0, description="Number of entries") - missing_edu_context: float = Field( - default=0.0, ge=0.0, le=1.0, description="Ratio of entries without edu context" - ) - missing_object_type: float = Field( - default=0.0, ge=0.0, le=1.0, description="Ratio of entries without object type" - ) - missing_description: float = Field( - default=0.0, ge=0.0, le=1.0, description="Ratio of entries without description" - ) - missing_license: float = Field( - default=0.0, ge=0.0, le=1.0, description="Ratio of entries with missing license" - ) - missing_keywords: float = Field( - default=0.0, ge=0.0, le=1.0, description="Ratio of entries without keywords" - ) missing_title: float = Field( default=0.0, ge=0.0, le=1.0, description="Ratio of entries without title" ) - missing_ads_qualifier: float = Field( + missing_material_type: float = Field( default=0.0, ge=0.0, le=1.0, - description="Ratio of entries missing advertisement qualifier", + description="Ratio of entries missing material type", ) missing_subjects: float = Field( default=0.0, ge=0.0, le=1.0, description="Ratio of entries missing subjects" ) - missing_material_type: float = Field( + missing_url: float = Field( + default=0.0, ge=0.0, le=1.0, description="Ratio of entries without url" + ) + missing_license: float = Field( + default=0.0, ge=0.0, le=1.0, description="Ratio of entries with missing license" + ) + missing_publisher: float = Field( + default=0.0, ge=0.0, le=1.0, description="Ratio of entries without publisher" + ) + missing_description: float = Field( + default=0.0, ge=0.0, le=1.0, description="Ratio of entries without description" + ) + missing_intended_end_user_role: float = Field( default=0.0, ge=0.0, le=1.0, - description="Ratio of entries missing material type", + description="Ratio of entries without intended end user role", + ) + missing_edu_context: float = Field( + default=0.0, ge=0.0, le=1.0, description="Ratio of entries without edu context" ) diff --git a/src/app/api/score/score.py b/src/app/api/score/score.py index 7405d83..5d35eaf 100644 --- a/src/app/api/score/score.py +++ b/src/app/api/score/score.py @@ -106,16 +106,18 @@ def field_names_used_for_score_calculation(properties: dict) -> list[str]: aggs_material_validation = { "missing_title": amissing(qfield=LearningMaterialAttribute.TITLE), - "missing_keywords": amissing(qfield=LearningMaterialAttribute.KEYWORDS), - "missing_subjects": amissing(qfield=LearningMaterialAttribute.SUBJECTS), - "missing_description": amissing(qfield=LearningMaterialAttribute.DESCRIPTION), - "missing_license": afilter(query=query_missing_material_license()), - "missing_edu_context": amissing(qfield=LearningMaterialAttribute.EDU_CONTEXT), - "missing_ads_qualifier": amissing(qfield=LearningMaterialAttribute.CONTAINS_ADS), "missing_material_type": amissing( qfield=LearningMaterialAttribute.LEARNINGRESOURCE_TYPE ), - "missing_object_type": amissing(qfield=LearningMaterialAttribute.OBJECT_TYPE), + "missing_subjects": amissing(qfield=LearningMaterialAttribute.SUBJECTS), + "missing_url": amissing(qfield=LearningMaterialAttribute.WWW_URL), + "missing_license": afilter(query=query_missing_material_license()), + "missing_publisher": amissing(qfield=LearningMaterialAttribute.PUBLISHER), + "missing_description": amissing(qfield=LearningMaterialAttribute.DESCRIPTION), + "missing_intended_end_user_role": amissing( + qfield=LearningMaterialAttribute.EDUENDUSERROLE_DE + ), + "missing_edu_context": amissing(qfield=LearningMaterialAttribute.EDU_CONTEXT), } aggs_collection_validation = { "missing_title": amissing(qfield=CollectionAttribute.TITLE),