From 46e28c1d5da1c242fe49e5e5d6fdcae7dc544070 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Wed, 8 Jul 2020 15:48:44 -0400 Subject: Hack in a valid-uri check Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- bh20sequploader/qc_metadata.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bh20sequploader') diff --git a/bh20sequploader/qc_metadata.py b/bh20sequploader/qc_metadata.py index 2b57991..3e1e471 100644 --- a/bh20sequploader/qc_metadata.py +++ b/bh20sequploader/qc_metadata.py @@ -27,6 +27,10 @@ def qc_metadata(metadatafile): g = schema_salad.jsonld_context.makerdf("workflow", doc, document_loader.ctx) rslt, reason = evaluate(g, shex, doc["id"], "https://raw.githubusercontent.com/arvados/bh20-seq-resource/master/bh20sequploader/bh20seq-shex.rdf#submissionShape") + # As part of QC make sure serialization works too, this will raise + # an exception if there are invalid URIs. + g.serialize(format="ntriples") + if not rslt: raise Exception(reason) -- cgit v1.2.3