Skip to content
Snippets Groups Projects
Unverified Commit 424459b4 authored by rpaganmunoz's avatar rpaganmunoz Committed by GitHub
Browse files

Update do_share_onedata.py

Adding an extra line to the metadata for fulfilling Dublin core format
parent 220fb2fc
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,13 @@ OneData_FolderLevel0_id = ""
catalog_path_temp = "" # LOCAL FOLDER TO SAVE THE XML FILES
OneData_handleServiceId = ""
# Data for dublin core format
xmlns_oaci_dc = '"http://www.openarchives.org/OAI/2.0/oai_dc/"'
xmlns_dc = '"http://purl.org/dc/elements/1.1/"'
xmlns_xsi = '"http://www.w3.org/2001/XMLSchema-instance"'
xsi_schemaLocation = '"http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"'
oai_dc_content = 'xmlns:oai_dc=' + xmlns_oaci_dc + ' xmlns:dc=' + xmlns_dc + ' xmlns:xsi=' + xmlns_xsi + ' xsi:schemaLocation=' + xsi_schemaLocation
# own functions
......@@ -178,6 +185,7 @@ def folder1_getattrs (handleservice_id, local_path, folder1_id, host, token):
print(allinfo_level1['handleId'])
else:
print('creating handle')
# UNCOMMENT FOR CREATING ALL MISSING HANDLES (NOT TESTED)
#OneData_createhandle(handleservice_id, allinfo_level1['shareId'], local_path, allinfo_level1['name'], host, token)
else:
......@@ -208,44 +216,45 @@ for p in all_level0['children']:
doc, tag, text = Doc().tagtext()
with tag('metadata'):
with tag('dc:title'):
text(all_level1['title'])
with tag('dc:creator'):
text(all_level1["creator"]['@id'])
with tag('dc:date'):
text(all_level1["@graph"][1]['prov:endedAtTime'])
with tag('dc:subject'):
text('High energy astrophysics')
with tag('dc:subject'):
text('http://astrothesaurus.org/uat/739')
with tag('dc:subject'):
text('Particle astrophysics')
with tag('dc:subject'):
text('http://astrothesaurus.org/uat/96')
with tag('dc:subject'):
text('Astronomical simulations')
with tag('dc:subject'):
text('http://astrothesaurus.org/uat/1857')
with tag('dc:rights'):
text('CC BY 4.0')
with tag('dc:rights'):
text('https://creativecommons.org/licenses/by/4.0/')
with tag('dc:rights'):
text('LAGO rights')
with tag('dc:rights'):
text('https://raw.githubusercontent.com/lagoproject/DMP/1.1/rights/lagoCommonRights.jsonld')
with tag('dc:description'):
text(all_level1["description"])
with tag('dc:contributor'):
text('EGI Datahub')
with tag('dc:instrument'):
text('LAGO Observatory')
with tag('dc:contact'):
text('lago-eosc(at)lagoproject.net')
with tag('dc:discipline'):
text('Astrophysics and Astronomy')
with tag('dc:publisher'):
text('LAGO Collaboration')
with tag('oai_dc:dc', oai_dc_content):
with tag('dc:title'):
text(all_level1['title'])
with tag('dc:creator'):
text(all_level1["creator"]['@id'])
with tag('dc:date'):
text(all_level1["@graph"][1]['prov:endedAtTime'])
with tag('dc:subject'):
text('High energy astrophysics')
with tag('dc:subject'):
text('http://astrothesaurus.org/uat/739')
with tag('dc:subject'):
text('Particle astrophysics')
with tag('dc:subject'):
text('http://astrothesaurus.org/uat/96')
with tag('dc:subject'):
text('Astronomical simulations')
with tag('dc:subject'):
text('http://astrothesaurus.org/uat/1857')
with tag('dc:rights'):
text('CC BY 4.0')
with tag('dc:rights'):
text('https://creativecommons.org/licenses/by/4.0/')
with tag('dc:rights'):
text('LAGO rights')
with tag('dc:rights'):
text('https://raw.githubusercontent.com/lagoproject/DMP/1.1/rights/lagoCommonRights.jsonld')
with tag('dc:description'):
text(all_level1["description"])
with tag('dc:contributor'):
text('EGI Datahub')
with tag('dc:instrument'):
text('LAGO Observatory')
with tag('dc:contact'):
text('lago-eosc(at)lagoproject.net')
with tag('dc:discipline'):
text('Astrophysics and Astronomy')
with tag('dc:publisher'):
text('LAGO Collaboration')
result = indent(
doc.getvalue(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment