Fantastic example!

Thank you Steve!

/Roger

-----Original Message-----
From: Steve Lawrence <[email protected]> 
Sent: Wednesday, July 10, 2019 8:37 AM
To: [email protected]
Subject: Re: Examples of file formats that use in-band nil? Examples of file 
formats that use out-of-band nil?

Here's a nice real world example of how having an appropriate representation of 
nil is important:

http://newsfeed.time.com/2012/02/18/mans-vanity-license-plate-attracts-20000-in-erroneous-tickets/

A short summary: DC police use "NO TAGS" as the license plate value when 
ticketing vehicles that do not have a license plate. But someone had a vanity 
plate of "NO TAGS" and started getting a bunch of tickets because the system 
couldn't differentiate the two.

In this case, the ticket file format should really be something like

  HAS_TAGS: YES
  TAG: NO TAGS

or this for when there is no tag:

  HAS_TAGS: NO
  TAG: NO TAGS

You could maybe consider this an out of band nil, where the tag should be 
considered nil if HAS_TAGS has a value of NO.




On 7/10/19 8:23 AM, Beckerle, Mike wrote:
> I did a quick search of the schemas on the github DFDL schemas site.
> 
> 
> NITF has nillable elements.
> 
> EDIFACT has nillable elements
> 
> 
> In EDIFACT case, empty strings become nilled elements. That's in-band for 
> string.
> 
> 
> NITF has nillable dates, and nillable strings. Nillable strings are 
> empty strings. Nillable dates are date elements containing all %SP; ie. all 
> spaces.
> That's in band, because the dates are textual representation also.
> 
> 
> Many of the common mil data formats have a concept of "NO STATEMENT" 
> which can be represented as either nilled elements, non-existing 
> elements, empty elements, or an explicit <NOSTATEMENT/> element that is a 
> marker. We're doing the latter.
> 
> 
> Arguably we should change this NO STATEMENT concept to one of the more 
> conventional forms. I tend not to want to use empty elements because 
> that creates ambiguity with empty string. Nilled elements are probably 
> the natural choice here, as these elements are required, not optional.
> 
> 
> I don't have any examples off-hand of out-of-band nils used in a data format. 
> But I will point out that XML's
> 
> <foo xsi:nil="true"/> is itself an out-of-band nil representation. The 
> attribute is a separate indicator out of band of the value space for the 
> element.
> 
> 
> 
> ----------------------------------------------------------------------
> ----------
> *From:* Costello, Roger L. <[email protected]>
> *Sent:* Wednesday, July 10, 2019 7:33:24 AM
> *To:* [email protected]
> *Subject:* Examples of file formats that use in-band nil? Examples of 
> file formats that use out-of-band nil?
> 
> Hello DFDL community,
> 
> There are two ways file formats denote that a region has a nil value:
> 
>   * *In-band nil: a symbol inserted into the region indicates nil. A part of 
> the
>     region's value space is reserved for indicating nil.*
>   * *Out-of-band nil: a symbol, separate from the region, indicates that the
>     region has a nil value.*
> 
> I am seeking examples of each. Can you tell me a file format that uses 
> in-band nil? Can you tell me a file format that uses out-of-band nil?
> 
> /Roger
> 

Reply via email to