Hi Stephen,
It is hard to give concrete advice on this as attribute namespace use is
not yet part of the CF specification and there are a number of issues
surrounding it that need to be resolved before it becomes part of CF.
I have volunteered to moderate ticket #27 and have been working on a
summary of the ticket for the last few days. I'll be posting that in the
next day or two. So hopefully we'll have some active discussion on it
and can come to some decisions, write a proposal, and get it folded into CF.
If you don't have a looming deadline, it would probably be worth waiting
for some decisions on the various issues so that your data files won't
need to be changed to be CF compliant. (And, of course, your involvement
in the discussion would be most welcome.)
On the other hand, there seems to be agreement on the general need for
and form of this proposal. The main issues are backward compatibility
and resolving semantic conflict/overlap between conventions.
So, if you need to move forward, I think the main potentially moving
target for your use case is how to declare a namespace.
<opinion>
Currently, I am leaning towards keeping the declaration separate from
the existing framework. So, to me the "namespaces" global attribute
looks pretty good as does the namespace declaration container variable.
But the decision that will come out of the CF discussion is no clear.
</opinion>
The issue of escaping the colon (":") separating the namespace prefix
from the attribute name is only an issue for CDL. In a netCDF file, a
colon is just a colon. So, there is no need to deal with colon escaping
in code using the netCDF API. If you use ncdump, you will see colons
escaped with a backslash ("\:"). And if you write CDL from which to
generate files you will need to escape the colons.
Regards,
Ethan
Stephen Emsley wrote:
> Hi All
>
>
>
> I am considering data formats for an ESA Sentinel satellite ground
> processor. It will be based on netCDF-CF files packaged within SAFE , a
> common format for archiving to ensure long-term preservation of EO data
> holdings (earth.esa.int/SAFE). I would like to be able to include SAFE
> attributes within the netCDF-CF in order to simplify packaging.
>
>
>
> I came across CF-Metadata Trac ticket #27 : ?Using namespace tags to
> include other conventions...? which discussed using the Conventions
> attribute to declare an association between a prefix and namespace or
> using a ?namespace? attribute. Several alternative syntax were proposed.
> For instance,
>
>
>
> Conventions = "CF-1.4";
>
> namespaces ="safe=http://earth.esa.int/SAFE/<S3_schema>/"
>
>
>
> or
>
>
>
> Conventions = "CF-1.4, safe=http://earth.esa.int/SAFE/<s3_schema>/"
>
>
>
> In addition, there was discussion regarding the necessity of not of
> escaping the additional colon in the use of the namespace prefix e.g.
>
>
>
> var:safe\:attrib = "value" ;
>
>
>
> or
>
>
>
> var:safe:attrib = ?value? ;
>
>
>
>
>
> This use of namespaces would enable middleware to ingest netCDF-CF files
> and easily extract the mandatory SAFE attributes from the headers.
>
>
>
> Ticket #27 is a year old and I have found no more recent discussion
> regarding this proposal. Overloading the Conventions attribute to
> declare additional namespaces is fine (as was discussed in the Trac
> ticket). However, the usage of the prefix in netCDF files was undecided.
> I would be grateful for guidance regarding the recommended use of
> namespaces with respect to CF Conventions.
>
>
>
> Kind Regards
>
> Steve
Received on Thu Jul 23 2009 - 08:25:48 BST