Skip to content

Commit

Permalink
Checked automation and implicit values
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Gebhardt committed Jul 26, 2024
1 parent 41e7f58 commit 9d22c21
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
10 changes: 8 additions & 2 deletions app/celery/automated_tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
from .f1_model_persistent_identifier_task import f1_model_persistent_identifier
from .f4_model_metadata_harvestable_task import f4_model_metadata_harvestable
from .csh_fair import csh_f1_2_globally_unique_identifier, csh_a1_contains_access_information, csh_i3_01_ref_other_metadata, csh_i3_02_ref_other_data, csh_i3_03_qual_ref_other_metadata, csh_i3_04_qual_ref_other_data, csh_r1_1_01_has_reuse_license, csh_r1_1_02_has_standard_reuse_license
from .csh_fair import csh_f1_1_persistent_identifier, csh_f2_rich_metadata_provided, csh_f3_id_of_data_included, csh_f1_2_globally_unique_identifier, csh_a1_contains_access_information, csh_i3_01_ref_other_metadata, csh_i3_02_ref_other_data, csh_i3_03_qual_ref_other_metadata, csh_i3_04_qual_ref_other_data, csh_r1_1_01_has_reuse_license, csh_r1_1_02_has_standard_reuse_license, csh_r1_1_03_has_machine_readable_reuse_license, csh_r1_2_01_has_provenance_information, csh_r1_2_02_has_standardized_provenance_information



__all__ = [
f1_model_persistent_identifier,
f4_model_metadata_harvestable,
csh_f1_1_persistent_identifier,
csh_f1_2_globally_unique_identifier,
csh_f2_rich_metadata_provided,
csh_f3_id_of_data_included,
csh_a1_contains_access_information,
csh_i3_01_ref_other_metadata,
csh_i3_02_ref_other_data,
csh_i3_03_qual_ref_other_metadata,
csh_i3_04_qual_ref_other_data,
csh_r1_1_01_has_reuse_license,
csh_r1_1_02_has_standard_reuse_license
csh_r1_1_02_has_standard_reuse_license,
csh_r1_1_03_has_machine_readable_reuse_license,
csh_r1_2_01_has_provenance_information,
csh_r1_2_02_has_standardized_provenance_information
]
25 changes: 23 additions & 2 deletions app/celery/automated_tasks/csh_fair.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def is_doi(identifier: str):



def incoperate_results(task_dict: dict, result: 'app.models.TaskStatus', test: bool):
def incoperate_results(task_dict: dict, result: 'app.models.TaskStatus', test: bool): ## shouldn't app.models.TaskStaus be used without ' ?
import app.models #dynamic import

session_id = task_dict["session_id"]
Expand Down Expand Up @@ -218,7 +218,28 @@ def csh_a1_contains_access_information(task_dict: dict, data: dict, test: bool =
result = "failed"

incoperate_results(task_dict, result, test)
print("working?")

@app.task
def csh_a1_03_id_resolves_to_record(task_dict, result, test):
""" 1. build URL with base_url + ID
2. somehow ping URL """
id = check_route(["resource", "identifier"])
url = "https://csh.nfdi4health.de/resource/" + id

try:
response = requests.get(url, timeout=5)
if response.status_code == 200:
print(f"The URL {url} resolves successfully.")
result = "success"
else:
print(f"The URL {url} returned status code {response.status_code}.")
result = "failed"
except requests.exceptions.RequestException as e:
print("An error occured on checking the URL")
result = "failed"

incoperate_results(task_dict, result, test)


@app.task
def csh_i3_01_ref_other_metadata(task_dict: dict, data: dict, test: bool = False):
Expand Down
8 changes: 7 additions & 1 deletion app/dependencies/settings.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,20 @@ class Config(BaseSettings):
automated_assessments: dict[str, str] = {
"CA-RDA-F1-01Model": "f1_model_persistent_identifier",
"CA-RDA-F4-01MM": "f4_model_metadata_harvestable",
"CSH-RDA-F1-01M": "csh_f1_1_persistent_identifier",
"CSH-RDA-F1-02M": "csh_f1_2_globally_unique_identifier",
"CA-RDA-F2-01M": "csh_f2_rich_metadata_provided",
"CA-RDA-F3-01M": "csh_f3_id_of_data_included",
"CSH-RDA-A1-01M": "csh_a1_contains_access_information",
"CSH-RDA-I3-01M": "csh_i3_01_ref_other_metadata",
"CSH-RDA-I3-02M": "csh_i3_02_ref_other_data",
"CSH-RDA-I3-03M": "csh_i3_03_qual_ref_other_metadata",
"CSH-RDA-I3-04M": "csh_i3_04_qual_ref_other_data",
"CSH-RDA-R1.1-01M": "csh_r1_1_01_has_reuse_license",
"CSH-RDA-R1.1-02M": "csh_r1_1_02_has_standard_reuse_license"
"CSH-RDA-R1.1-02M": "csh_r1_1_02_has_standard_reuse_license",
"CSH-RDA-R1.1-03M": "csh_r1_1_03_has_machine_readable_reuse_license",
"CSH-RDA-R1.2-01M": "csh_r1_2_01_has_provenance_information",
"CSH-RDA-R1.2-02M": "csh_r1_2_02_has_standardized_provenance_information"
}


Expand Down
5 changes: 4 additions & 1 deletion app/metrics/metrics.csv
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,22 @@
"CSH-RDA-F2-01M","Essential","Rich metadata is provided to allow discovery","The repository provides evidence that resource discovery metadata is sufficient for their designated community of users","Check if the mandatory attributes exist and have, if applicable, allowed values."
"CSH-RDA-F3-01M","Essential","Metadata includes the identifier for the data","The indicator deals with the inclusion of the reference (i.e. the identifier) of the resources in the metadata so that the resources can be accessed. The FAIR principle F3, which emphasizes that metadata should clearly and explicitly include the identifier of the data they describe, is broadly applicable to any type of resource that can be distinctly identified and referenced. This principle ensures that each piece of metadata is directly linked to its corresponding data or document, thereby enhancing the findability and accessibility of research resources.","Check if the list of resource ids contains an identifier that either has the relation “A describes B” or “A is metadata for B”. Also evaluate if the provided identifier follows an commonly accepted identifier scheme and is registered."
"CSH-RDA-F4-01M","Essential","Metadata is offered in such a way that it can be harvested and indexed","This metric pertains to the methods by which metadata is made accessible or delivered in a standardized and machine-readable format. To evaluate this metric, it is essential to grasp the functionalities provided by the data repository hosting the data. Metadata might be accessible through various channels. For instance, when resource is stored in a repository, this repository could distribute its metadata via a metadata harvesting protocol (such as OAI-PMH) and/or a web service.","This is a general indicator that has to be evaluated for the CSH as a platform. Metadata can be retrieved in a JSON format. The landing page provides a link in the footer that leads to the API. Thus, this indicator is implicitly passed."
"CSH-RDA-A1-01M","Important","Metadata contains information to enable the user to get access to the data or resources.","The indicator refers to the information that is necessary to allow the requester to gain access to the digital object. It is (i) about whether there are restrictions to access the data (i.e. access to the data may be open, restricted or closed), (ii) the actions to be taken by a person who is interested to access the data, in particular when the data has not been published on the Web and (iii) specifications that the resources are available through.","Check if the attribute chain design.dataSharingPlan.generally results in the value “Yes, there is a plan to share the ressource”. Beyond that, it is not feasible to evaluate the free text automatically. Thus, it is not possible to fully evaluate if this indicator can pass without human interaction."

"CSH-RDA-A1-01M","Important","Metadata contains information to enable the user to get access to the data or resources.","The indicator refers to the information that is necessary to allow the requester to gain access to the digital object. It is (i) about whether there are restrictions to access the data (i.e. access to the data may be open, restricted or closed), (ii) the actions to be taken by a person who is interested to access the data, in particular when the data has not been published on the Web and (iii) specifications that the resources are available through.","Check if the attribute chain design.dataSharingPlan.generally results in the value “Yes, there is a plan to share the ressource”. Beyond that, it is not feasible to evaluate the free text automatically. Thus, it is not possible to fully evaluate if this indicator can pass without human interaction."
"CSH-RDA-A1-02M","Essential","Metadata can be accessed manually","The indicator refers to any human interactions that are needed if the requester wants to access metadata. The FAIR principle refers mostly to automated interactions where a machine is able to access the metadata, but there may also be metadata that require human interactions. This may be important in cases where the metadata itself contains sensitive information. Human interaction might involve sending an e-mail to the metadata owner or calling by telephone to receive instructions.","Check if the attribute chain design.dataSharingPlan.generally results in the value “Yes, there is a plan to share the resource”. Beyond that, it is not feasible to evaluate the free text automatically. Thus, it is not possible to fully evaluate if this indicator can pass without human interaction."
"CSH-RDA-A1-03M","Essential","Metadata identifier resolves to a metadata record","This metric pertains to the clarity of the metadata identifier. The identifier given to the metadata must be linked to a resolution service that facilitates access to the metadata document.The indicator refers to any human interactions that are needed if the requester wants to access the digital object. This FAIR principle refers mostly to automated interactions where a machine is able to access the digital object, but there may also be digital objects that require human interactions, such as clicking on a link on a landing page, sending an e-mail to the data owner, or even calling by telephone.","In general the CSH provides the option to search for metadata based on its identifier. For sets that uploaded a check if the resource.identifier resolves via the logical URL. This indicator cannot be evaluated, if the FAIRness is evaluated during the creation of the metadata set. In this case the indicator is set as not applicable."
"CSH-RDA-A1-04M","Essential","Metadata is accessed through standardised protocol","In general the CSH provides the option to search for metadata based on its identifier. For sets that uploaded a check if the resource.identifier resolves via the logical URL. This indicator cannot be evaluated, if the FAIRness is evaluated during the creation of the metadata set. In this case the indicator is set as not applicable.","In general the CSH provides the option to search for metadata based on its identifier. For sets that uploaded a check if the resource.identifier resolves via the logical URL. This indicator cannot be evaluated, if the FAIRness is evaluated during the creation of the metadata set. In this case the indicator is set as not applicable."
"CSH-RDA-A1.1-01M","Essential","Metadata is accessible through a free access protocol","In general the CSH provides the option to search for metadata based on its identifier. For sets that uploaded a check if the resource.identifier resolves via the logical URL. This indicator cannot be evaluated, if the FAIRness is evaluated during the creation of the metadata set. In this case the indicator is set as not applicable.","In general the CSH provides the option to search for metadata based on its identifier. For sets that uploaded a check if the resource.identifier resolves via the logical URL. This indicator cannot be evaluated, if the FAIRness is evaluated during the creation of the metadata set. In this case the indicator is set as not applicable."
"CSH-RDA-A2-01M","Essential","Metadata is guaranteed to remain available after data is no longer available","In general the CSH provides the option to search for metadata based on its identifier. For sets that uploaded a check if the resource.identifier resolves via the logical URL. This indicator cannot be evaluated, if the FAIRness is evaluated during the creation of the metadata set. In this case the indicator is set as not applicable.","In general the CSH provides the option to search for metadata based on its identifier. For sets that uploaded a check if the resource.identifier resolves via the logical URL. This indicator cannot be evaluated, if the FAIRness is evaluated during the creation of the metadata set. In this case the indicator is set as not applicable."

"CSH-RDA-I1-01M","Important","Metadata uses knowledge representation expressed in standardised format","The indicator serves to determine that an appropriate standard is used to express knowledge, for example, controlled vocabularies for subject classifications.","This is a general question. For each attribute the allowed values should be checked whether they adhere to a fitting vocabulary."
"CSH-RDA-I1-02M","Important","Metadata uses machine-understandable knowledge representation","This is a general question. For each attribute the allowed values should be checked whether they adhere to a fitting vocabulary.","Generally the CSH exports a metadata object as an JSON object upon API request. Thus, this indicator implicitly passes."
"CSH-RDA-I2-01M","Important","Metadata uses FAIR-compliant vocabularies","The indicator requires the vocabulary used for the metadata to conform to the FAIR principles, and at least be documented and resolvable using globally unique and persistent identifiers. The documentation needs to be easily findable and accessible.","Implicitly fulfilled for every resource registered in the CHSH (FHIR representation in SIMPLIFIER)"
"CSH-RDA-I3-01M","Important","Metadata includes references to other metadata","The indicator is about the way that metadata is connected to other metadata, for example through links to information about organizations, people, places, projects or time periods that are related to the digital object that the metadata describes.","Implement a check if identifier with a fitting relation type are resolvable for the registry of the specific scheme. Allowed schemes are DOI, URL, arXiv, EAN13, EISSN, Handle, ISBN, ISTC and LISSN. Most likely not all schemas can be used for metadata."
"CSH-RDA-I3-02M","Useful","Metadata includes references to other data","This indicator examines how metadata interlinks with additional data sources to enhance its context, such as connections to preceding or related research data.","Implement a check if identifiers with a fitting relation type are resolvable for the registry of the specific scheme. Allowed schemes are DOI, URL, arXiv, EAN13, EISSN, Handle, ISBN, ISTC and LISSN."
"CSH-RDA-I3-03M","Important","Metadata includes qualified references to other metadata","This measure focuses on how metadata links to additional metadata, such as descriptions of associated resources that offer further insight into the data. The connections must be explicitly defined, indicating the nature of the relationship with the related resource, such as specifying that person Y authored dataset X.","Implement a check if identifiers with a fitting relation type are resolvable for the registry of the specific scheme. Allowed schemes are DOI, URL, arXiv, EAN13, EISSN, Handle, ISBN, ISTC and LISSN."
"CSH-RDA-I3-04M","Useful","Metadata includes qualified references to other data","This indicator is about the way metadata is connected to other data, for example linking to previous or related research data that provides additional context to the data. Please note that this is not about the link from the metadata to the data it describes; that link is considered in principle F3 and in indicator RDA-F3-01M.","Implement a check if identifiers with a fitting relation type are resolvable for the registry of the specific scheme. Allowed schemes are DOI, URL, arXiv, EAN13, EISSN, Handle, ISBN, ISTC and LISSN."

"CSH-RDA-R1-01M","Essential","Plurality of accurate and relevant attributes are provided to allow reuse","The indicator concerns the quantity but also the quality of metadata provided in order to enhance data reusability.","Check the existence of all applicable attributes."
"CSH-RDA-R1.1-01M","Essential","Metadata includes information about the licence under which the data can be reused","This indicator is about the information that is provided in the metadata related to the conditions (e.g. obligations, restrictions) under which data can be reused. It about the presence of licensing information, making sure that anyone accessing the data understands the permissions and restrictions placed on the data by the data owner. Key Element: The presence of licensing information, but not necessarily in a standardized or machine-readable format.","Check the existence of all applicable attributes."
"CSH-RDA-R1.1-02M","Important","Metadata refers to a standard reuse licence","This indicator requires the reference to the conditions of reuse to be a standard license, rather than a locally defined license. This goes a step further by specifying that the license mentioned in the metadata should not be just any license, but a standard, widely recognized license. This ensures that the terms of use are well-understood and consistent, reducing ambiguity for users who want to reuse the data. Key Element: Use of a standard, widely-recognized license to ensure clarity and consistency in understanding the terms of reuse.","Check the label of the license whether it fits to the list above."
Expand Down

0 comments on commit 9d22c21

Please sign in to comment.