From c01188ec20936462357b317f81567aadc64c8f33 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 10 Nov 2020 11:52:37 -0500 Subject: Use arvados uuids for RDF subjects. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- bh20simplewebuploader/main.py | 5 +++++ workflows/pangenome-generate/collect-seqs.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index 51048a4..bcdf8d8 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -695,6 +695,11 @@ union pubseq:sample ?sample . ?sequenceuri pubseq:sample ?sample . }} +union +{{ + ?sequenceuri "{id}" . + ?sequenceuri pubseq:sample ?sample . +}} ?sample ?geo . ?geo rdfs:label ?geoname . diff --git a/workflows/pangenome-generate/collect-seqs.py b/workflows/pangenome-generate/collect-seqs.py index 1a0807c..225a61f 100644 --- a/workflows/pangenome-generate/collect-seqs.py +++ b/workflows/pangenome-generate/collect-seqs.py @@ -36,11 +36,14 @@ if len(sys.argv) > 3: for item in validated: pdh = item["portable_data_hash"] + uuid = item["uuid"] with arvados.collection.CollectionReader(pdh, api_client=api, keep_client=keepclient) as col: with col.open("sequence.fasta", "rt") as fa: - subject = "http://covid19.genenetwork.org/resource/%s" % pdh + subject = "http://covid19.genenetwork.org/resource/%s" % uuid label = fa.readline().strip() merged_metadata.write("<%s> \"%s\" .\n" % (subject, label[1:].replace('"', '\\"'))) + merged_metadata.write("<%s> \"%s\" .\n" % (subject, pdh)) + merged_metadata.write("<%s> \"%s\" .\n" % (subject, item["version"])) skip = (subject in blacklist or label[1:] in blacklist) if skip: merged_metadata.write("<%s> \"true\"^^ .\n" % subject) -- cgit v1.2.3