User:Smhdog/OGF Data Format Description Language (DFDL)
This article is about the Open Grid Forum's Data Format Description Language, DFDL for short, often pronounced daff-o-dil.
Data Format Description Language (DFDL) is a modeling language for describing general text and binary data. A DFDL model or schema allows any text or binary data to be read (or "parsed") from its native format and to be presented as an instance of an information set. The same DFDL schema also allows data to be taken from an instance of an information set and written out (or "serialized") to its native format.
DFDL achieves this by building upon the facilities of W3C XML Schema 1.0. A subset of XML Schema is used, enough to enable the modeling of non-XML data. One of the results of this is that is very easy to use DFDL to convert general text and binary data, via a DFDL information set, into a corresponding XML document.
History
[edit]DFDL was created in response to a need for grid APIs to be able to understand data regardless of source. A language was needed capable of modeling a wide variety of existing text and binary data formats. A working group was established at the Global Grid Forum (which later became the Open Grid Forum) in 2004 to create a specification for such a language.
A decision was made early on to base the language on a subset of W3C XML Schema, using <xs:appinfo> annotations to carry the extra information necessary to describe a non-XML physical representation. This is an established approach that is already being used today in commercial systems. DFDL takes this approach and evolves it into an open standard capable of describing many text or binary data formats.
Work continued on the specification, culminating in the publication of DFDL 1.0 [1] as an OGF Proposed Recommendation in January 2011. A summary of DFDL and its features is available at the OGF site.
Implementations of DFDL processors that can parse and serialize data using DFDL schemas are in progress.
Example
[edit]Take as an example the following text data stream which gives the name, age and location of a person:
Joe Bloggs,46,Hampshire,England
The logical model for this data can be described by the following fragment of an XML Schema document. The order, names and types of the fields are modeled.
<big><xs:complexType name="person_type">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="age" type="xs:short"/>
<xs:element name="county" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:complexType></big>
To additionally model the physical representation of the data stream, DFDL augments the XML schema fragment with annotations on the xs:element and xs:sequence objects, as follows:
<xs:complexType name="person_type">
<xs:sequence>
<xs:annotation><xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:sequence encoding="ASCII" sequenceKind="ordered" separator="," separatorType="infix"
separatorPolicy="required"/>
</xs:appinfo></xs:annotation>
<xs:element name="name" type="xs:string">
<xs:annotation><xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:element lengthKind="delimited" encoding="ASCII"/>
</xs:appinfo></xs:annotation>
</xs:element>
<xs:element name="age" type="xs:short">
<xs:annotation><xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:element representation="text" lengthKind="delimited" encoding="ASCII"
textNumberRep="standard" textNumberPattern="#0" textNumberBase="10"/>
</xs:appinfo></xs:annotation>
</xs:element>
<xs:element name="county" type="xs:string">
<xs:annotation><xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:element lengthKind="delimited" encoding="ASCII"/>
</xs:appinfo></xs:annotation>
</xs:element>
<xs:element name="country" type="xs:string">
<xs:annotation><xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:element lengthKind="delimited" encoding="ASCII"/>
</xs:appinfo></xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
The property attributes on these DFDL annotations express that the data are represented in an ASCII text format with fields being of variable length and delimited by commas.
An alternative, more compact syntax is also provided, where DFDL properties are carried as non-native attributes on the XML Schema objects themselves.
<xs:complexType name="person_type">
<xs:sequence encoding="ASCII" sequenceKind="ordered" separator="," separatorType="infix" separatorPolicy="required">
<xs:element name="name" type="xs:string"
dfdl:lengthKind="delimited" dfdl:encoding="ASCII"/>
<xs:element name="age" type="xs:short"
dfdl:representation="text" dfdl:lengthKind="delimited" dfdl:encoding="ASCII"
dfdl:textNumberRep="standard" dfdl:textNumberPattern="##0" dfdl:textNumberBase="10"/>
<xs:element name="county" type="xs:string"
dfdl:lengthKind="delimited" dfdl:encoding="ASCII"/>
<xs:element name="country" type="xs:string"
dfdl:lengthKind="delimited" dfdl:encoding="ASCII"/>
</xs:sequence>
</xs:complexType>
See also
[edit]
References
[edit]
External links
[edit]