| < draft-hausenblas-csv-fragment-01.txt | draft-hausenblas-csv-fragment-02.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 EMC Corporation | Intended status: Standards Track EMC Corporation | |||
| Expires: July 2, 2013 J. Tennison | Expires: July 16, 2013 J. Tennison | |||
| Open Data Institute | Open Data Institute | |||
| December 29, 2012 | January 12, 2013 | |||
| URI Fragment Identifiers for the text/csv Media Type | URI Fragment Identifiers for the text/csv Media Type | |||
| draft-hausenblas-csv-fragment-01 | draft-hausenblas-csv-fragment-02 | |||
| 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 row, column, or cell. | |||
| slice. | Fragment identification can use single items, or ranges. | |||
| Note to Readers | Note to Readers | |||
| This draft should be discussed on the apps-discuss mailing list [12]. | This draft should be discussed on the apps-discuss mailing list [11]. | |||
| Online access to all versions and files is available at github [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 July 2, 2013. | This Internet-Draft will expire on July 16, 2013. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2012 IETF Trust and the persons identified as the | Copyright (c) 2013 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 | |||
| described in the Simplified BSD License. | described in the Simplified BSD License. | |||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
| 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. Selections . . . . . . . . . . . . . . . . . . . . . . . . 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. Cell-based selection . . . . . . . . . . . . . . . . . . . 6 | 2.4. Cell-based selection . . . . . . . . . . . . . . . . . . . 5 | |||
| 2.5. Slice-based selection . . . . . . . . . . . . . . . . . . . 6 | 2.5. Multi-Selections . . . . . . . . . . . . . . . . . . . . . 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 | 4.2. Semantics of Fragment Identifiers . . . . . . . . . . . . 7 | |||
| 6. Security Considerations . . . . . . . . . . . . . . . . . . . . 8 | 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 7. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 | |||
| 7.1. From -00 to -01 . . . . . . . . . . . . . . . . . . . . . . 8 | 7. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 7.1. From -01 to -02 . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 8.1. Normative References . . . . . . . . . . . . . . . . . . . 8 | 7.2. From -00 to -01 . . . . . . . . . . . . . . . . . . . . . 9 | |||
| 8.2. Non-Normative References . . . . . . . . . . . . . . . . . 9 | 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
| Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . . 9 | 8.1. Normative References . . . . . . . . . . . . . . . . . . . 9 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9 | 8.2. Non-Normative References . . . . . . . . . . . . . . . . . 9 | |||
| Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 10 | ||||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 10 | ||||
| 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. | |||
| This section gives an introduction to the general concepts of text/ | This section gives an introduction to the general concepts of text/ | |||
| csv MIME entities and URI fragment identifiers, and discusses the | csv MIME entities and URI fragment identifiers, and discusses the | |||
| need for fragment identifiers for text/csv and deployment issues. | need for fragment identifiers for text/csv and deployment issues. | |||
| Section 2 discusses the principles and methods on which this memo is | Section 2 discusses the principles and methods on which this memo is | |||
| based. Section 3 defines the syntax, and Section 4 discusses | based. Section 3 defines the syntax, and Section 4 discusses | |||
| processing of text/csv fragment identifiers. | processing of text/csv fragment identifiers. | |||
| 1.1. What is text/csv? | 1.1. What is text/csv? | |||
| Internet Media Types (often referred to as "MIME types") as defined | Internet Media Types (often referred to as "MIME types") as defined | |||
| in RFC 2045 [2] and RFC 2046 [3] are used to identify different types | in RFC 2045 [2] and RFC 2046 [3] are used to identify different types | |||
| and sub-types of media. The text/csv media type is defined in RFC | and sub-types of media. The text/csv media type is defined in RFC | |||
| 4180 [1], using US-ASCII [9] as the default character encoding (other | 4180 [1], using US-ASCII [8] as the default character encoding (other | |||
| character encodings can be used as well). | character encodings can be used as well). Apart from a media type | |||
| parameter for specifying the character encoding ("charset"), there is | ||||
| a second media type parameter ("header") that indicates whether there | ||||
| is a header row in the CSV document or not. | ||||
| 1.2. Why text/csv Fragment Identifiers? | 1.2. Why text/csv Fragment Identifiers? | |||
| URIs are the identification mechanism for resources on the Web. The | URIs are the identification mechanism for resources on the Web. The | |||
| URI syntax specified in RFC 3986 [4] optionally includes a so-called | URI syntax specified in RFC 3986 [4] optionally includes a so-called | |||
| "fragment identifier", separated by a number sign ('#'). The | "fragment identifier", separated by a number sign ("#"). The | |||
| fragment identifier consists of additional reference information to | fragment identifier consists of additional reference information to | |||
| be interpreted by the user agent after the retrieval action has been | be interpreted by the client after the retrieval action has been | |||
| successfully completed. The semantics of a fragment identifier is a | successfully completed. The semantics of a fragment identifier is a | |||
| property of the data resulting from a retrieval action, regardless of | property of the media type resulting from a retrieval action, | |||
| the type of URI used in the reference. Therefore, the format and | regardless of the URI scheme used in the URI reference. Therefore, | |||
| interpretation of fragment identifiers is dependent on the media type | the format and interpretation of fragment identifiers is dependent on | |||
| of the retrieval result. | the media type of the retrieval result. | |||
| 1.2.1. Motivation | 1.2.1. Motivation | |||
| Similar to the motivation in RFC 5147 [10], referring to specific | Similar to the motivation in RFC 5147 [9], which defines fragment | |||
| parts of a resource can be very useful, because it enables users and | identifiers for plain text files, referring to specific parts of a | |||
| resource can be very useful, because it enables users and | ||||
| applications to create more specific references. Users can create | applications to create more specific references. Users can create | |||
| references to the part they really are interested in or want to talk | references to the part they really are interested in or want to talk | |||
| about, rather than always pointing to a complete resource. Even | about, rather than always pointing to a complete resource. Even | |||
| though it is suggested that fragment identification methods are | though it is suggested that fragment identification methods are | |||
| specified in a media type's MIME registration (see [11]), many media | specified in a media type's MIME registration (see [10]), many media | |||
| types do not have fragment identification methods associated with | types do not have fragment identification methods associated with | |||
| them. | them. | |||
| Fragment identifiers are only useful if supported by the client, | Fragment identifiers are only useful if supported by the client, | |||
| because they are only interpreted by the client. Therefore, a new | because they are only interpreted by the client. Therefore, a new | |||
| fragment identification method will require some time to be adopted | fragment identification method will require some time to be adopted | |||
| by clients, and older clients will not support it. However, because | by clients, and older clients will not support it. However, because | |||
| the URI still works even if the fragment identifier is not supported | the URI still works even if the fragment identifier is not supported | |||
| (the resource is retrieved, but the fragment identifier is not | (the resource is retrieved, but the fragment identifier is not | |||
| interpreted), rapid adoption is not highly critical to ensure the | interpreted), rapid adoption is not highly critical to ensure the | |||
| success of a new fragment identification method. | success of a new fragment identification method. | |||
| 1.2.2. Use Cases | 1.2.2. Use Cases | |||
| Fragment identifiers for text/csv as defined in this memo make it | Fragment identifiers for text/csv as defined in this memo make it | |||
| possible to refer to specific parts of a text/csv MIME entity. Use | possible to refer to specific parts of a text/csv MIME entity. Use | |||
| cases include, but are not limited to, discovery (what column | cases include, but are not limited to, selecting a part for visual | |||
| headings or how many rows are available), selecting a part for visual | ||||
| rendering, stream processing, making assertions about a certain value | rendering, stream processing, making assertions about a certain value | |||
| (provenance, confidence, etc.), or data integration. | (provenance, confidence, comments, etc.), or data integration. | |||
| 1.3. Incremental Deployment | 1.3. Incremental Deployment | |||
| As long as text/csv fragment identifiers are not supported | As long as text/csv fragment identifiers are not supported | |||
| universally, it is important to consider the implications of | universally, it is important to consider the implications of | |||
| incremental deployment. Clients (for example, Web browsers) not | incremental deployment. Clients (for example, Web browsers) not | |||
| supporting the text/csv fragment identifier described in this memo | supporting the text/csv fragment identifier described in this memo | |||
| will work with URI references to text/csv MIME entities, but they | will work with URI references to text/csv MIME entities, but they | |||
| will fail to to understand the identification of the sub-resource | will fail to understand the identification of the sub-resource | |||
| specified by the fragment identifier, and thus will behave as if the | specified by the fragment identifier, and thus will behave as if the | |||
| complete resource was referenced. This is a reasonable fallback | complete resource was referenced. This is a reasonable fallback | |||
| behavior, and in general users should take into account the | behavior, and in general users should take into account the | |||
| possibility that a program interpreting a given URI will fail to | possibility that a program interpreting a given URI will fail to | |||
| interpret the fragment identifier part. Since fragment identifier | interpret the fragment identifier part. Since fragment identifier | |||
| evaluation is local to the client (and happens after retrieving the | evaluation is local to the client (and happens after retrieving the | |||
| MIME entity), there is no reliable way for a server to determine | MIME entity), there is no reliable way for a server to determine | |||
| whether a requesting client is using a URI containing a fragment | whether a requesting client is using a URI containing a fragment | |||
| identifier. | identifier. | |||
| 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, cell and slice. As of RFC 4180 [1] the header | "row" for row selections, "col" for columns selections, and "cell" | |||
| line is optional and hence the application of the method is dependent | for cell selections. | |||
| 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 example table in CSV | |||
| (having 7 rows, including one header row, and 3 columns) 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. Selections | |||
| For discovery purposes, the "head" scheme is used, returning the | ||||
| first row. If the "header" parameter per RFC 4180 [1] is available | ||||
| and its value is "present" the client can reliable determine that it | ||||
| is a header. | ||||
| http://example.com/data.csv#head | ||||
| Applied to the reference table, the above CSV fragment would select | ||||
| the header row, yielding: | ||||
| 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 row has the position 0). | |||
| is given in the form row:*, then no record is selected but the | http://example.com/data.csv#row=3 | |||
| overall number of records is returned. | ||||
| http://example.com/data.csv#row:2 | ||||
| The above CSV fragment yields: while the following computes the | The above CSV fragment yields: | |||
| 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 | ||||
| reference table): | ||||
| 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 by | |||
| either by a single number or the value of a header field is used. | a position: | |||
| http://example.com/data.csv#col:temperature | http://example.com/data.csv#col=1 | |||
| The above CSV fragment addresses a column by name, yielding: | ||||
| 1,-1,0,6,8,5 | ||||
| A column can also be addressed by position as shown in the next | ||||
| example: | ||||
| http://example.com/data.csv#col:2 | ||||
| The above CSV fragment selects the third column: | The above CSV fragment addresses the second column, yielding the | |||
| Galway,Galway,Galway,Berkeley,Berkeley,Berkeley | column: | |||
| temperature | ||||
| 1 | ||||
| -1 | ||||
| 0 | ||||
| 6 | ||||
| 8 | ||||
| 5 | ||||
| 2.4. Cell-based selection | 2.4. Cell-based selection | |||
| To select a particular field within a row, use the "cell" scheme, | To select particular fields, use the "cell" scheme, followed by a row | |||
| followed by a row number, a comma, and either a single number or the | number, a comma, and a column number. | |||
| value of a header field. | http://example.com/data.csv#cell=3,0 | |||
| http://example.com/data.csv#cell:2,date | ||||
| The above CSV fragment addresses the field in the date column within | The above CSV fragment addresses the field in the first column within | |||
| the third row, yeilding: | the fourth row, yeilding: | |||
| 2011-01-03 | 2011-01-03 | |||
| A field can also be addressed by position as shown in the next | It is also possible to select ranges that have more than one row or | |||
| example: | column, in which case the cell selection uses the same range syntax | |||
| http://example.com/data.csv#cell:3,1 | as for row and column selections. For these selections, the syntax | |||
| uses the upper-lefthand call as the starting point of the selection, | ||||
| The above CSV fragment selects the second column in the fourth row: | followed by a minus sign, and then the lower-righthand cell as the | |||
| 6 | end point of the selection. | |||
| http://example.com/data.csv#cell=3,0-5,1 | ||||
| 2.5. Slice-based selection | The above CSV fragment selects a region that starts at the fourth row | |||
| and the first column, and ends at the sixth row and the second | ||||
| column: | ||||
| 2011-01-03,0 | ||||
| 2011-01-01,6 | ||||
| 2011-01-02,8 | ||||
| To select a part of table, called a slice in the following, the | 2.5. Multi-Selections | |||
| "where" scheme is used. The allowed values are a comma-separated | ||||
| list of header fields with corresponding field values in the table. | ||||
| http://example.com/data.csv#where:date=2011-01-01 | ||||
| The above CSV fragment selects a slice, yielding another CSV table as | Row, column, and cell selections can make more than one selection, in | |||
| follows: | which case the individual selections are separated by semicolons. In | |||
| temperature,place | these cases, the resulting fragment may be a disjoint fragment, such | |||
| 1,Galway | as the selection "#row=2;5" for the example CSV, which would select | |||
| 6,Berkeley | the third and the sixth row. It is up to the user agent to decide | |||
| how to handle disjoint fragments, but since they are allowed, user | ||||
| agents should be prepared to handle disjoint fragments. | ||||
| 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 rule DIGIT. | |||
| 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 / cellsel | csv-fragment = rowsel / colsel / cellsel | |||
| headersel = "head" | rowsel = "row=" singlespec 0*( ";" singlespec) | |||
| rowsel = "row:" rowspec | colsel = "col=" singlespec 0*( ";" singlespec) | |||
| colsel = "col:" colspec | cellsel = "cell=" cellspec 0*( ";" cellspec) | |||
| cellsel = "cell:" cellspec | singlespec = position [ "-" position ] | |||
| wheresel = "where:" kvpairs | cellspec = cellrow "," cellcol [ "-" cellrow "," cellcol ] | |||
| kvpairs = 1*( col "=" val 0*1(",") ) | cellrow = position | |||
| col = 1*TEXTDATA | cellcol = position | |||
| val = 1*TEXTDATA | position = number / "*" | |||
| colspec = column | number = 1*( DIGIT ) | |||
| rowspec = "*" / rownum | ||||
| cellspec = rownum "," column | ||||
| column = 1*TEXTDATA / 1*DIGIT | ||||
| rownum = 1*DIGIT | ||||
| TEXTDATA = %x23-2B / %x2D-3C / %x3E-7E | ||||
| 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. | |||
| 4.1. Syntax Errors in Fragment Identifiers | 4.1. Syntax Errors in Fragment Identifiers | |||
| 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. | |||
| 4.2. Semantics of Fragment Identifiers | ||||
| Rows and columns in CSV are counted from zero. Positions thus refer | ||||
| to the rows and columns starting from position 0, which identifies | ||||
| the first row or column of a CSV. The special character "*" can be | ||||
| used to refer to the last rwo or column of a CSV, thus allowing | ||||
| fragment identifiers to easily identify ranges that extend to the | ||||
| last row or column. | ||||
| If single selections refer to non-existing rows or columns (i.e., | ||||
| beyond the size of of the CSV), they MUST be ignored. | ||||
| If ranges extend beyond the size of the CSV (by extending to row or | ||||
| columns beyond the size of the CSV), they MUST be interpreted to only | ||||
| extend to the actual size of the CSV. | ||||
| If selections of ranges of rows or columns or selections of cell | ||||
| ranges are specified in a way so that they select "inversely" (i.e., | ||||
| "#row=10-5" or "#cell=10,10-5,5"), they MUST be ignored. | ||||
| Each specification of an identified region is processed | ||||
| independently, and ignored specifications (because of reason listed | ||||
| in the previous paragraphs) to not cause the whole fragment | ||||
| identifier to fail, they just mean that this single specification is | ||||
| ignored. For the example file, the fragment identifier "#row=0-1,4- | ||||
| 3,12-15" does identify the frist two rows, because the second | ||||
| specification is an "inverse" one and thus ignored, and the third | ||||
| specification selects rows beyond the actual size of the CSV. | ||||
| The result of evaluating the complete fragment identifier joins all | ||||
| the successfully evaluated identified parts, and then treats this | ||||
| joint fragment as the single identified fragment. This fragment can | ||||
| be disjoint because of multiple selections. Multiple selections also | ||||
| can result in overlapping individual parts, and it is up to the user | ||||
| agent how to process such a fragment, and whether the individual | ||||
| parts are still made accessible (i.e., visualized in visual user | ||||
| agents), or are presented as one unit. For example, the fragment | ||||
| identifier "#row=2-5,3-4" contains a second identified part that is | ||||
| completely contained in the first identified part. Whether a user | ||||
| agent maintains this selection as two parts, or simply signals that | ||||
| the identified fragment spans from the third to the sixth row, is up | ||||
| for the user agent to decide. | ||||
| 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/csv 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). | |||
| skipping to change at page 8, line 18 | skipping to change at page 8, line 36 | |||
| software not implementing them differs in behavior, and the fact that | software not implementing them differs in behavior, and the fact that | |||
| different software may show documents or fragments to users in | different software may show documents or fragments to users in | |||
| different ways, can lead to misunderstandings on the part of users. | different ways, can lead to misunderstandings on the part of 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. | |||
| ... | ... | |||
| 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 [7]. | |||
| 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 | 7.1. From -01 to -02 | |||
| o Removed slices ("#where:") as fragment identification method. | ||||
| o Removed any special support for headers, which means that they are | ||||
| now treated as a regular (the first) row (if a header row is | ||||
| present). | ||||
| o Changed semantics and syntax to allow multiple selection of rows, | ||||
| columns, and cells, and to allow ranges of rows and columns. | ||||
| 7.2. From -00 to -01 | ||||
| o Added cell-based selections. | o Added cell-based selections. | |||
| o Added Jeni Tennison as author; updated Erik Wilde's affiliation to | o Added Jeni Tennison as author; updated Erik Wilde's affiliation to | |||
| EMC. | EMC. | |||
| 8. References | 8. References | |||
| 8.1. Normative References | 8.1. Normative References | |||
| skipping to change at page 9, line 9 | skipping to change at page 9, line 40 | |||
| [4] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | [4] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | |||
| Resource Identifier (URI): Generic Syntax", RFC 3986, | Resource Identifier (URI): Generic Syntax", RFC 3986, | |||
| January 2005. | January 2005. | |||
| [5] Bradner, S., "Key words for use in RFCs to Indicate Requirement | [5] Bradner, S., "Key words for use in RFCs to Indicate Requirement | |||
| Levels", RFC 2119, March 1997. | Levels", RFC 2119, March 1997. | |||
| [6] Crocker, D. and P. Overell, "Augmented BNF for Syntax | [6] Crocker, D. and P. Overell, "Augmented BNF for Syntax | |||
| Specifications: ABNF", RFC 4234, October 2005. | Specifications: ABNF", RFC 4234, October 2005. | |||
| [7] Freed, N. and J. Postel, "IANA Charset Registration | [7] Duerst, M. and M. Suignard, "Internationalized Resource | |||
| Procedures", BCP 19, October 2000. | ||||
| [8] Duerst, M. and M. Suignard, "Internationalized Resource | ||||
| Identifiers (IRI)", RFC 3987, January 2005. | Identifiers (IRI)", RFC 3987, January 2005. | |||
| 8.2. Non-Normative References | 8.2. Non-Normative References | |||
| [9] ANSI X3.4-1986, "Coded Character Set - 7-Bit American National | [8] 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 | [9] 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 | [10] Freed, N. and J. Klensin, "Media Type Specifications and | |||
| Registration Procedures", RFC 4288, December 2005. | Registration Procedures", RFC 4288, December 2005. | |||
| URIs | URIs | |||
| [12] <https://www.ietf.org/mailman/listinfo/apps-discuss> | [11] <https://www.ietf.org/mailman/listinfo/apps-discuss> | |||
| [12] <https://github.com/dret/I-D/tree/master/csv-fragment> | ||||
| Appendix A. Acknowledgements | Appendix A. Acknowledgements | |||
| Thanks for comments and suggestions provided by Richard, Ian, Gannon. | 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 | |||
| End of changes. 41 change blocks. | ||||
| 136 lines changed or deleted | 175 lines changed or added | |||
This html diff was produced by rfcdiff 1.39p1. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||