def test_identifiers_dataverse(self): dataverse = WebResource( "https://data.inrae.fr/dataset.xhtml?persistentId=doi:10.15454/P27LDX" ) res = FAIRMetricsFactory.get_F1B(web_resource=dataverse).evaluate() print(res) self.assertEqual(res.get_score(), str(Result.NO.value))
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))
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))
def mass_eval(samples): evals = [] exec_time = [] for url, graph in tqdm(samples.items()): wr = WebResource(url=url, rdf_graph=graph) row, row_time = eval_metrics(wr) evals.append(row) exec_time.append(row_time) return evals, exec_time
def test_EDAM(self): EDAM_KG = ConjunctiveGraph() # EDAM_KG.parse("https://edamontology.org/EDAM.owl") EDAM_KG.parse( "/Users/gaignard-a/Documents/Dev/edamverify/src/EDAM.owl") print(f"Loaded {len(EDAM_KG)} triples.") edam = WebResource( "file:///Users/gaignard-a/Documents/Dev/edamverify/src/EDAM.owl", rdf_graph=EDAM_KG, ) print(len(edam.get_rdf())) self.assertGreater(len(edam.get_rdf()), 36000) web_res = edam metrics_collection = [] metrics_collection.append(FAIRMetricsFactory.get_2(web_res)) metrics_collection.append(FAIRMetricsFactory.get_F1B(web_res)) metrics_collection.append(FAIRMetricsFactory.get_F2A(web_res)) metrics_collection.append(FAIRMetricsFactory.get_F2B(web_res)) metrics_collection.append(FAIRMetricsFactory.get_I1(web_res)) metrics_collection.append(FAIRMetricsFactory.get_I1A(web_res)) metrics_collection.append(FAIRMetricsFactory.get_I1B(web_res)) metrics_collection.append(FAIRMetricsFactory.get_I2(web_res)) metrics_collection.append(FAIRMetricsFactory.get_I2A(web_res)) metrics_collection.append(FAIRMetricsFactory.get_I2B(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 print(row)
def setUpClass(cls) -> None: super().setUpClass() cls.tool = WebResource(cls.uri_tool) cls.wf = WebResource(cls.uri_wf)
def test_identifiers_datacite(self): datacite = WebResource( "https://search.datacite.org/works/10.7892/boris.108387") res = FAIRMetricsFactory.get_F1B(web_resource=datacite).evaluate() print(res) self.assertEqual(res.get_score(), str(Result.NO.value))
def test_fairchecker(self): bwa = WebResource("https://fair-checker.france-bioinformatique.fr/") logging.info(f"{len(bwa.get_rdf())} loaded RDF triples")
def test_workflowhub(self): bwa = WebResource("https://workflowhub.eu/workflows/263") logging.info(f"{len(bwa.get_rdf())} loaded RDF triples") self.assertGreaterEqual(len(bwa.get_rdf()), 28) turtle = bwa.get_rdf().serialize(format="turtle") self.assertTrue("sc:ComputationalWorkflow" in turtle)
def test_dataverse(self): dataverse = WebResource( "https://data.inrae.fr/dataset.xhtml?persistentId=doi:10.15454/P27LDX" ) logging.info(f"{len(dataverse.get_rdf())} loaded RDF triples") self.assertGreaterEqual(len(dataverse.get_rdf()), 9)
def test_biotools(self): bwa = WebResource("http://bio.tools/bwa") logging.info(f"{len(bwa.get_rdf())} loaded RDF triples") self.assertGreaterEqual(len(bwa.get_rdf()), 124)
def test_I3_biotools(self): biotools = WebResource("http://bio.tools/bwa") res = FAIRMetricsFactory.get_I3(web_resource=biotools, impl=Implem.FAIR_CHECKER).evaluate() logging.info(res) self.assertEqual(res.get_score(), str(Result.STRONG.value))