< draft-hausenblas-csv-fragment-00.txt   draft-hausenblas-csv-fragment-01.txt >
Network Working Group M. Hausenblas Network Working Group M. Hausenblas
Internet-Draft DERI, NUI Galway Internet-Draft DERI, NUI Galway
Updates: 4180 (if approved) E. Wilde Updates: 4180 (if approved) E. Wilde
Intended status: Standards Track UC Berkeley Intended status: Standards Track EMC Corporation
Expires: October 28, 2011 April 26, 2011 Expires: July 2, 2013 J. Tennison
Open Data Institute
December 29, 2012
URI Fragment Identifiers for the text/csv Media Type URI Fragment Identifiers for the text/csv Media Type
draft-hausenblas-csv-fragment-00 draft-hausenblas-csv-fragment-01
Abstract Abstract
This memo defines URI fragment identifiers for text/csv MIME This memo defines URI fragment identifiers for text/csv MIME
entities. These fragment identifiers make it possible to refer to entities. These fragment identifiers make it possible to refer to
parts of a text/csv MIME entity, identified by cell, row, column, or parts of a text/csv MIME entity, identified by cell, row, column, or
slice. slice.
Note to Readers
This draft should be discussed on the apps-discuss mailing list [12].
Status of this Memo Status of this Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 28, 2011. This Internet-Draft will expire on July 2, 2013.
Copyright Notice Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 2, line 18 skipping to change at page 2, line 24
1.1. What is text/csv? . . . . . . . . . . . . . . . . . . . . . 3 1.1. What is text/csv? . . . . . . . . . . . . . . . . . . . . . 3
1.2. Why text/csv Fragment Identifiers? . . . . . . . . . . . . 3 1.2. Why text/csv Fragment Identifiers? . . . . . . . . . . . . 3
1.2.1. Motivation . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1. Motivation . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2. Use Cases . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.2. Use Cases . . . . . . . . . . . . . . . . . . . . . . . 4
1.3. Incremental Deployment . . . . . . . . . . . . . . . . . . 4 1.3. Incremental Deployment . . . . . . . . . . . . . . . . . . 4
1.4. Notation Used in this Memo . . . . . . . . . . . . . . . . 4 1.4. Notation Used in this Memo . . . . . . . . . . . . . . . . 4
2. Fragment Identification Methods . . . . . . . . . . . . . . . . 4 2. Fragment Identification Methods . . . . . . . . . . . . . . . . 4
2.1. Header . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1. Header . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2. Row-based selection . . . . . . . . . . . . . . . . . . . . 5 2.2. Row-based selection . . . . . . . . . . . . . . . . . . . . 5
2.3. Column-based selection . . . . . . . . . . . . . . . . . . 5 2.3. Column-based selection . . . . . . . . . . . . . . . . . . 5
2.4. Slice-based selection . . . . . . . . . . . . . . . . . . . 6 2.4. Cell-based selection . . . . . . . . . . . . . . . . . . . 6
2.5. Slice-based selection . . . . . . . . . . . . . . . . . . . 6
3. Fragment Identification Syntax . . . . . . . . . . . . . . . . 6 3. Fragment Identification Syntax . . . . . . . . . . . . . . . . 6
4. Fragment Identifier Processing . . . . . . . . . . . . . . . . 7 4. Fragment Identifier Processing . . . . . . . . . . . . . . . . 7
4.1. Syntax Errors in Fragment Identifiers . . . . . . . . . . . 7 4.1. Syntax Errors in Fragment Identifiers . . . . . . . . . . . 7
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7
6. Security Considerations . . . . . . . . . . . . . . . . . . . . 7 6. Security Considerations . . . . . . . . . . . . . . . . . . . . 8
7. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 8 7. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.1. From -00 to -01 . . . . . . . . . . . . . . . . . . . . . . 8
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8
8.1. Normative References . . . . . . . . . . . . . . . . . . . 8 8.1. Normative References . . . . . . . . . . . . . . . . . . . 8
8.2. Non-Normative References . . . . . . . . . . . . . . . . . 9 8.2. Non-Normative References . . . . . . . . . . . . . . . . . 9
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . . 9 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . . 9
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
This memo updates the text/csv media type defined in RFC 4180 [1] by This memo updates the text/csv media type defined in RFC 4180 [1] by
defining URI fragment identifiers for text/csv MIME entities. defining URI fragment identifiers for text/csv MIME entities.
skipping to change at page 4, line 47 skipping to change at page 4, line 47
1.4. Notation Used in this Memo 1.4. Notation Used in this Memo
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in RFC "OPTIONAL" in this document are to be interpreted as described in RFC
2119 [5]. 2119 [5].
2. Fragment Identification Methods 2. Fragment Identification Methods
This memo specifies fragment identification using following methods: This memo specifies fragment identification using following methods:
header, row, column and slice. As of RFC 4180 [1] the header line is header, row, column, cell and slice. As of RFC 4180 [1] the header
optional and hence the application of the method is dependent on the line is optional and hence the application of the method is dependent
actual format of the text/csv MIME entity. on the actual format of the text/csv MIME entity.
Throughout the sections below the following table in CSV is used: Throughout the sections below the following table in CSV is used:
date,temperature,place date,temperature,place
2011-01-01,1,Galway 2011-01-01,1,Galway
2011-01-02,-1,Galway 2011-01-02,-1,Galway
2011-01-03,0,Galway 2011-01-03,0,Galway
2011-01-01,6,Berkeley 2011-01-01,6,Berkeley
2011-01-02,8,Berkeley 2011-01-02,8,Berkeley
2011-01-03,5,Berkeley 2011-01-03,5,Berkeley
2.1. Header 2.1. Header
skipping to change at page 5, line 21 skipping to change at page 5, line 20
2011-01-01,6,Berkeley 2011-01-01,6,Berkeley
2011-01-02,8,Berkeley 2011-01-02,8,Berkeley
2011-01-03,5,Berkeley 2011-01-03,5,Berkeley
2.1. Header 2.1. Header
For discovery purposes, the "head" scheme is used, returning the For discovery purposes, the "head" scheme is used, returning the
first row. If the "header" parameter per RFC 4180 [1] is available first row. If the "header" parameter per RFC 4180 [1] is available
and its value is "present" the client can reliable determine that it and its value is "present" the client can reliable determine that it
is a header. is a header.
http://example.com/data.csv#head http://example.com/data.csv#head
Applied to the reference table, the above CSV fragment would select Applied to the reference table, the above CSV fragment would select
the header row, yielding: the header row, yielding:
date,temperature,place date,temperature,place
2.2. Row-based selection 2.2. Row-based selection
To select a specific record, the "row" scheme followed by a single To select a specific record, the "row" scheme followed by a single
number is used (the first record has the index 0). If the fragment number is used (the first record has the index 0). If the fragment
is given in the form row:*, then no record is selected but the is given in the form row:*, then no record is selected but the
overall number of records is returned. overall number of records is returned.
http://example.com/data.csv#row:2 http://example.com/data.csv#row:2
The above CSV fragment yields: while the following computes the The above CSV fragment yields: while the following computes the
number of records (which equals 6, in the reference table) number of records (which equals 6, in the reference table)
2011-01-03,0,Galway 2011-01-03,0,Galway
The following computes the number of records (which equals 6, in the The following computes the number of records (which equals 6, in the
reference table): reference table):
http://example.com/data.csv#row:* http://example.com/data.csv#row:*
2.3. Column-based selection 2.3. Column-based selection
To select values from a certain column, the "col" scheme, followed To select values from a certain column, the "col" scheme, followed
either by a single number or the value of a header field is used. either by a single number or the value of a header field is used.
http://example.com/data.csv#col:temperature http://example.com/data.csv#col:temperature
The above CSV fragment addresses a column by name, yielding: The above CSV fragment addresses a column by name, yielding:
1,-1,0,6,8,5 1,-1,0,6,8,5
A column can also be addressed by position as shown in the next A column can also be addressed by position as shown in the next
example: example:
http://example.com/data.csv#col:2 http://example.com/data.csv#col:2
The above CSV fragment selects the third column: The above CSV fragment selects the third column:
Galway,Galway,Galway,Berkeley,Berkeley,Berkeley Galway,Galway,Galway,Berkeley,Berkeley,Berkeley
2.4. Slice-based selection 2.4. Cell-based selection
To select a particular field within a row, use the "cell" scheme,
followed by a row number, a comma, and either a single number or the
value of a header field.
http://example.com/data.csv#cell:2,date
The above CSV fragment addresses the field in the date column within
the third row, yeilding:
2011-01-03
A field can also be addressed by position as shown in the next
example:
http://example.com/data.csv#cell:3,1
The above CSV fragment selects the second column in the fourth row:
6
2.5. Slice-based selection
To select a part of table, called a slice in the following, the To select a part of table, called a slice in the following, the
"where" scheme is used. The allowed values are a comma-separated "where" scheme is used. The allowed values are a comma-separated
list of header fields with corresponding field values in the table. list of header fields with corresponding field values in the table.
http://example.com/data.csv#where:date=2011-01-01 http://example.com/data.csv#where:date=2011-01-01
The above CSV fragment selects a slice, yielding another CSV table as The above CSV fragment selects a slice, yielding another CSV table as
follows: follows:
temperature,place temperature,place
1,Galway 1,Galway
6,Berkeley 6,Berkeley
3. Fragment Identification Syntax 3. Fragment Identification Syntax
The syntax for the text/csv fragment identifiers is as follows. The syntax for the text/csv fragment identifiers is as follows.
The following syntax definition uses ABNF as defined in RFC 4234 [6], The following syntax definition uses ABNF as defined in RFC 4234 [6],
including the rules DIGIT and HEXDIG. The mime-charset rule is including the rules DIGIT and HEXDIG. The mime-charset rule is
skipping to change at page 7, line 5 skipping to change at page 7, line 9
The syntax for the text/csv fragment identifiers is as follows. The syntax for the text/csv fragment identifiers is as follows.
The following syntax definition uses ABNF as defined in RFC 4234 [6], The following syntax definition uses ABNF as defined in RFC 4234 [6],
including the rules DIGIT and HEXDIG. The mime-charset rule is including the rules DIGIT and HEXDIG. The mime-charset rule is
defined in RFC 2978 [7]. defined in RFC 2978 [7].
NOTE: In the descriptions that follow, specified text values MUST be NOTE: In the descriptions that follow, specified text values MUST be
used exactly as given, using exactly the indicated lower-case used exactly as given, using exactly the indicated lower-case
letters. In this respect, the ABNF usage differs from [6]. letters. In this respect, the ABNF usage differs from [6].
csv-fragment = headersel / wheresel / colsel / rowsel csv-fragment = headersel / wheresel / colsel / rowsel / cellsel
headersel = "head" headersel = "head"
rowsel = "row:" rowspec rowsel = "row:" rowspec
colsel = "col:" colspec colsel = "col:" colspec
cellsel = "cell:" cellspec
wheresel = "where:" kvpairs wheresel = "where:" kvpairs
kvpairs = 1*( col "=" val 0*1(",") ) kvpairs = 1*( col "=" val 0*1(",") )
col = 1*TEXTDATA col = 1*TEXTDATA
val = 1*TEXTDATA val = 1*TEXTDATA
colspec = column colspec = column
rowspec = "*" / rownum rowspec = "*" / rownum
cellspec = rownum "," column
column = 1*TEXTDATA / 1*DIGIT column = 1*TEXTDATA / 1*DIGIT
rownum = 1*DIGIT rownum = 1*DIGIT
TEXTDATA = %x23-2B / %x2D-3C / %x3E-7E TEXTDATA = %x23-2B / %x2D-3C / %x3E-7E
DIGIT = %x30-39 DIGIT = %x30-39
4. Fragment Identifier Processing 4. Fragment Identifier Processing
Applications implementing support for the mechanism described in this Applications implementing support for the mechanism described in this
memo MUST behave as described in the following sections. memo MUST behave as described in the following sections.
skipping to change at page 7, line 37 skipping to change at page 7, line 43
If a fragment identifier contains a syntax error (i.e., does not If a fragment identifier contains a syntax error (i.e., does not
conform to the syntax specified in Section 3), then it MUST be conform to the syntax specified in Section 3), then it MUST be
ignored by clients. Clients MUST NOT make any attempt to correct or ignored by clients. Clients MUST NOT make any attempt to correct or
guess fragment identifiers. Syntax errors MAY be reported by guess fragment identifiers. Syntax errors MAY be reported by
clients. clients.
5. IANA Considerations 5. IANA Considerations
Note to RFC Editor: Please change this section to read as follows Note to RFC Editor: Please change this section to read as follows
after the IANA action has been completed: "IANA has added a reference after the IANA action has been completed: "IANA has added a reference
to this specification in the Text/Plain Media Type registration." to this specification in the text/csv Media Type registration."
IANA is requested to update the registration of the MIME Media type IANA is requested to update the registration of the MIME Media type
text/csv at http://www.iana.org/assignments/media-types/text/ with text/csv at http://www.iana.org/assignments/media-types/text/ with
the fragment identifier defined in this memo by adding a reference to the fragment identifier defined in this memo by adding a reference to
this memo (with the appropriate RFC number once it is known). this memo (with the appropriate RFC number once it is known).
6. Security Considerations 6. Security Considerations
The fact that software implementing fragment identifiers for plain The fact that software implementing fragment identifiers for CSV and
text and software not implementing them differs in behavior, and the software not implementing them differs in behavior, and the fact that
fact that different software may show documents or fragments to users different software may show documents or fragments to users in
in different ways, can lead to misunderstandings on the part of different ways, can lead to misunderstandings on the part of users.
users. Such misunderstandings might be exploited in a way similar to Such misunderstandings might be exploited in a way similar to
spoofing or phishing. spoofing or phishing.
In particular, care has to be taken if fragment identifiers are used ...
together with a mechanism that allows to show only the part of a
document identified by a fragment. One scenario may be the use of a
fragment identifier to hide small-print legal text. Another scenario
may be the inclusion of site-key-like material, which may give the
user the impression of using the real site rather than a fake
site.Other scenarios may also be possible. Possible countermeasures
may include but are not limited to displaying the included content
within clearly visible boundaries and limiting inclusion to material
from the same security realm or from realms that give explicit
permission to be included in another realm.
Please note that the above issues all apply to the client side;
fragment identifiers are not used when resolving an URI to retrieve
the representation of a resource, but are only applied on the client
side.
Implementers and users of fragment identifiers for CSV text should Implementers and users of fragment identifiers for CSV text should
also be aware of the security considerations in RFC 3986 [4] and RFC also be aware of the security considerations in RFC 3986 [4] and RFC
3987 [8]. 3987 [8].
7. Change Log 7. Change Log
Note to RFC Editor: Please remove this section before publication. Note to RFC Editor: Please remove this section before publication.
7.1. From -00 to -01
o Added cell-based selections.
o Added Jeni Tennison as author; updated Erik Wilde's affiliation to
EMC.
8. References 8. References
8.1. Normative References 8.1. Normative References
[1] Shafranovich, Y., "Common Format and MIME Type for Comma- [1] Shafranovich, Y., "Common Format and MIME Type for Comma-
Separated Values (CSV) Files", RFC 4180, October 2005. Separated Values (CSV) Files", RFC 4180, October 2005.
[2] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [2] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Bodies", Extensions (MIME) Part One: Format of Internet Message Bodies",
RFC 2045, November 1996. RFC 2045, November 1996.
skipping to change at page 9, line 29 skipping to change at page 9, line 27
[9] ANSI X3.4-1986, "Coded Character Set - 7-Bit American National [9] ANSI X3.4-1986, "Coded Character Set - 7-Bit American National
Standard Code for Information Interchange", STD 63, RFC 3629, Standard Code for Information Interchange", STD 63, RFC 3629,
1992. 1992.
[10] Wilde, E. and M. Duerst, "URI Fragment Identifiers for the [10] Wilde, E. and M. Duerst, "URI Fragment Identifiers for the
text/plain Media Type", RFC 5147, April 2008. text/plain Media Type", RFC 5147, April 2008.
[11] Freed, N. and J. Klensin, "Media Type Specifications and [11] Freed, N. and J. Klensin, "Media Type Specifications and
Registration Procedures", RFC 4288, December 2005. Registration Procedures", RFC 4288, December 2005.
URIs
[12] <https://www.ietf.org/mailman/listinfo/apps-discuss>
Appendix A. Acknowledgements Appendix A. Acknowledgements
Thanks for comments and suggestions provided by ... Thanks for comments and suggestions provided by Richard, Ian, Gannon.
Authors' Addresses Authors' Addresses
Michael Hausenblas Michael Hausenblas
DERI, NUI Galway DERI, NUI Galway
IDA Business Park IDA Business Park
Galway Galway
Ireland Ireland
Phone: +353-91-495730 Phone: +353-91-495730
Email: michael.hausenblas@deri.org Email: michael.hausenblas@deri.org
URI: http://sw-app.org/about.html URI: http://sw-app.org/about.html
Erik Wilde Erik Wilde
UC Berkeley EMC Corporation
School of Information, 311 South Hall 6801 Koll Center Parkway
Berkeley, CA 94720-4600 Pleasanton, CA 94566
U.S.A. U.S.A.
Phone: +1-510-6432253 Phone: +1-925-6006244
Email: dret@berkeley.edu Email: erik.wilde@emc.com
URI: http://dret.net/netdret/ URI: http://dret.net/netdret/
Jeni Tennison
Open Data Institute
65 Clifton Street
London EC2A 4JE
U.K.
Phone: +44-797-4420482
Email: jeni@jenitennison.com
URI: http://www.jenitennison.com/blog/
 End of changes. 33 change blocks. 
51 lines changed or deleted 64 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/