mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
423 lines
14 KiB
HTML
423 lines
14 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
<html>
|
|
<head>
|
|
<title>DDL for HDF5</title>
|
|
</head>
|
|
|
|
<body bgcolor="#FFFFFF">
|
|
|
|
|
|
<hr>
|
|
<center>
|
|
<table border=0 width=98%>
|
|
<tr><td valign=top align=left>
|
|
<a href="H5.intro.html">Introduction to HDF5</a> <br>
|
|
<a href="RM_H5Front.html">HDF5 Reference Manual</a> <br>
|
|
<a href="index.html">Other HDF5 documents and links</a> <br>
|
|
<!--
|
|
<a href="Glossary.html">Glossary</a><br>
|
|
-->
|
|
</td>
|
|
<td valign=top align=right>
|
|
And in this document, the
|
|
<a href="H5.user.html">HDF5 User's Guide</a>:
|
|
<a href="Files.html">Files</a>
|
|
<br>
|
|
<a href="Datasets.html">Datasets</a>
|
|
<a href="Datatypes.html">Data Types</a>
|
|
<a href="Dataspaces.html">Dataspaces</a>
|
|
<a href="Groups.html">Groups</a>
|
|
<a href="References.html">References</a>
|
|
<br>
|
|
<a href="Attributes.html">Attributes</a>
|
|
<a href="Properties.html">Property Lists</a>
|
|
<a href="Errors.html">Error Handling</a>
|
|
<a href="Filters.html">Filters</a>
|
|
<a href="Caching.html">Caching</a>
|
|
<br>
|
|
<a href="Chunking.html">Chunking</a>
|
|
<a href="Debugging.html">Debugging</a>
|
|
<a href="Environment.html">Environment</a>
|
|
DDL
|
|
<a href="Ragged.html">Ragged Arrays</a>
|
|
<!--
|
|
<hr>
|
|
And in this document, the
|
|
<a href="H5.user.html">HDF5 User's Guide</a>:
|
|
<a href="Attributes.html">H5A</a>
|
|
<a href="Datasets.html">H5D</a>
|
|
<a href="Errors.html">H5E</a>
|
|
<a href="Files.html">H5F</a>
|
|
<a href="Groups.html">H5G</a>
|
|
<a href="Properties.html">H5P</a>
|
|
<a href="References.html">H5R & H5I</a>
|
|
<a href="Ragged.html">H5RA</a>
|
|
<a href="Dataspaces.html">H5S</a>
|
|
<a href="Datatypes.html">H5T</a>
|
|
<a href="Filters.html">H5Z</a>
|
|
<a href="Caching.html">Caching</a>
|
|
<a href="Chunking.html">Chunking</a>
|
|
<a href="Debugging.html">Debugging</a>
|
|
<a href="Environment.html">Environment</a>
|
|
<a href="ddl.html">DDL</a>
|
|
-->
|
|
</td></tr>
|
|
</table>
|
|
</center>
|
|
<hr>
|
|
|
|
|
|
<h1>DDL in BNF for HDF5</h1>
|
|
|
|
|
|
<h2>1. Introduction</h2>
|
|
|
|
This document contains the data description language (DDL) for an HDF5 file.
|
|
The description is in Backus-Naur Form.
|
|
|
|
<h2>2. Explanation of Symbols</h2>
|
|
|
|
This section contains a brief explanation of the symbols used in the DDL.
|
|
|
|
<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
|
|
</pre>
|
|
|
|
<h2>3. The DDL</h2>
|
|
|
|
<dir>
|
|
<pre>
|
|
<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 "/" { <unamed_datatype>* <group_attribute>* <group_member>* }
|
|
|
|
<unamed_datatype> ::= DATATYPE "<unamed_type_name>" { <compound_type> }
|
|
|
|
<unamed_type_name> ::= the assigned name for unamed type is in the form of
|
|
#oid1:oid2, where oid1 and oid2 are the object ids of the type
|
|
|
|
<compound_type> ::= <member_type_def>+
|
|
|
|
<member_type_def> ::= <scalar_type_def> | <array_type_def>
|
|
|
|
<scalar_type_def> ::= <atomic_type> "<field_name>" ;
|
|
|
|
<atomic_type> ::= <integer> | <float> | <time> | <string> | <bitfield> | <opaque>
|
|
|
|
<integer> ::= H5T_STD_I8LE | H5T_STD_I16BE | H5T_STD_I16LE | H5T_STD_I32BE |
|
|
H5T_STD_I32LE | H5T_STD_I64BE | H5T_STD_I64LE | H5T_STD_U8BE |
|
|
H5T_STD_U8LE | H5T_STD_U16BE | H5T_STD_U16LE | H5T_STD_U32BE |
|
|
H5T_STD_U32LE | H5T_STD_U64BE | H5T_STD_U64LE | H5T_NATIVE_CHAR |
|
|
H5T_NATIVE_UCHAR | H5T_NATIVE_SHORT | H5T_NATIVE_USHORT |
|
|
H5T_NATIVE_INT | H5T_NATIVE_UINT | H5T_NATIVE_LONG | H5T_NATIVE_ULONG |
|
|
H5T_NATIVE_LLONG | H5T_NATIVE_ULLONG
|
|
|
|
<float> ::= H5T_IEEE_F32BE | H5T_IEEE_F32LE | H5T_IEEE_F64BE | H5T_IEEE_F64LE |
|
|
H5T_NATIVE_FLOAT | H5T_NATIVE_DOUBLE | H5T_NATIVE_LDOUBLE
|
|
|
|
<time> ::= TBD
|
|
|
|
<string> ::= { STRSIZE <strsize> ;
|
|
STRPAD <strpad> ;
|
|
CSET <cset> ;
|
|
CTYPE <ctype> ; }
|
|
|
|
<strsize> ::= an integer
|
|
|
|
<strpad> ::= H5T_STR_NULLTERM | H5T_STR_NULLPAD | H5T_STR_SPACEPAD
|
|
|
|
<cset> ::= H5T_CSET_ASCII
|
|
|
|
<ctype> ::= H5T_C_S1 | H5T_FORTRAN_S1
|
|
|
|
<bitfield> ::= TBD
|
|
|
|
<opaque> ::= TBD
|
|
|
|
<field_name> ::= <identifier>
|
|
|
|
<array_type_def> ::= <atomic_type> "<field_name>" <dim_sizes> ;
|
|
|
|
<dim_sizes> ::= [dimsize1][dimzise2]..., where dimsize1, dimsize2 are integers
|
|
|
|
<group_attribute> ::= <attribute>
|
|
|
|
<attribute> ::= ATTRIBUTE "<attr_name>" { <datatype>
|
|
<dataspace>
|
|
<data><FONT SIZE=1.7>opt</FONT> }
|
|
// <datatype> and <dataspace> must appear before <data>.
|
|
|
|
<attr_name> ::= <identifier>
|
|
|
|
<datatype> ::= DATATYPE { <atomic_type> } |
|
|
DATATYPE { <compound_type> }
|
|
DATATYPE { <named_type> }
|
|
|
|
<named_type> ::= "<path_name>"
|
|
|
|
<path_name> ::= <identifier>
|
|
|
|
<dataspace> ::= DATASPACE { SCALAR } |
|
|
DATASPACE { SIMPLE <current_dims> / <max_dims> } |
|
|
DATASPACE { COMPLEX <ds_definition>+ }
|
|
DATASPACE { "<dataspace_name>" } |
|
|
|
|
<current_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, <i>k</i> = 1,2,...
|
|
|
|
<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
|
|
|
|
<ds_definition> ::= TBD
|
|
|
|
<dataspace_name> ::= <identifier>
|
|
|
|
<data> ::= DATA { <scalar_space_data> | <simple_space_data> | <complex_space_data> }
|
|
|
|
<scalar_space_data> ::= <atomic_scalar_data> | <compound_scalar_data>
|
|
|
|
<atomic_scalar_data> :: = the value of data
|
|
// A string is enclosed in double quotes.
|
|
|
|
<compound_scalar_data> ::= { [ <member_data> ], [ <member_data> ], ... }
|
|
|
|
<member_data> ::= <atomic_scalar_data> | <atomic_simple_data>
|
|
|
|
<atomic_simple_data> :: = <atomic_element>, <atomic_element>, ...
|
|
|
|
<atomic_element> ::= <atomic_scalar_data>
|
|
|
|
<simple_space_data> :: = <atomic_simple_data> | <compound_simple_data>
|
|
|
|
<compound_simple_data> ::= <compoud_element>, <compound_element>, ...
|
|
|
|
<compound_element> ::= <compound_scalar_data>
|
|
|
|
<complex_space_data> ::= TBD
|
|
|
|
<group_member> ::= <named_datatype> | <named_dataspace> | <group> | <dataset> |
|
|
<softlink>
|
|
|
|
<named_datatype> ::= DATATYPE "<type_name>" { <compound_type> }
|
|
|
|
<type_name> ::= <identifier>
|
|
|
|
<named_dataspace> ::= TBD
|
|
|
|
<group> ::= GROUP "<group_name>" { <hardlink> } |
|
|
GROUP "<group_name>" { <group_attribute>* <group_member>* }
|
|
|
|
<group_name> ::= <identifier>
|
|
|
|
<hardlink> ::= HARDLINK "<path_name>"
|
|
|
|
<dataset> ::= DATASET "<dataset_name>" { <hardlink> } |
|
|
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> }
|
|
// Tokens within {} can be in any order as long as <data> and <dataset_attribute>
|
|
// are after <datatype> and <dataspace>.
|
|
|
|
<dataset_name> ::= <identifier>
|
|
|
|
<storagelayout> :: = STORAGELAYOUT <contiguous_layout> |
|
|
STORAGELAYOUT <chunked_layout> |
|
|
STORAGELAYOUT <compact_layout> |
|
|
STORAGELAYOUT <external_layout>
|
|
|
|
<contiguous_layout> ::= {CONTIGUOUS} // default
|
|
|
|
<chunked_layout> ::= {CHUNKED <dims> }
|
|
|
|
<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,...
|
|
|
|
<compact_layout> ::= TBD
|
|
|
|
<external_layout> ::= {EXTERNAL <external_file>+ }
|
|
|
|
<external_file> ::= (<file_name> <offset> <size>)
|
|
|
|
<offset> ::= an integer
|
|
|
|
<size> ::= an integer
|
|
|
|
<compression> :: = COMPRESSION { TBD }
|
|
|
|
<dataset_attribute> ::= <attribute>
|
|
|
|
<softlink> ::= SOFTLINK "<softlink_name>" { LINKTARGET "<target>" }
|
|
|
|
<softlink_name> ::= <identifier>
|
|
|
|
<target> ::= <identifier>
|
|
|
|
<identifier> ::= string
|
|
// character '/' should be used with care.
|
|
|
|
</PRE>
|
|
</dir>
|
|
|
|
|
|
<h2>4. An Example of an HDF5 File in DDL</h2>
|
|
|
|
<dir>
|
|
<PRE>
|
|
HDF5 "example.h5" {
|
|
GROUP "/" {
|
|
ATTRIBUTE "attr1" {
|
|
DATATYPE {
|
|
{ STRSIZE 17;
|
|
STRPAD H5T_STR_NULLTERM;
|
|
CSET H5T_CSET_ASCII;
|
|
CTYPE H5T_C_S1;
|
|
}
|
|
}
|
|
DATASPACE { SCALAR }
|
|
DATA {
|
|
"string attribute\000"
|
|
}
|
|
}
|
|
DATASET "dset1" {
|
|
DATATYPE { H5T_STD_I32BE }
|
|
DATASPACE { SIMPLE ( 10, 10 ) / ( 10, 10 ) }
|
|
DATA {
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
|
|
}
|
|
}
|
|
DATASET "dset2" {
|
|
DATATYPE {
|
|
H5T_STD_I32BE "a";
|
|
H5T_IEEE_F32BE "b";
|
|
H5T_IEEE_F64BE "c";
|
|
}
|
|
DATASPACE { SIMPLE ( 5 ) / ( 5 ) }
|
|
DATA {
|
|
{[1], [0.1], [0.001]},
|
|
{[2], [0.2], [0.002]},
|
|
{[3], [0.3], [0.003]},
|
|
{[4], [0.4], [0.004]},
|
|
{[5], [0.5], [0.005]}
|
|
}
|
|
}
|
|
GROUP "group1" {
|
|
DATASET "dset3" {
|
|
DATATYPE {
|
|
"/type1"
|
|
}
|
|
DATASPACE { SIMPLE ( 5 ) / ( 5 ) }
|
|
DATA {
|
|
{[100, 100], [0.1]},
|
|
{[200, 200], [0.2]},
|
|
{[300, 300], [0.3]},
|
|
{[400, 400], [0.4]},
|
|
{[500, 500], [0.5]}
|
|
}
|
|
}
|
|
}
|
|
GROUP "group2" {
|
|
HARDLINK "/group1"
|
|
}
|
|
SOFTLINK "slink1" {
|
|
LINKTARGET "somevalue"
|
|
}
|
|
DATATYPE "type1" {
|
|
H5T_STD_I32BE "a"[2];
|
|
H5T_IEEE_F32BE "b";
|
|
}
|
|
}
|
|
}
|
|
</pre>
|
|
</dir>
|
|
|
|
|
|
<hr>
|
|
<center>
|
|
<table border=0 width=98%>
|
|
<tr><td valign=top align=left>
|
|
<a href="H5.intro.html">Introduction to HDF5</a> <br>
|
|
<a href="RM_H5Front.html">HDF5 Reference Manual</a> <br>
|
|
<a href="index.html">Other HDF5 documents and links</a> <br>
|
|
<!--
|
|
<a href="Glossary.html">Glossary</a><br>
|
|
-->
|
|
</td>
|
|
<td valign=top align=right>
|
|
And in this document, the
|
|
<a href="H5.user.html">HDF5 User's Guide</a>:
|
|
<a href="Files.html">Files</a>
|
|
<br>
|
|
<a href="Datasets.html">Datasets</a>
|
|
<a href="Datatypes.html">Data Types</a>
|
|
<a href="Dataspaces.html">Dataspaces</a>
|
|
<a href="Groups.html">Groups</a>
|
|
<a href="References.html">References</a>
|
|
<br>
|
|
<a href="Attributes.html">Attributes</a>
|
|
<a href="Properties.html">Property Lists</a>
|
|
<a href="Errors.html">Error Handling</a>
|
|
<a href="Filters.html">Filters</a>
|
|
<a href="Caching.html">Caching</a>
|
|
<br>
|
|
<a href="Chunking.html">Chunking</a>
|
|
<a href="Debugging.html">Debugging</a>
|
|
<a href="Environment.html">Environment</a>
|
|
DDL
|
|
<a href="Ragged.html">Ragged Arrays</a>
|
|
<!--
|
|
<hr>
|
|
And in this document, the
|
|
<a href="H5.user.html">HDF5 User's Guide</a>:
|
|
<a href="Attributes.html">H5A</a>
|
|
<a href="Datasets.html">H5D</a>
|
|
<a href="Errors.html">H5E</a>
|
|
<a href="Files.html">H5F</a>
|
|
<a href="Groups.html">H5G</a>
|
|
<a href="Properties.html">H5P</a>
|
|
<a href="References.html">H5R & H5I</a>
|
|
<a href="Ragged.html">H5RA</a>
|
|
<a href="Dataspaces.html">H5S</a>
|
|
<a href="Datatypes.html">H5T</a>
|
|
<a href="Filters.html">H5Z</a>
|
|
<a href="Caching.html">Caching</a>
|
|
<a href="Chunking.html">Chunking</a>
|
|
<a href="Debugging.html">Debugging</a>
|
|
<a href="Environment.html">Environment</a>
|
|
<a href="ddl.html">DDL</a>
|
|
-->
|
|
</td></tr>
|
|
</table>
|
|
</center>
|
|
|
|
|
|
<hr>
|
|
<address>
|
|
<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a>
|
|
</address>
|
|
|
|
Last modified: 30 October 1998
|
|
|
|
</body>
|
|
</html>
|