diff --git a/.github/workflows/process_profile_script.py b/.github/workflows/process_profile_script.py index 39a588e..10ed3e9 100644 --- a/.github/workflows/process_profile_script.py +++ b/.github/workflows/process_profile_script.py @@ -54,33 +54,33 @@ def generate_rdf_for_profile(self, profile_name, label, comment, publisher, is_p # save the graph with additional profile triples # outfile = outputfilename+"."+filetype outfile = outputfilename - g.serialize(destination=outfile, format="json-ld") + g.serialize(destination=outfile, format="json-ld", auto_compact=True) print("Writing result to", outfile) g.close() - postproc = """ - { - "@context": { - "schema": "http://schema.org/", - "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", - "rdfs": "http://www.w3.org/2000/01/rdf-schema#", - "bioschemas": "https://discovery.biothings.io/view/bioschemas/" - }, - "@graph": - """ - - print("Postprocessing file to legit Bioschemas file format.") - - enriched = "" - with open(outfile, 'r') as file: - for line in file: - enriched += line.strip() + "\n" - file.close() - - postproc = postproc + enriched + "\n}" - - with open(outfile, "w") as file: - file.write(postproc) - file.close() + # postproc = """ + # { + # "@context": { + # "schema": "http://schema.org/", + # "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + # "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + # "bioschemas": "https://discovery.biothings.io/view/bioschemas/" + # }, + # "@graph": + # """ + + # print("Postprocessing file to legit Bioschemas file format.") + + # enriched = "" + # with open(outfile, 'r') as file: + # for line in file: + # enriched += line.strip() + "\n" + # file.close() + + # postproc = postproc + enriched + "\n}" + + # with open(outfile, "w") as file: + # file.write(postproc) + # file.close()