Skip to content

Instantly share code, notes, and snippets.

@fils
Created January 15, 2016 21:11
Show Gist options
  • Save fils/f65feca2632dbdd86032 to your computer and use it in GitHub Desktop.
Save fils/f65feca2632dbdd86032 to your computer and use it in GitHub Desktop.
This gist is using the Python code at https://github.com/pymonger/prov_es to attempt to model the prov workflow for Open Core Data. This code use a first stab at simply modifying the prov_es code to the simpler OCD event.
from datetime import datetime, timedelta
from prov_es.model import ProvEsDocument
# create doc
doc = ProvEsDocument()
# input database...
# Janus database credit JRSO/TAMU
id = "Janus" # not an id, just a NAME
downloadURL = 'http://iodp.org' # no download URL, just an "info" URL
instrument = "measurement:thermalconductivity" # the type of measurements being read from the database
# put an organization with this?
doc.dataset(id, [downloadURL], [instrument])
# software
software = "eos:ocdJanus" # The ETL code...
# put a github URl with this? (have one)
# put an organization with this?
doc.software(software)
# output dataset
out_id = "9_83A_JanusCoreSummary_IAoFPcse.csv"
out_doi = "10.5067/ARIAMH/CSK/Interferogram"
out_accessURL = 'http://opencoredata.org/id/dataset/3671b954-d967-47ac-a21e-70bf9c62d134'
out_downloadURL = 'http://opencoredata.org/doc/dataset/3671b954-d967-47ac-a21e-70bf9c62d134.csv'
# put an organization with this?
doc.dataset(out_id, out_doi, [out_downloadURL], [instrument])
print doc.serialize(indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment