1 / 19

Lecture 6

Lecture 6. Data flows, serial structures, data interchange standards and XML. Service Provider. Consolidator. extract. Schedule data. Validate and load. Consolidated schedules. Fixed Format file. 01 70Centre 1 020720 020740 ..

wilson
Télécharger la présentation

Lecture 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 6 Data flows, serial structures, data interchange standards and XML

  2. Service Provider Consolidator extract Schedule data Validate and load Consolidated schedules

  3. Fixed Format file • 01 70Centre 1 • 020720 • 020740 • .. • 01 99Centre to Blackboy Hill 2 • 020930

  4. Fixed format file definition There are two record types 01 and 02. 01 records define routes, 02 records define departures on the preceding route. 01 Format 1-2 record number ‘01’ 3-6 route number 7-27 destination 28 bay number ( 1-5) 02 Format 1-2 record number ‘02’ 3-4 departure time: hours (24 hour clock – local time) 5-6 departure time : minutes See the atco-cif file definition

  5. META-DATA – data about the data. • File structure • Validation rules • Origination and authorisation • Version

  6. Formal syntax definitions • Enable a process to read the syntax definition, then check a file conforms to the syntax – is ‘well-formed’ • Enable programmers to define transformations of the file into other formats (for XML using XSLT) • Communicates a file definition to writers and readers of the file • Defines the implicit data model

  7. Comma Separated Variable (CSV) Files • 01,70,Centre,1 • 02,07:20 • 02,07:40 • .. • 01,99,Centre to Blackboy Hill, 2 • 02,09:30

  8. Existing File formats • Files from legacy COBOL systems (coded as fixed format records, with no attached meta-data) • BACS files for bank – standard published by the Association for Payment Clearing Services • Image file formats (JPEG,GIF) • Sound files (MP3) • Archived, Compressed files (ZIP) • HTML?

  9. HTML <table border=1><tr><th>Route</th><th>Time</th><th>Destination</th><th>Bay</th></tr><tr><td><a href='http://www.firstcityline.co.uk/tt/070mf.htm '>70</a></td><td>15:24:00</td><td>Centre</td><td>3</td></tr> <tr><td><a href='http://www.firstcityline.co.uk/tt/070mf.htm '>70</a></td><td>15:39:00</td><td>Centre</td><td>3</td></tr>

  10. XML <route> <routeno>99</routeno> <destination>Centre via Blackboy Hill</destination> <bay>2</bay> <departures> <dtime>7:00</dtime> <dtime>7:20</dtime> </departures> </route>

  11. Cascading Style Sheet routeno {display: block; color:red; font-size:400%; } destination {display: block; border-style:double; border-width:thick; color: pink;font-size:200%; } bay {display: none; } dtime {display: table-cell;}

  12. File Route * routeno destination bay departures Dtime * Jackson Structure Diagram

  13. Extract from TransXchange doc

  14. BNF syntax specifiation file = { route } route = routeno destination bay departures departures = {departure} routeno= 2 {char} 3 destination = 5 {char}20 bay = digit departure = dtime dtime = digit digit ':' digit digit digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' char = letter | digit letter = ‘A’ | ‘B’ | ‘C’ | ‘D’ | ‘E’ | ‘F’ | ‘G’ | ‘H’ | ‘I’ | ‘J’ | ‘K’ | ‘L’ | ‘M’ | ‘N’ | ‘O’ | ‘P’ | ‘Q’ | ‘R’ | ‘S’ | ‘T’ | ‘U’ | ‘V’ | ‘W’ | ‘X’ | ‘Y’ | ‘Z’

  15. Generated random data • 01,E60,ETET NHNXETE,2 • 02,59:39 • 02,19:43 • 02,83:55 • 02,50:27 • 02,70:69 • 02,87:66 • 02,48:21 • 02,93:26 • 02,99:11 • 02,36:20 • 02,13:23

  16. XML DTD for the schedule <!DOCTYPE route [ <!ELEMENT route (routeno,destination,bay,departures)> <!ELEMENT routeno (#PCDATA)> <!ELEMENT destination (#PCDATA)> <!ELEMENT bay (#PCDATA)> <!ELEMENT departures (dtime+) > <!ELEMENT dtime (#PCDATA) > ]>

  17. XSchema definition <?xml version="1.0"?> <xs:element name="route"> <xs:complexType> <xs:sequence> <xs:element name="routeNo" type="xs:string"/> <xs:element name="destination" type="xs:string"/> <xs:element name="bay" type="xs:string"/> <xs:element name="departures"> <xs:complexType> <xs:sequence> <xs:element name="dtime" maxOccurs="unbounded" type="xs:time"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

  18. Beyond Syntax • Is this file authorized by the service provider? • How are authorized providers set up within the consolidator? • Which side of the interaction is responsible for initiating the transfer – • the consolidator ( “pull”) • or the service provider (“push”) • Where are pushed files stored before processing? • If there is an error in the file, how is this fact notified to the provider? • What else?

  19. Exercises • Take a look at the BNF sentence generator • Modify my syntax to add the weblink • Look at the atco-cif file spec: • Draw the JSD • Draw the underlying ER model • Look at the TransXchange XSchema

More Related