Skip to content

Commit

Permalink
fix metadata preservation test
Browse files Browse the repository at this point in the history
  • Loading branch information
karacolada committed Jan 23, 2024
1 parent 5b971e0 commit 14dbd5c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 0 additions & 1 deletion fuji_server/controllers/fair_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ def check_semantic_vocabulary(self):

def check_metadata_preservation(self):
metadata_preserved_check = FAIREvaluatorMetadataPreserved(self)
metadata_preserved_check.set_metric("FsF-A2-01M")
return metadata_preserved_check.getResult()

def check_standardised_protocol_data(self):
Expand Down
5 changes: 4 additions & 1 deletion fuji_server/controllers/fair_object_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def assess_by_id(body):
formal_metadata_result = ft.check_formal_metadata()
# print('F-UJI checks: semantic vocab')
semantic_vocab_result = ft.check_semantic_vocabulary()
ft.check_metadata_preservation()
metadata_preserved_result = ft.check_metadata_preservation()
standard_protocol_data_result = ft.check_standardised_protocol_data()
standard_protocol_metadata_result = ft.check_standardised_protocol_metadata()
if uid_result:
Expand Down Expand Up @@ -175,6 +175,8 @@ async def assess_by_id(body):
results.append(standard_protocol_data_result)
if standard_protocol_metadata_result:
results.append(standard_protocol_metadata_result)
if metadata_preserved_result:
results.append(metadata_preserved_result)
debug_messages = ft.get_log_messages_dict()
# ft.logger_message_stream.flush()
summary = ft.get_assessment_summary(results)
Expand Down Expand Up @@ -205,6 +207,7 @@ async def assess_by_id(body):
if ft.pid_url:
idhelper = IdentifierHelper(ft.pid_url)
request["normalized_object_identifier"] = idhelper.get_normalized_id()
results.sort(key=lambda d: d["id"]) # sort results by metric ID
final_response = FAIRResults(
request=request,
start_timestamp=starttimestmp,
Expand Down
11 changes: 11 additions & 0 deletions fuji_server/evaluators/fair_evaluator_metadata_preservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def testPreservationGuaranteed(self):
break
test_status = False
if test_defined:
# TODO implement
if test_id.startswith("FRSM"):
self.logger.warning(
f"{self.metric_identifier} : Test for descriptive metadata is not implemented for FRSM."
)
registry_bound_pid = ["doi"]
test_score = self.getTestConfigScore(test_id)
if self.fuji.pid_scheme:
Expand Down Expand Up @@ -123,6 +128,12 @@ def evaluate(self):
test_status = "fail"
if self.testPreservationGuaranteed():
test_status = "pass"
if self.testPublicSearchEngine():
test_status = "pass"
if self.testMultipleCrossReferenced():
test_status = "pass"
if self.testZenodoLandingPage():
test_status = "pass"

self.result.score = self.score
self.result.output = self.outputs
Expand Down

0 comments on commit 14dbd5c

Please sign in to comment.