Die Präsentation wird geladen. Bitte warten

Die Präsentation wird geladen. Bitte warten

How to publish CSV on the Web or why standards are important ODI Friday lecture 26.11.2015 J. Umbrich, S. Neumaier.

Ähnliche Präsentationen


Präsentation zum Thema: "How to publish CSV on the Web or why standards are important ODI Friday lecture 26.11.2015 J. Umbrich, S. Neumaier."—  Präsentation transkript:

1 How to publish CSV on the Web or why standards are important ODI Friday lecture 26.11.2015 J. Umbrich, S. Neumaier

2 CSV

3 Prominent OD Format

4 or

5 Example 1

6 Example 2

7 Example 3

8 Example 4

9 Example 5

10 Example 6

11 CSV on the Web: for humans and machines CSV on the Web publishing CSV for humans and machines

12 What is CSV? (see RFC4180) RFC4180:https://tools.ietf.org/html/rfc4180 C OMMA -S EPARATED V ALUES 1.Each record is separated by a line break 2.The last record may or may not have an ending line break 3.There might be an optional header line 4.Within the header and each record, there may be one ore more fields, separated by commas 5.Each field may or may not be enclosed in double quotes 6.Fields containing line break, double quotes, and commas should be enclosed in double quotes 7.If double-quotes are used to enclose fields, then double-quote appearing inside a field must be escaped 8.file extension:.csvmime-type: text/csv

13 CSV on the Web is more used as Character-Separated Value files! Most CSV parsers cater for this by using heuristics to identify so called CSV-dialects “CSV” in the wild separator, ; \t line-ending\n \r \r\n quote chars“ ‘

14 “CSV” on data.gv.at mime-types CSV dialects Anaylsing “CSV “ from data.gv.at CSV-related files:1809 Parsable CSV files:1482 detected a header:1294 delimiter: ';’ 1471 ',’ 9 None 2 #comment lines: 0 1376 1 39 >1 67

15 Example 1

16 Beilage zum Rechnungsabschluss 2013;;;Nr. 4b; ;;;; NACHWEIS ÜBER DEN SCHULDENDIENST;;;; ;;;; Laut Voranschlag 2013 (inkl. Umbuchungen im Laufe des Jahres) waren für die Abwicklung des Schuldendienstes vorgesehen:;;;; ;;;; für Verzinsung;;€;8.038.400,00; Zinsreserve gesamt ;;€;12.800.000,00; für Tilgung;;€;29.915.700,00; Gesamtvoranschlag;;€;50.754.100,00; ;;;; Diesem Kredit steht die Jahresvorschreibung von;;€;49.665.135,01; gegenüber, sodass sich beim gesamten Schuldendienst;;;; eine E i n s p a r u n g von ;;€;1.088.964,99; ergibt. ;;;; ;;;; Beilage zum Rechnungsabschluss 2013;;;Nr. 4b; ;;;; NACHWEIS ÜBER DEN SCHULDENDIENST;;;; ;;;; Laut Voranschlag 2013 (inkl. Umbuchungen im Laufe des Jahres) waren für die Abwicklung des Schuldendienstes vorgesehen:;;;; ;;;; für Verzinsung;;€;8.038.400,00; Zinsreserve gesamt ;;€;12.800.000,00; für Tilgung;;€;29.915.700,00; Gesamtvoranschlag;;€;50.754.100,00; ;;;; Diesem Kredit steht die Jahresvorschreibung von;;€;49.665.135,01; gegenüber, sodass sich beim gesamten Schuldendienst;;;; eine E i n s p a r u n g von ;;€;1.088.964,99; ergibt. ;;;; ;;;;

17 Example 1 Beilage zum Rechnungsabschluss 2013;;;Nr. 4b; ;;;; NACHWEIS ÜBER DEN SCHULDENDIENST;;;; ;;;; Laut Voranschlag 2013 (inkl. Umbuchungen im Laufe des Jahres) waren für die Abwicklung des Schuldendienstes vorgesehen:;;;; ;;;; für Verzinsung;;€;8.038.400,00; Zinsreserve gesamt ;;€;12.800.000,00; für Tilgung;;€;29.915.700,00; Gesamtvoranschlag;;€;50.754.100,00; ;;;; Diesem Kredit steht die Jahresvorschreibung von;;€;49.665.135,01; gegenüber, sodass sich beim gesamten Schuldendienst;;;; eine E i n s p a r u n g von ;;€;1.088.964,99; ergibt. ;;;; ;;;; Beilage zum Rechnungsabschluss 2013;;;Nr. 4b; ;;;; NACHWEIS ÜBER DEN SCHULDENDIENST;;;; ;;;; Laut Voranschlag 2013 (inkl. Umbuchungen im Laufe des Jahres) waren für die Abwicklung des Schuldendienstes vorgesehen:;;;; ;;;; für Verzinsung;;€;8.038.400,00; Zinsreserve gesamt ;;€;12.800.000,00; für Tilgung;;€;29.915.700,00; Gesamtvoranschlag;;€;50.754.100,00; ;;;; Diesem Kredit steht die Jahresvorschreibung von;;€;49.665.135,01; gegenüber, sodass sich beim gesamten Schuldendienst;;;; eine E i n s p a r u n g von ;;€;1.088.964,99; ergibt. ;;;; ;;;; ; as separator

18 Example 1 Beilage zum Rechnungsabschluss 2013;;;Nr. 4b; ;;;; NACHWEIS ÜBER DEN SCHULDENDIENST;;;; ;;;; Laut Voranschlag 2013 (inkl. Umbuchungen im Laufe des Jahres) waren für die Abwicklung des Schuldendienstes vorgesehen:;;;; ;;;; für Verzinsung;;€;8.038.400,00; Zinsreserve gesamt ;;€;12.800.000,00; für Tilgung;;€;29.915.700,00; Gesamtvoranschlag;;€;50.754.100,00; ;;;; Diesem Kredit steht die Jahresvorschreibung von;;€;49.665.135,01; gegenüber, sodass sich beim gesamten Schuldendienst;;;; eine E i n s p a r u n g von ;;€;1.088.964,99; ergibt. ;;;; ;;;; Beilage zum Rechnungsabschluss 2013;;;Nr. 4b; ;;;; NACHWEIS ÜBER DEN SCHULDENDIENST;;;; ;;;; Laut Voranschlag 2013 (inkl. Umbuchungen im Laufe des Jahres) waren für die Abwicklung des Schuldendienstes vorgesehen:;;;; ;;;; für Verzinsung;;€;8.038.400,00; Zinsreserve gesamt ;;€;12.800.000,00; für Tilgung;;€;29.915.700,00; Gesamtvoranschlag;;€;50.754.100,00; ;;;; Diesem Kredit steht die Jahresvorschreibung von;;€;49.665.135,01; gegenüber, sodass sich beim gesamten Schuldendienst;;;; eine E i n s p a r u n g von ;;€;1.088.964,99; ergibt. ;;;; ;;;; ; as separator Not well-formed table empty lines, empty cells headers for column? ; as separator Not well-formed table empty lines, empty cells headers for column?

19 Example 2

20 Multiple tables in one file Headers? Multiple tables in one file Headers?

21 Example 3

22 Adding computation to the table Meaning of values? Adding computation to the table Meaning of values?

23 Example 4 All rows have the same length Header available All rows have the same length Header available

24 Example 4 >>curl -I http://www.wolfsberg.at/fileadmin/user_upload/Downloads/Haushalt2015.csv HTTP/1.1 200 OK Date: Fri, 27 Nov 2015 08:35:13 GMT Server: Apache Last-Modified: Fri, 20 Feb 2015 08:20:48 GMT ETag: "2800c44-2b354-50f80bad05800" Accept-Ranges: bytes Content-Length: 176980 Vary: Accept-Encoding Content-Type: text/plain >>curl -I http://www.wolfsberg.at/fileadmin/user_upload/Downloads/Haushalt2015.csv HTTP/1.1 200 OK Date: Fri, 27 Nov 2015 08:35:13 GMT Server: Apache Last-Modified: Fri, 20 Feb 2015 08:20:48 GMT ETag: "2800c44-2b354-50f80bad05800" Accept-Ranges: bytes Content-Length: 176980 Vary: Accept-Encoding Content-Type: text/plain HTTP HEADER response

25 Example 5 All rows have the same length Header available All rows have the same length Header available Comment rows

26 Example 5: Sex = 1,2,3 ? 20133112 ? -> 2013-31-12 Sex = 1,2,3 ? 20133112 ? -> 2013-31-12

27 Example 6

28 exhibition_id,city,title,location,datefrom,dateuntil 3,Rom,I LOVE POP,"Chiostro del Bramante, Rom",1999-03-23,1999-07-25 7,Krems,Zeitlos - Zur Kunstgeschichte der Zeit,Kunsthalle Krems,1999-05- 30,1999-10-03 8,"Wien, Österreich",School of London,Kunst Haus Wien,1999-05-11,1999-08- 29 10,Graz,Die Farben Schwarz,"Landesmuseum Joanneum, Graz",1999-05- 28,1999-10-31 11,Hamburg,Psyche und Kunst,Universitäts-Krankenhaus Eppendorf,1999-08- 07,1999-10-17 15,Graz,Michael Schuster,Galerie & Edition Artelier Graz,1999-06-01,1999-09- 30 17,Prag,Crossings II,Rudolfinum Prag,1999-06-24,1999-09-12 32,Köln,"""Kunstwelten im Dialog""","Museum Ludwig, Köln",1999-11-05,2000- 03-19 Example 6

29 exhibition_id,city,title,location,datefrom,dateuntil \n 3,Rom,I LOVE POP,"Chiostro del Bramante, Rom",1999-03-23,1999-07-25 \n 7,Krems,Zeitlos - Zur Kunstgeschichte der Zeit,Kunsthalle Krems,1999-05- 30,1999-10-03 \n 8,"Wien, Österreich",School of London,Kunst Haus Wien,1999-05-11,1999-08- 29 \n 10,Graz,Die Farben Schwarz,"Landesmuseum Joanneum, Graz",1999-05- 28,1999-10-31 \n 11,Hamburg,Psyche und Kunst,Universitäts-Krankenhaus Eppendorf,1999-08- 07,1999-10-17 \n 15,Graz,Michael Schuster,Galerie & Edition Artelier Graz,1999-06-01,1999-09- 30 \n 17,Prag,Crossings II,Rudolfinum Prag,1999-06-24,1999-09-12 \n 32,Köln,"""Kunstwelten im Dialog""","Museum Ludwig, Köln",1999-11-05,2000- 03-19 \n Example 6

30 exhibition_id,city,title,location,datefrom,dateuntil \n 3,Rom,I LOVE POP,"Chiostro del Bramante, Rom",1999-03-23,1999-07-25 \n 7,Krems,Zeitlos - Zur Kunstgeschichte der Zeit,Kunsthalle Krems,1999-05- 30,1999-10-03 \n 8,"Wien, Österreich",School of London,Kunst Haus Wien,1999-05-11,1999-08- 29 \n 10,Graz,Die Farben Schwarz,"Landesmuseum Joanneum, Graz",1999-05- 28,1999-10-31 \n 11,Hamburg,Psyche und Kunst,Universitäts-Krankenhaus Eppendorf,1999-08- 07,1999-10-17 \n 15,Graz,Michael Schuster,Galerie & Edition Artelier Graz,1999-06-01,1999-09- 30 \n 17,Prag,Crossings II,Rudolfinum Prag,1999-06-24,1999-09-12 \n 32,Köln,"""Kunstwelten im Dialog""","Museum Ludwig, Köln",1999-11-05,2000- 03-19 \n Example 6

31 exhibition_id,city,title,location,datefrom,dateuntil \n 3,Rom,I LOVE POP,"Chiostro del Bramante, Rom",1999-03-23,1999-07-25 \n 7,Krems,Zeitlos - Zur Kunstgeschichte der Zeit,Kunsthalle Krems,1999-05- 30,1999-10-03 \n 8,"Wien, Österreich",School of London,Kunst Haus Wien,1999-05-11,1999-08- 29 \n 10,Graz,Die Farben Schwarz,"Landesmuseum Joanneum, Graz",1999-05- 28,1999-10-31 \n 11,Hamburg,Psyche und Kunst,Universitäts-Krankenhaus Eppendorf,1999-08- 07,1999-10-17 \n 15,Graz,Michael Schuster,Galerie & Edition Artelier Graz,1999-06-01, 1999-09- 30 \n 17,Prag,Crossings II,Rudolfinum Prag,1999-06-24,1999-09-12 \n 32,Köln,"""Kunstwelten im Dialog""","Museum Ludwig, Köln",1999-11-05,2000- 03-19 \n Example 6

32 exhibition_id,city,title,location,datefrom,dateuntil \n 3,Rom,I LOVE POP,"Chiostro del Bramante, Rom",1999-03-23,1999-07-25 \n 7,Krems,Zeitlos - Zur Kunstgeschichte der Zeit,Kunsthalle Krems,1999-05- 30,1999-10-03 \n 8,"Wien, Österreich",School of London,Kunst Haus Wien,1999-05-11,1999-08-29 \n 10,Graz,Die Farben Schwarz,"Landesmuseum Joanneum, Graz",1999-05- 28,1999-10-31 \n 11,Hamburg,Psyche und Kunst,Universitäts-Krankenhaus Eppendorf,1999-08- 07,1999-10-17 \n 15,Graz,Michael Schuster,Galerie & Edition Artelier Graz,1999-06-01, 1999-09- 30 \n 17,Prag,Crossings II,Rudolfinum Prag,1999-06-24,1999-09-12 \n 32,Köln,"""Kunstwelten im Dialog""","Museum Ludwig, Köln",1999-11-05,2000- 03-19 \n Example 6

33 exhibition_id,city,title,location,datefrom,dateuntil \n 3,Rom,I LOVE POP,"Chiostro del Bramante, Rom",1999-03-23,1999-07-25 \n 7,Krems,Zeitlos - Zur Kunstgeschichte der Zeit,Kunsthalle Krems,1999-05- 30,1999-10-03 \n 8,"Wien, Österreich",School of London,Kunst Haus Wien,1999-05-11,1999-08-29 \n 10,Graz,Die Farben Schwarz,"Landesmuseum Joanneum, Graz",1999-05- 28,1999-10-31 \n 11,Hamburg,Psyche und Kunst,Universitäts-Krankenhaus Eppendorf,1999-08- 07,1999-10-17 \n 15,Graz,Michael Schuster,Galerie & Edition Artelier Graz,1999-06-01, 1999-09- 30 \n 17,Prag,Crossings II,Rudolfinum Prag,1999-06-24,1999-09-12 \n 32,Köln,"""Kunstwelten im Dialog""","Museum Ludwig, Köln",1999-11-05,2000- 03-19 \n Example 6

34 » curl -I http://data.mumok.at/exhibition.csv HTTP/1.1 200 OK Date: Thu, 26 Nov 2015 22:18:47 GMT Server: Apache/2.2.22 (Debian) Last-Modified: Thu, 26 Nov 2015 02:03:28 GMT ETag: "6d44-1b853-52567fb2450dd" Accept-Ranges: bytes Content-Length: 112723 Content-Type: text/csv; charset=utf-8; header=present Link: ;rel=describedBy;type=application/csvm+json » curl -I http://data.mumok.at/exhibition.csv HTTP/1.1 200 OK Date: Thu, 26 Nov 2015 22:18:47 GMT Server: Apache/2.2.22 (Debian) Last-Modified: Thu, 26 Nov 2015 02:03:28 GMT ETag: "6d44-1b853-52567fb2450dd" Accept-Ranges: bytes Content-Length: 112723 Content-Type: text/csv; charset=utf-8; header=present Link: ;rel=describedBy;type=application/csvm+json

35 Example 6 » curl -I http://data.mumok.at/exhibition.csv HTTP/1.1 200 OK Date: Thu, 26 Nov 2015 22:18:47 GMT Server: Apache/2.2.22 (Debian) Last-Modified: Thu, 26 Nov 2015 02:03:28 GMT ETag: "6d44-1b853-52567fb2450dd" Accept-Ranges: bytes Content-Length: 112723 Content-Type: text/csv; charset=utf-8; header=present Link: ;rel=describedBy;type=application/csvm+json » curl -I http://data.mumok.at/exhibition.csv HTTP/1.1 200 OK Date: Thu, 26 Nov 2015 22:18:47 GMT Server: Apache/2.2.22 (Debian) Last-Modified: Thu, 26 Nov 2015 02:03:28 GMT ETag: "6d44-1b853-52567fb2450dd" Accept-Ranges: bytes Content-Length: 112723 Content-Type: text/csv; charset=utf-8; header=present Link: ;rel=describedBy;type=application/csvm+json Metadata attached to CSV file Allows for a rich “semantic” description of the table and its data Metadata attached to CSV file Allows for a rich “semantic” description of the table and its data

36 W3C: CSV on the Web Working Group Metadata about tabular data  Using JSON format Allows for describing :  the CSV dialect, including comments row or multi-header rows, encoding, language, …  data types and value ranges for columns  primary key and relation to other tables  Transformation rules to convert  CSV to RDF  CSV to JSON

37 W3C CSV on the Web WG https://www.w3.org/2013/csvw/wiki/Main_Page

38 CSVM Properties

39

40

41 Example CSV Metadata » curl -I http://data.mumok.at/exhibition.csv HTTP/1.1 200 OK Date: Thu, 26 Nov 2015 22:18:47 GMT Server: Apache/2.2.22 (Debian) Last-Modified: Thu, 26 Nov 2015 02:03:28 GMT ETag: "6d44-1b853-52567fb2450dd" Accept-Ranges: bytes Content-Length: 112723 Content-Type: text/csv; charset=utf-8; header=present Link: ;rel=describedBy;type=application/csvm+json » curl -I http://data.mumok.at/exhibition.csv HTTP/1.1 200 OK Date: Thu, 26 Nov 2015 22:18:47 GMT Server: Apache/2.2.22 (Debian) Last-Modified: Thu, 26 Nov 2015 02:03:28 GMT ETag: "6d44-1b853-52567fb2450dd" Accept-Ranges: bytes Content-Length: 112723 Content-Type: text/csv; charset=utf-8; header=present Link: ;rel=describedBy;type=application/csvm+json

42 Example CSV Metadata { "@context": ["http://www.w3.org/ns/csvw", {"@language": "en"}], "url": "http://data.mumok.at/exhibition.csv", "dc:title": "Exhibitions for objects from the mumok collection", "dcat:keyword": ["art", "museum", "exhibition"], "dc:publisher": { "schema:name": "mumok - museum moderner kunst stiftung ludwig wien", "schema:url": {"@id": "http://www.mumok.at"} }, "dc:license": {"@id": "https://creativecommons.org/licenses/by/3.0/at/legalcode"}, "dc:modified": {"@value": "2015-07-04", "@type": "xsd:date"}, ….

43 Example CSV Metadata "dialect": { "encoding": "utf-8", "lineTerminators": ["\r\n", "\n"], "quoteChar": "\"", "doubleQuote": true, "skipRows": 0, "commentPrefix": "#", "header": true, "headerRowCount": 1, "delimiter": ",", "skipColumns": 0, "skipBlankRows": false, "skipInitialSpace": false, "trim": false },

44 Example CSV Metadata "tableSchema": { "columns": [{ "name": "exhibition_id", "titles": "Exhibition Identifier", "dc:description": "A unique identifier for the exhibition.", "datatype": "integer", "required": true }, { "name": "city", "titles": "City", "dc:description": "The city in which the exhibition took place (no language defined, mostly in German).", "datatype": "string" }, {

45 How to publish CSV on the WEB  Don’t publish CSV on the Web for humans  e.g., EXCEL exports  RFC 4180  Encoding  Use UTF-8, don’t mix encodings  File extension:.csv  Content-type: text/csv Optional, but big improvement!  Ideally, publish CSV MetaData along your CSV file  Avoid Acronyms or encodings (e.g., sex=1,2,3)

46 ADEQUATe Open Data Umfrage Bitte teilnehmen! http://odsurvey.ai.wu.ac.atOpenDataSurveyAustria Das Ziel dieses Fragebogens ist es, Informationen über Open Data Potenziale und Barrieren zu sammeln. Die Umfrage dauert etwa 5 bis 15 Minuten, je nach Ihrer Bereitschaft, auch optionale Fragen zu beantworten.

47 More information?  Please contact us if you have any further questions or need help/support.  Stay tuned:  !! UI to clean “CSV” files and create/edit metadata  Community/Publisher Workshop ? If requested juergen.umbrich@wu.ac.at sebastian.neumaier@wu.ac.at


Herunterladen ppt "How to publish CSV on the Web or why standards are important ODI Friday lecture 26.11.2015 J. Umbrich, S. Neumaier."

Ähnliche Präsentationen


Google-Anzeigen