SDXF (Structured Data eXchange Format) is a
data serialization
In computing, serialization (or serialisation, also referred to as pickling in Python (programming language), Python) is the process of translating a data structure or object (computer science), object state into a format that can be stored (e. ...
format defined by RFC 3072. It allows arbitrary structured data of different types to be assembled in one file for
exchanging between arbitrary computers.
The ability to arbitrarily serialize data into a self-describing format is reminiscent of
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
, but SDXF is not a text format (as XML) — SDXF is not compatible with text editors. The maximal length of a datum (composite as well as elementary) encoded using SDXF is 16777215 bytes (one less than 16
MB).
Technical structure format
SDXF data can express arbitrary levels of structural depth. Data elements are
self-documenting, meaning that the
metadata
Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including:
* Descriptive ...
(numeric, character string or structure) are encoded into the data elements. The design of this format is simple and transparent: computer programs access SDXF data with the help of well-defined functions, exempting programmers from learning the precise data layout.
The word "exchange" in the name reflects another kind of transparency: the SDXF functions provide a computer architecture independent conversion of the data. Serializations can be exchanged among computers (via direct network, file transfer or CD) without further measures. The SDXF functions on the receiving side handle architectural adaptation.
Structured data
A data model is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities. For instance, a data model may specify that the data element representing a car be ...
is data with patterns predictable more complex than strings of text.
Example
A commercial example: two companies want to exchange digital invoices. The invoices have the following hierarchical nested structure:
INVOICE
│
├─ INVOICE_NO
├─ DATE
├─ ADDRESS_SENDER
│ ├─ NAME
│ ├─ NAME
│ ├─ STREET
│ ├─ ZIP
│ ├─ CITY
│ └─ COUNTRY
├─ ADDRESS_RECIPIENT
│ ├─ NAME
│ ├─ NAME
│ ├─ STREET
│ ├─ ZIP
│ ├─ CITY
│ └─ COUNTRY
├─ INVOICE_SUM
├─ SINGLE_ITEMS
│ ├─ SINGLE_ITEM
│ │ ├─ QUANTITY
│ │ ├─ ITEM_NUMBER
│ │ ├─ ITEM_TEXT
│ │ ├─ CHARGE
│ │ └─ SUM
│ └─ ...
├─ CONDITIONS
...
Structure
The basic element is a chunk. An SDXF serialization is itself a chunk. A chunk can consist of a set of smaller chunks.
Chunks are composed of a header prefix of six bytes, followed by data. The header contains a chunk identifier as a 2-byte binary number (Chunk_ID), the chunk length and type. It may contain additional information about compression, encryption and more.
The chunk type indicates whether the data consists of text (a string of characters), a binary number (integer or floating point) or if the chunk a composite of other chunks.
Structured chunks enable the programmer to pack hierarchical constructions such as the INVOICE above into an SDXF structure as follow:
Every named term (INVOICE, INVOICE_NO, DATE, ADDRESS_SENDER, etc.) is given a unique number out in the range 1 to 65535 (2 byte unsigned binary integer without sign). The top/outermost chunk is constructed with the ID INVOICE (that means with the associated numerical chunk_ID) as a structured chunk on level 1. This INVOICE chunk is filled with other chunks on level 2 and beyond: INVOICE_NO, DATE, ADDRESS_SENDER, ADDRESS_RECIPIENT, INVOICE_SUM, SINGLE_ITEMS, CONDITIONS. Some level 2 chunks are structured in turn as for the two addresses and SINGLE_ITEMS.
For a precise description see page 2 of the RFC or alternatively here.
SDXF allows programmer to work on SDXF structures with a compact function set.
There are only few of them:
The following
pseudocode
In computer science, pseudocode is a description of the steps in an algorithm using a mix of conventions of programming languages (like assignment operator, conditional operator, loop) with informal, usually self-explanatory, notation of actio ...
creates invoices:
init (sdx, buffersize=1000); // initialize the SDXF parameter structure sdx
create (sdx, ID=INVOICE, datatype=STRUCTURED); // start of the main structure
create (sdx, ID=INVOICE_NO, datatype=NUMERIC, value=123456); // create an elementary Chunk
create (sdx, ID=DATE, datatype=CHAR, value="2005-06-17"); // once more
create (sdx, ID=ADDRESS_SENDER, datatype=STRUCTURED); // Substructure
create (sdx, ID=NAME, datatype=CHAR, value="Peter Somebody"); // element. Chunk inside this substructure
...
create (sdx, ID= COUNTRY, datatype=CHAR, value="France"); // the last one inside this substructure
leave; // closing the substructure ADDRESS_SENDER
...
leave; // closing the substructure INVOICE
Pseudocode to extract the INVOICE structure could look like:
init (sdx, container=pointer to an SDXF-structure); // initialize the SDXF parameter structure sdx
enter (sdx); // join into the INVOICE structure.
//
while (sdx.rc SDX_RC_ok)
SDXF is not designed for readability or to be modified by text editors. A related editable structure is SDEF - Structured Data Editable Format.
[{{cite web, url=http://www.pinpi.com/en/sdef.htm , archive-url=https://web.archive.org/web/20160307070425/http://www.pinpi.com/en/sdef.htm , archive-date=2016-03-07 , title=SDEF Site (from Archive.org)]
See also
*
External Data Representation
*
Protocol Buffers
Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs that communicate with each other over a network or for storing data. The method involves an ...
*
Abstract Syntax Notation One
Abstract Syntax Notation One (ASN.1) is a standard interface description language (IDL) for defining data structures that can be serialized and deserialized in a cross-platform way. It is broadly used in telecommunications and computer networ ...
*
Apache Thrift
Thrift is an IDL (interface definition language, Interface Definition Language) and Binary protocol, binary communication protocol used for defining and creating service (systems architecture), services for programming languages. It was developed ...
*
Etch (protocol)
Etch was an open-source, cross-platform framework for building network services, first announced in May 2008 by Cisco Systems. Etch encompasses a service description language, a compiler, and a number of language bindings. It is intended to suppl ...
*
Internet Communications Engine
The Internet Communications Engine, or Ice, is an open-source RPC framework developed by ZeroC. It provides SDKs for C++, C#, Java, JavaScript, MATLAB, Objective-C, PHP, Python, Ruby and Swift, and can run on various operating systems, incl ...
*
Comparison of data serialization formats
This is a comparison of data serialization formats, various ways to convert complex objects to sequences of bits. It does not include markup languages used exclusively as document file format
A document file format is a Text file, text or bi ...
References
External links
Introduction chapter of a more detailed description
Internet Standards
Internet protocols
Computer file formats
Data serialization formats