hapi-server / uri-templates

Repository of tools for URI templates
Apache License 2.0
2 stars 0 forks source link

SPASE examples containing template values #29

Open berniegsfc opened 4 months ago

berniegsfc commented 4 months ago

Here are two SPASE descriptions that contain //AccessDirectoryTemplate and //AccessFilenameTemplate values.

These are merely examples for testing and should not be considered permanent.

jbfaden commented 4 months ago

You might also consider: https://cdaweb.gsfc.nasa.gov/pre_generated_plots/kp_plots/ace27/gif/ac27_crn$(x;name=crn)_$Y$j$H-$(Y;end)$j$H.gif

This would allow any time within the 27-day interval to be associated with the file.

berniegsfc commented 4 months ago

The code has been updated. The change will be visible when 0.6.26 is deployed.

berniegsfc commented 4 months ago

I've deployed the change to all of our servers.

berniegsfc commented 3 months ago

Do you have code to convert from the old (all.xml) templates to this new syntax? If so, I may be able to automate adding the new template values to all of cdaweb's dataset SPASE descriptions.

jbfaden commented 3 months ago

Autoplot needed to do this but it's fairly simple, just converting the %Q to $v. I use your web services now to get the file listing, so this is probably no longer that useful.

berniegsfc commented 3 months ago

Is it really that simple? Just change all % characters to $ and replace $Q with $v? And then add subdividedby value at end of all.xml's //access/URL?

jbfaden commented 3 months ago

It's close to that. There are a number of filenames that have both start and stop times, and I don't know how these appear in all.xml. With URI Templates that would look like $Y$j$H-$(Y;end)$j$H.cdf.

berniegsfc commented 3 months ago

From the first example I found in all.xml, it looks like you just assume a second %Y in a filename is an end time. Off hand, I'm not sure I can make the second substitution with a simple regex search/replace but it still seems doable (and simpler than I thought).

berniegsfc commented 2 months ago

The latest version of hdpws adds these Template elements to ALL SPASE description which have CDAWeb AccessInformation and are in https://spdf.gsfc.nasa.gov/pub/catalogs/all.xml. This jupyter notebook demonstrates getting the values for all cdaweb datasets. It would be great if someone could add a few cells to the notebook demonstrating the actual use of the template values.