-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provenance tracking using semantic web technologies? #228
Comments
@DamienIrving thanks for opening this thoughtful issue.
Yes absolutely.
I think this should be discussed in a new issue on the xarray github. It will get a lot more visibility and thoughtful input. Assuming that provenance could be tracked through a fancy I think users would want to opt-in to provenance tracking at the xarray level rather than only when calling functions through the |
@dcherian I agree there is value in getting input from the xarray crowd, and I agree provenance should be supported at the xarray level. However, I'm concerned that finding an all-purpose solution that works for every discipline will end up in an infinite github comment thread. I'd like to first define what the CF community wants, and then carry this proposal to xarray for feedback. Based on discussions at the 2020 CF meeting and private discussions with provenance pros, here would be some development guidelines:
|
Fair point, but I think it would still be valuable to figure out how to do this technically. Xarray is unlikely to provide provenance handling directly so we'll have to figure out how to hook in to it. The biweekly xarray dev meeting is tomorrow (Wednesday @ 9.30am Mountain Time). @huard & @DamienIrving, if you can, I think it would be good for you to attend and raise this issue there. If not, the meeting repeats every two weeks... We can use it to drive the conversation forward.
👍 but the audience on this repo is really tiny ! Maybe https://discourse.pangeo.io/? |
Makes sense, will try those suggestions. Thanks ! |
Hi @DamienIrving |
So... I'm thinking that cf_xarray can provide two functions: |
Just stumbled upon this on discourse, and I was wondering if xgcm (xgcm/xgcm#143) could piggy back on these efforts? |
Ah I guess another angle is how projects like xgcm can plug in to the provenance tracking infrastructure. xgcm could easily set the |
@dcherian I like this idea. @jbusecke I think the spirit is to have xarray expose a hook, and then let libraries configure those hooks to do the actual provenance tracking. I see no reason why xgcm couldn't implement its own provenance mechanism, built on or in parallel with cf-xarray using the same hook. |
This sounds great. Please keep me posted if there is anything I can help with or test on the xgcm side. |
See #253. Opinions are welcome! |
Hi all, I work with @huard and last week he asked me to take a stab at this problem. I read the METACLIP paper, and also carefully studied @dcherian's PR, and by assuming that the mechanism (and final outcome) that the paper describes is mostly in line with what is discussed in this thread, I'm not sure I see (yet) how something similar could be achieved using the proposed extension. My understanding of the METACLIP system is that its crucial feature is a specialized module ( So I'm wondering: could we solve this problem without such an extra component (i.e. something akin to |
Played with the PR, works well. A couple of thoughts.
|
Hello @cjauvin excited to see you try this out
Basically xarray won't explicitly add these metadata tracking steps but provides a hook where a custom function could do that.
I don't think so? It seems like there's a need for
So you want
Is this really needed at every function call or only when a result is written to disk? |
I believe we will need global dataset attributes (source, institution, contact, pid, etc), not just DataArray attributes.
Probably not. But then attrs['has_provenance'] would be an in-memory provenance graph object, and we'd need to delegate to the
|
I agree very much with what you suggested in this thread @huard , about global attributes, on the 2-level information type (human readable and machine oriented with more details), and also on the suggestion for the has_provenance attribute, ... |
Hmmm.. this is hard to fit in with xarray's design. But do you just need these when you "initialize" the provenance object? ds = xr.open_dataset(...)
# this loops through and creates a new provenance object for each DataArray,
# using both DataArray and Dataset attributes
ds = init_provenance(ds) If we can do that, is it correct that |
We'd need these anytime a Dataset/DataArray is included in the provenance graph.
Because you would attach the provenance object to each DataArray with the |
Yes that's what I was thinking but I have no experience in this area. It would be interesting to see a simple working example that shows the steps required to record all necessary provenance information. |
After considerable struggle, here is what I could come up with: #259 |
In recent years, Semantic Web technologies have been used to record the data processing steps involved in producing climate products (i.e. maps, plots or any other climate research outcome stored in a file).
While Python packages such as
rook
and ESMValTool simply define their own bespoke / narrow adaptation of the PROV / RDF data model to suit their own needs, there have been attempts to define a comprehensive ontology for climate products (e.g. Bedia et al 2019, Zhang et al., 2020).As far as I can tell, the most widely used ontology is METACLIP (METAdata for CLImate Products; see their website, flyer and paper), which was initially developed for the Copernicus QA4Seas seasonal forecasting project and is now also being used for the VALUE downscaling initiative. The METACLIP developers work in R and have integrated their approach to provenance tracking into the climate4R package.
I'm wondering if there's any interest in trying to figure out how to incorporate provenance tracking into xarray? There isn't a Python implementation of METACLIP yet, but presumably one could implement the ontology using rdflib. @huard suggested cf-xarray might be a good place to start the conversation around this, but happy to move the discussion elsewhere if it would be more appropriate?
The text was updated successfully, but these errors were encountered: