[Nexus] NeXus URI schema

Carlos Pascual Izarra cpascual at cells.es
Mon Nov 29 09:38:34 GMT 2010


On Sat November 27 2010 17:52:46 Vicente Sole wrote:
> Hello,
> 
> Quoting Carlos Pascual Izarra <cpascual at cells.es>:
> > Hello,
> > I need to describe a certain dataset within a NeXus file as an URI.
> > 
> > For example for a Nexus file called "/path/to/foo.h5" containing a
> > 2D array as
> > a dataset in "/entry/data/bar", one could describe it as:
> > 
> > nexus:///patth/to/foo.h5#/entry/data/bar
> > 
> > But I don't want to reinvent it if there is already an schema...
> > 
> > So, is there one?
> 
> Perhaps I have misunderstood something.
> 
> Is that not the case of a standard HDF5 external link?

That would make sense... 
Do you know where is that defined? (I did some googling but I couldn't find it)

> 
> > If not, any comments about the one I propose?
> > 
> > Any thoughts on how to describe indexes in the case of array data?
> 
> At the latest NIAC meeting it was decided to have an attribute
> "interpretation" with a set of defined values ("spectrum", "image",
> "vertex" and other one that I do not remember -probably "scalar"-). If
> you follow standard C order, that should take you quite far. If not,
> there were the "offsets" and "strides" (I do not remember if there was
> an s at the end or not) attributes  to describe how the data were to
> be read. Is your question related to that?

Regarding the indices, either I don't understand you and Pete's answers or I 
didn't explain myself correctly.
My question was also related to URI. I can rephrase it as:
How to encode indices (or indices ranges) in a URI?

Expanding my previous example, imagine that I have file  "/path/to/foo.h5" 
which contains a dataset in "/entry/data/bar" which happens to be three 
dimensional with dimensions N1 x N2 x N3. Say that I want to access the same 
array that in a numpy array would be described as bar[5,6,:]

one (maybe naive?) way of encoding this would be:

nexus:///patth/to/foo.h5#/entry/data/bar[5,6,:]

another possibility (less readable in my opinion) which makes use of URI query 
format instead of the URI fragment, would be:

nexus:///patth/to/foo.h5?nxpath=&index_1=5&index_2=6

Which one do you think is better?

By the way, I find the following documents very useful for understanding URIs:

http://en.wikipedia.org/wiki/URI_scheme
http://www.ietf.org/rfc/rfc2396.txt


-- 
+----------------------------------------------------+
 Carlos Pascual Izarra
 Scientific Software Contact
 Computing Division
 Cells / Alba Synchrotron  [http:/www.cells.es]
 Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3
 E-08290 Cerdanyola del Valles (Barcelona), Spain
 E-mail: carlos.pascual at cells.es
 Phone: +34 93 592 4428
+----------------------------------------------------+


More information about the NeXus mailing list