Beispiel #1
0
 def test_F1A_biotools_none(self):
     metric_f1a = FAIRMetricsFactory.get_F1A(impl=Implem.FAIR_CHECKER)
     web_resource = WebResource("https://bio.tools/bwa")
     metric_f1a.set_web_resource(web_resource)
     print(metric_f1a)
     res = metric_f1a.evaluate()
     logging.info(res)
     self.assertEqual(res.get_score(), str(Result.STRONG.value))
Beispiel #2
0
 def test_F1A_dataverse(self):
     dataverse = WebResource(
         # "https://data.inrae.fr/dataset.xhtml?persistentId=doi:10.15454/P27LDX"
         "https://data.inrae.fr/dataset.xhtml?persistentId=doi:10.15454/DOMEHB"
         # "https://data.inrae.fr/api/datasets/export?exporter=schema.org&persistentId=doi%3A10.15454/DOMEHB"
     )
     res = FAIRMetricsFactory.get_F1A(web_resource=dataverse,
                                      impl=Implem.FAIR_CHECKER).evaluate()
     logging.info(res)
     self.assertEqual(res.get_score(), str(Result.STRONG.value))
Beispiel #3
0
def eval_metrics(web_res):
    metrics_collection = []
    metrics_collection.append(FAIRMetricsFactory.get_F1A(web_res))
    metrics_collection.append(FAIRMetricsFactory.get_F1B(web_res))
    metrics_collection.append(FAIRMetricsFactory.get_F2A(web_res))
    metrics_collection.append(FAIRMetricsFactory.get_I1(web_res))
    #   metrics_collection.append(FAIRMetricsFactory.get_I2(web_res))
    metrics_collection.append(FAIRMetricsFactory.get_I3(web_res))
    metrics_collection.append(FAIRMetricsFactory.get_R11(web_res))
    metrics_collection.append(FAIRMetricsFactory.get_R12(web_res))
    #    metrics_collection.append(FAIRMetricsFactory.get_R13(web_res))

    row = {"ID": web_res.get_url()}
    row_time = {"ID": web_res.get_url()}
    for m in metrics_collection:
        ts1 = time.time()
        e = m.evaluate()
        duration = round((time.time() - ts1), 2)
        if e is not None:
            row[m.get_principle_tag()] = e.get_score()
            row_time[m.get_principle_tag()] = duration

    return row, row_time
Beispiel #4
0
 def test_F1A_biotools(self):
     biotools = FindabilityTestCase.tool
     res = FAIRMetricsFactory.get_F1A(web_resource=biotools,
                                      impl=Implem.FAIR_CHECKER).evaluate()
     logging.info(res)
     self.assertEqual(res.get_score(), str(Result.STRONG.value))