1998-07-15 03:00:46 +08:00
< html >
< head >
< TITLE > DDL for HDF5< / TITLE >
< / head >
< body >
< B > DDL in BNF < / B > < br >
< P >
The following describes the data description language for HDF5 file.
The description is in Backus-Naur Form. A quick explanation
of the some symbols used.
< PRE >
::= defined as
< tname> a token with the name tname
< a> | < b> one of < a> or < b>
< a> < FONT SIZE = 1.7 > opt< / FONT > zero or one occurrence of < a>
< a> * zero or more occurrence of < a>
< a> + one or more occurrence of < a>
TBD To Be Decided
< file> ::= hdf5 "< file_name> " { < file_boot_block> < FONT SIZE = 1.7 > opt< / FONT > < root_group> }
< file_name> ::= < identifier>
< file_boot_block> ::= boot_block { < boot_block_content> }
< boot_block_content> ::= TBD
< root_group> ::= group "/" { < group_attribute> * < group_member> * }
// Attributes and members can be in any order.
< group_attribute> ::= < attribute>
< attribute> ::= attribute "attr_name" { < datatype>
< dataspace>
< data> < FONT SIZE = 1.7 > opt< / FONT > }
// < datatype> , < dataspace> and < data> can be in any order
// as long as < data> comes the last.
< attr_name> ::= < identifier>
1998-08-21 23:44:36 +08:00
< datatype> ::= datatype { "< datatype_name> " } | // shared data type
datatype { < scalar_datatype> } |
datatype { < dt_definition> + }
1998-07-15 03:00:46 +08:00
< datatype_name> ::= < identifier>
1998-08-21 23:44:36 +08:00
< scalar_datatype> ::= H5T_NATIVE_CHAR | H5T_NATIVE_INT | ... // data types supported by HDF5
1998-07-15 03:00:46 +08:00
1998-08-21 23:44:36 +08:00
< dt_definition> ::= < scalar_datatype> < field_name> ;
1998-07-15 03:00:46 +08:00
1998-08-21 23:44:36 +08:00
< field_name> ::= < identifier>
1998-07-15 03:00:46 +08:00
1998-08-21 23:44:36 +08:00
< dataspace> ::= dataspace { "< dataspace_name> " } |
dataspace { array < current_dims> < max_dims> } |
dataspace { other < ds_definition> + }
1998-07-15 03:00:46 +08:00
< dataspace_name> ::= < identifier>
1998-08-21 23:44:36 +08:00
< current_dims> ::= a list of integers represented as (< i > i< FONT SIZE = 1.0 > 1< / i > < / FONT > , < i > i< FONT SIZE = 1.0 > 2< / i > < / FONT > , ... ) where < i > i< FONT SIZE = 1.0 > k< / i > < / FONT > is an integer, < i > k< / i > = 1,2,...
1998-07-15 03:00:46 +08:00
1998-08-21 23:44:36 +08:00
< max_dims> ::= (< i > i< FONT SIZE = 1.0 > 1< / i > < / FONT > , < i > i< FONT SIZE = 1.0 > 2< / i > < / FONT > , ... ) where < i > i< FONT SIZE = 1.0 > k< / i > < / FONT > is an integer or H5S_UNLIMITED
1998-07-15 03:00:46 +08:00
< ds_definition> ::= TBD
1998-08-21 23:44:36 +08:00
< data> ::= data {TBD}
1998-07-15 03:00:46 +08:00
< group_member> ::= < named_datatype> | < named_dataspace> | < group> | < dataset> | < link>
1998-08-21 23:44:36 +08:00
< named_datatype> ::= datatype "< datatype_name> " { < dt_definition> + }
1998-07-15 03:00:46 +08:00
< named_dataspace> ::= dataspace "< dataspace_name> " {array < current_dims> < max_dims> } |
dataspace "< dataspace_name> " { other < ds_definition> + }
< group> ::= group "< group_name> " { < group_attribute> * < group_member> * }
// Attributes and members can be in any order.
< group_name> ::= < identifier>
< dataset> ::= dataset "< dataset_name> " { < datatype>
< dataspace>
< storagelayout> < FONT SIZE = 1.7 > opt< / FONT >
< compression> < FONT SIZE = 1.7 > opt< / FONT >
< dataset_attribute> *
< data> < FONT SIZE = 1.7 > opt< / FONT > }
// Any order is ok as long as < data> and < dataset_attribute> are
// after < datatype> and < dataspace> .
< dataset_name> ::= < identifier>
1998-08-21 23:44:36 +08:00
< storagelayout> :: = storagelayout < contiguous_layout> |
storagelayout < chunked_layout> |
storagelayout < compact_layout> |
storagelayout < external_layout>
1998-07-15 03:00:46 +08:00
< contiguous_layout> ::= {contiguous} // default
< chunked_layout> ::= {chunked < dims> }
1998-08-21 23:44:36 +08:00
< dims> ::= (< i > i< FONT SIZE = 1.0 > 1< / i > < / FONT > , < i > i< FONT SIZE = 1.0 > 2< / i > < / FONT > , ... ), < i > i< FONT SIZE = 1.0 > k< / i > < / FONT > is an integer, < i > k< / i > = 1,2,...
1998-07-15 03:00:46 +08:00
1998-08-21 23:44:36 +08:00
< compact_layout> ::= TBD
1998-07-15 03:00:46 +08:00
< external_layout> ::= {external < external_file> + }
< external_file> ::= (< file_name> < offset> < size> )
< offset> ::= an integer
< size> ::= an integer
1998-08-21 23:44:36 +08:00
< compression> :: = compression { TBD }
1998-07-15 03:00:46 +08:00
1998-08-21 23:44:36 +08:00
< dataset_attribute> ::= < attribute>
1998-07-15 03:00:46 +08:00
< link> ::= < hardlink> | < softlink>
1998-08-21 23:44:36 +08:00
< hardlink> ::= hardlink "< hardlink_name> " { linktarget "< target> " }
1998-07-15 03:00:46 +08:00
< hardlink_name> ::= < identifier>
< target> ::= < identifier>
1998-08-21 23:44:36 +08:00
< softlink> ::= softlink "< softlink_name> " { linktarget "< target> " }
1998-07-15 03:00:46 +08:00
< softlink_name> ::= < identifier>
< identifier> ::= string
// character "/" should be used with care.
// < dataset_name> cannot contain "/", for example.
< / PRE >
< HR >
< B > An example of HDF5 File in DDL < / B >
< PRE >
Consider an HDF5 file, example.h5, with the following structure:
/
/ | \
group1 group3 dataset3
1998-08-21 23:44:36 +08:00
/ \ |
group2 dataset2 softlink
/
dataset1
1998-07-15 03:00:46 +08:00
hdf5 "example" {
group "/" {
1998-08-21 23:44:36 +08:00
datatype "shared_datatype" { // named data type
H5T_NATIVE_CHAR c[20];
H5T_NATIVE_INT i;
1998-07-15 03:00:46 +08:00
}
1998-08-21 23:44:36 +08:00
attribute "group_attribute" { //attribute
datatype {H5T_NATIVE_CHAR}
dataspace {array (20) (20)}
data { "group attribute" }
1998-07-15 03:00:46 +08:00
}
group "group1" {
group "group2" {
dataset "dataset1" {
1998-08-21 23:44:36 +08:00
dataspace {array (4) (4)}
datatype {"shared_datatype"}
1998-07-15 03:00:46 +08:00
attribute "dataset1_attr" {
1998-08-21 23:44:36 +08:00
datatype {H5T_NATIVE_CHAR}
dataspace {array (10) (10)}
}
1998-07-15 03:00:46 +08:00
}
}
dataset "dataset2" {
1998-08-21 23:44:36 +08:00
datatype {H5T_NATIVE_INT}
dataspace {array (2,5) (H5S_UNLIMITED, 5)}
data {0,0,0,0,0,0,0,0,0,0}
1998-07-15 03:00:46 +08:00
}
}
group "group3" {
1998-08-21 23:44:36 +08:00
softlink "slink" {
linktarget "/sometarget"
1998-07-15 03:00:46 +08:00
}
}
dataset "dataset3" {
1998-08-21 23:44:36 +08:00
datatype {H5T_NATIVE_FLOAT}
dataspace {array (100,100) (100,100)}
1998-07-15 03:00:46 +08:00
}
1998-08-21 23:44:36 +08:00
}
1998-07-15 03:00:46 +08:00
}