Independent Submission                                     M. Hausenblas
Request for Comments: 7111                             MapR Technologies
Updates: 4180                                                   E. Wilde
Category: Informational                                      UC Berkeley
ISSN: 2070-1721                                              J. Tennison
                                                     Open Data Institute
                                                            January 2014
        
Independent Submission                                     M. Hausenblas
Request for Comments: 7111                             MapR Technologies
Updates: 4180                                                   E. Wilde
Category: Informational                                      UC Berkeley
ISSN: 2070-1721                                              J. Tennison
                                                     Open Data Institute
                                                            January 2014
        

URI Fragment Identifiers for the text/csv Media Type

文本/csv媒体类型的URI片段标识符

Abstract

摘要

This memo defines URI fragment identifiers for text/csv MIME entities. These fragment identifiers make it possible to refer to parts of a text/csv MIME entity identified by row, column, or cell. Fragment identification can use single items or ranges.

此备忘录定义文本/csv MIME实体的URI片段标识符。这些片段标识符可以引用由行、列或单元格标识的text/csv MIME实体的部分。片段识别可以使用单个项目或范围。

Status of This Memo

关于下段备忘

This document is not an Internet Standards Track specification; it is published for informational purposes.

本文件不是互联网标准跟踪规范;它是为了提供信息而发布的。

This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not a candidate for any level of Internet Standard; see Section 2 of RFC 5741.

这是对RFC系列的贡献,独立于任何其他RFC流。RFC编辑器已选择自行发布此文档,并且未声明其对实现或部署的价值。RFC编辑批准发布的文件不适用于任何级别的互联网标准;见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7111.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc7111.

IESG Note

IESG注释

The change to the text/csv media type registration requires IESG approval, as the IESG is the change controller for that registration. The IESG has, after consultation with the IETF community, approved the change, which is specified in Section 5 of this document.

文本/csv媒体类型注册的更改需要IESG批准,因为IESG是该注册的更改控制器。IESG在与IETF社区协商后,批准了本文件第5节规定的变更。

Copyright Notice

版权公告

Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2014 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  What is text/csv? . . . . . . . . . . . . . . . . . . . .   3
     1.2.  Why text/csv Fragment Identifiers?  . . . . . . . . . . .   3
       1.2.1.  Motivation  . . . . . . . . . . . . . . . . . . . . .   3
       1.2.2.  Use Cases . . . . . . . . . . . . . . . . . . . . . .   4
     1.3.  Incremental Deployment  . . . . . . . . . . . . . . . . .   4
     1.4.  Notation Used in this Memo  . . . . . . . . . . . . . . .   4
   2.  Fragment Identification Methods . . . . . . . . . . . . . . .   5
     2.1.  Row-Based Selection . . . . . . . . . . . . . . . . . . .   5
     2.2.  Column-Based Selection  . . . . . . . . . . . . . . . . .   6
     2.3.  Cell-Based Selection  . . . . . . . . . . . . . . . . . .   6
     2.4.  Multi-Selections  . . . . . . . . . . . . . . . . . . . .   7
   3.  Fragment Identification Syntax  . . . . . . . . . . . . . . .   7
   4.  Fragment Identifier Processing  . . . . . . . . . . . . . . .   8
     4.1.  Syntax Errors in Fragment Identifiers . . . . . . . . . .   8
     4.2.  Semantics of Fragment Identifiers . . . . . . . . . . . .   8
   5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   9
     5.1.  The text/csv media type . . . . . . . . . . . . . . . . .   9
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .  11
   7.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  11
   8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  11
     8.1.  Normative References  . . . . . . . . . . . . . . . . . .  11
     8.2.  Informative References  . . . . . . . . . . . . . . . . .  12
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  What is text/csv? . . . . . . . . . . . . . . . . . . . .   3
     1.2.  Why text/csv Fragment Identifiers?  . . . . . . . . . . .   3
       1.2.1.  Motivation  . . . . . . . . . . . . . . . . . . . . .   3
       1.2.2.  Use Cases . . . . . . . . . . . . . . . . . . . . . .   4
     1.3.  Incremental Deployment  . . . . . . . . . . . . . . . . .   4
     1.4.  Notation Used in this Memo  . . . . . . . . . . . . . . .   4
   2.  Fragment Identification Methods . . . . . . . . . . . . . . .   5
     2.1.  Row-Based Selection . . . . . . . . . . . . . . . . . . .   5
     2.2.  Column-Based Selection  . . . . . . . . . . . . . . . . .   6
     2.3.  Cell-Based Selection  . . . . . . . . . . . . . . . . . .   6
     2.4.  Multi-Selections  . . . . . . . . . . . . . . . . . . . .   7
   3.  Fragment Identification Syntax  . . . . . . . . . . . . . . .   7
   4.  Fragment Identifier Processing  . . . . . . . . . . . . . . .   8
     4.1.  Syntax Errors in Fragment Identifiers . . . . . . . . . .   8
     4.2.  Semantics of Fragment Identifiers . . . . . . . . . . . .   8
   5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   9
     5.1.  The text/csv media type . . . . . . . . . . . . . . . . .   9
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .  11
   7.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  11
   8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  11
     8.1.  Normative References  . . . . . . . . . . . . . . . . . .  11
     8.2.  Informative References  . . . . . . . . . . . . . . . . .  12
        
1. Introduction
1. 介绍

This memo updates the text/csv media type defined in RFC 4180 [RFC4180] by defining URI fragment identifiers for text/csv MIME entities.

此备忘录通过定义文本/csv MIME实体的URI片段标识符来更新RFC 4180[RFC4180]中定义的文本/csv媒体类型。

The change to the text/csv media type registration required IESG approval, as the IESG is the change controller for that registration. The IESG has, after consultation with the IETF community, approved the change, which is specified in Section 5 of this document.

文本/csv媒体类型注册的更改需要IESG批准,因为IESG是该注册的更改控制器。IESG在与IETF社区协商后,批准了本文件第5节规定的变更。

This section gives an introduction to the general concepts of text/csv MIME entities and URI fragment identifiers and discusses the need for fragment identifiers for text/csv and deployment issues. Section 2 discusses the principles and methods on which this memo is based. Section 3 defines the syntax, and Section 4 discusses processing of text/csv fragment identifiers.

本节介绍了text/csv MIME实体和URI片段标识符的一般概念,并讨论了text/csv的片段标识符需求和部署问题。第2节讨论了本备忘录所依据的原则和方法。第3节定义了语法,第4节讨论了文本/csv片段标识符的处理。

1.1. What is text/csv?
1.1. 什么是文本/csv?

Internet Media Types (often referred to as "MIME types") as defined in RFC 2045 [RFC2045] and RFC 2046 [RFC2046] are used to identify different types and subtypes of media. The text/csv media type is defined in RFC 4180 [RFC4180], using US-ASCII [ASCII] as the default character encoding (other 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.

RFC 2045[RFC2045]和RFC 2046[RFC2046]中定义的互联网媒体类型(通常称为“MIME类型”)用于标识不同类型和子类型的媒体。文本/csv媒体类型在RFC 4180[RFC4180]中定义,使用US-ASCII[ASCII]作为默认字符编码(也可以使用其他字符编码)。除了用于指定字符编码的媒体类型参数(“字符集”)外,还有第二个媒体类型参数(“标题”),用于指示CSV文档中是否存在标题行。

1.2. Why text/csv Fragment Identifiers?
1.2. 为什么使用文本/csv片段标识符?

URIs are the identification mechanism for resources on the Web. The URI syntax specified in RFC 3986 [RFC3986] optionally includes a so-called "fragment identifier", separated by a number sign ("#"). The fragment identifier consists of additional reference information to be interpreted by the client after the retrieval action has been successfully completed. The semantics of a fragment identifier is a property of the media type resulting from a retrieval action, regardless of the URI scheme used in the URI reference. Therefore, the format and interpretation of fragment identifiers is dependent on the media type of the retrieval result.

URI是Web上资源的标识机制。RFC 3986[RFC3986]中指定的URI语法可选地包括所谓的“片段标识符”,由数字符号(“#”)分隔。片段标识符由客户端在成功完成检索操作后解释的附加参考信息组成。片段标识符的语义是检索操作产生的媒体类型的属性,与URI引用中使用的URI方案无关。因此,片段标识符的格式和解释取决于检索结果的媒体类型。

1.2.1. Motivation
1.2.1. 动机

Similar to the motivation in RFC 5147 [RFC5147], which defines fragment identifiers for plain text files, referring to specific parts of a resource can be very useful because it enables users and

与RFC 5147[RFC5147]中定义纯文本文件片段标识符的动机类似,引用资源的特定部分可能非常有用,因为它允许用户和

applications to create more specific references. Users can create references to a particular point of interest within a resource, rather than referring to the complete resource. Even though it is suggested that fragment identification methods are specified in a media type's registration (see [RFC6838]), many media types do not have fragment identification methods associated with them.

应用程序创建更具体的引用。用户可以在资源中创建对特定兴趣点的引用,而不是对完整资源的引用。尽管建议在媒体类型的注册中指定片段识别方法(请参见[RFC6838]),但许多媒体类型没有与之关联的片段识别方法。

Fragment identifiers are only useful if supported by the client, because they are only interpreted by the client. Therefore, a new fragment identification method will require some time to be adopted by clients, and older clients will not support it. However, because the URI still works even if the fragment identifier is not supported (the resource is retrieved, but the fragment identifier is not interpreted), rapid adoption is not highly critical to ensure the success of a new fragment identification method.

片段标识符只有在客户端支持时才有用,因为它们只由客户端解释。因此,新的片段识别方法需要一段时间才能被客户端采用,而旧客户端将不支持它。但是,由于即使不支持片段标识符(检索资源,但不解释片段标识符),URI仍然有效,因此快速采用对于确保新片段标识方法的成功并不十分关键。

1.2.2. Use Cases
1.2.2. 用例

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 cases include, but are not limited to, selecting a part for visual rendering, stream processing, making assertions about a certain value (provenance, confidence, comments, etc.), or data integration.

本备忘录中定义的文本/csv片段标识符可以引用文本/csv MIME实体的特定部分。用例包括但不限于选择零件进行可视化渲染、流处理、对某个值(出处、置信度、注释等)进行断言或数据集成。

1.3. Incremental Deployment
1.3. 增量部署

As long as text/csv fragment identifiers are not supported universally, it is important to consider the implications of incremental deployment. Clients (for example, Web browsers) not supporting the text/csv fragment identifier described in this memo will work with URI references to text/csv MIME entities, but they will fail to understand the identification of the sub-resource specified by the fragment identifier, and thus will behave as if the complete resource was referenced. This is a reasonable fallback behavior and, in general users, should take into account the possibility that a program interpreting a given URI will fail to interpret the fragment identifier part. Since fragment identifier evaluation is local to the client (and happens after retrieving the MIME entity), there is no reliable way for a server to determine whether a requesting client is using a URI containing a fragment identifier.

只要文本/ CSV片段标识符不被普遍支持,重要的是考虑增量部署的含义。不支持本备忘录中描述的文本/csv片段标识符的客户端(例如,Web浏览器)将使用对文本/csv MIME实体的URI引用,但它们将无法理解片段标识符指定的子资源的标识,因此将表现为引用了完整的资源。这是一种合理的回退行为,一般来说,用户应该考虑解释给定URI的程序将无法解释片段标识符部分的可能性。由于片段标识符评估是客户端本地的(并且在检索MIME实体之后发生),因此服务器无法可靠地确定请求客户端是否使用包含片段标识符的URI。

1.4. Notation Used in this Memo
1.4. 本备忘录中使用的符号

The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].

本文件中大写的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC 2119[RFC2119]中的说明进行解释。

2. Fragment Identification Methods
2. 片段识别方法

This memo specifies fragment identification using the following methods: "row" for row selections, "col" for columns selections, and "cell" for cell selections.

此备忘录使用以下方法指定片段标识:“行”用于行选择,“列”用于列选择,“单元”用于单元选择。

Throughout the sections below, the following example table in CSV (having 7 rows, including one header row, and 3 columns) is used:

在以下各节中,使用了以下CSV格式的示例表(有7行,包括一个标题行和3列):

date,temperature,place 2011-01-01,1,Galway 2011-01-02,-1,Galway 2011-01-03,0,Galway 2011-01-01,6,Berkeley 2011-01-02,8,Berkeley 2011-01-03,5,Berkeley

日期、温度、地点2011-01-01,1,高威2011-01-02,-1,高威2011-01-03,0,高威2011-01-01,6,伯克利2011-01-02,8,伯克利2011-01-03,5,伯克利

2.1. Row-Based Selection
2.1. 基于行的选择

To select a specific record, the "row" scheme followed by a single number is used (the first row is at position 1).

要选择特定记录,使用“行”方案,后跟一个数字(第一行位于位置1)。

   http://example.com/data.csv#row=4
        
   http://example.com/data.csv#row=4
        

The above CSV fragment identifies the fourth row:

上面的CSV片段标识了第四行:

2011-01-03,0,Galway

2011-01-03,0,戈尔韦

Fragments can also select ranges of rows:

片段还可以选择行的范围:

   http://example.com/data.csv#row=5-7
        
   http://example.com/data.csv#row=5-7
        

The above CSV fragment identifies three consecutive rows:

上面的CSV片段标识了三个连续的行:

2011-01-01,6,Berkeley 2011-01-02,8,Berkeley 2011-01-03,5,Berkeley

2011-01-01,6,伯克利2011-01-02,8,伯克利2011-01-03,5,伯克利

The value "*" can be used to indicate the last row, so the previous URI is equivalent to:

值“*”可用于指示最后一行,因此前一个URI等效于:

   http://example.com/data.csv#row=5-*
        
   http://example.com/data.csv#row=5-*
        
2.2. Column-Based Selection
2.2. 基于列的选择

To select values from a certain column, the "col" scheme is used, followed by a position (the first column is at position 1):

要从某一列中选择值,使用“col”方案,后跟一个位置(第一列位于位置1):

   http://example.com/data.csv#col=2
        
   http://example.com/data.csv#col=2
        

The above CSV fragment addresses the second column, identifying the column:

上面的CSV片段地址为第二列,标识该列:

temperature 1 -1 0 6 8 5

温度1-10685

The "col" scheme can also be used to identify ranges of columns:

“col”方案也可用于识别列的范围:

   http://example.com/data.csv#col=1-2
        
   http://example.com/data.csv#col=1-2
        

The above CSV fragment addresses the first and second column:

上面的CSV片段处理第一列和第二列:

date,temperature 2011-01-01,1 2011-01-02,-1 2011-01-03,0 2011-01-01,6 2011-01-02,8 2011-01-03,5

日期,温度2011-01-01,1 2011-01-02,-1 2011-01-03,0 2011-01-01,6 2011-01-02,8 2011-01-03,5

As for rows, the value "*" can be used to indicate the last column.

对于行,值“*”可用于指示最后一列。

2.3. Cell-Based Selection
2.3. 基于细胞的选择

To select particular fields, the "cell" scheme is used, followed by a row number, a comma, and a column number.

要选择特定字段,使用“单元格”方案,后跟行号、逗号和列号。

   http://example.com/data.csv#cell=4,1
        
   http://example.com/data.csv#cell=4,1
        

The above CSV fragment addresses the field in the first column within the fourth row, yielding:

上述CSV片段对第四行第一列中的字段进行了寻址,产生:

2011-01-03

2011-01-03

It is also possible to select cell-based fragments that have more than just one cell, in which case the cell selection uses the same range syntax as for row and column range selections. For these selections, the syntax uses the upper left-hand cell as the starting point of the selection, followed by a minus sign, and then the lower right-hand cell as the end point of the selection.

也可以选择具有多个单元格的基于单元格的片段,在这种情况下,单元格选择使用与行和列范围选择相同的范围语法。对于这些选择,语法使用左上角单元格作为选择的起点,后跟减号,然后右下角单元格作为选择的终点。

   http://example.com/data.csv#cell=4,1-6,2
        
   http://example.com/data.csv#cell=4,1-6,2
        

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:

上面的CSV片段选择一个区域,该区域从第四行和第一列开始,到第六行和第二列结束:

2011-01-03,0 2011-01-01,6 2011-01-02,8

2011-01-03,0 2011-01-01,6 2011-01-02,8

2.4. Multi-Selections
2.4. 多选

Row, column, and cell selections can make more than one selection, in which case the individual selections are separated by semicolons. In these cases, the resulting fragment may be a disjoint fragment, such as the selection "#row=3;6" for the example CSV, which would select 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.

行、列和单元格选择可以进行多个选择,在这种情况下,各个选择用分号分隔。在这些情况下,生成的片段可能是不相交的片段,例如选择“#row=3;6”作为示例CSV,它将选择第三行和第六行。由用户代理决定如何处理不相交的片段,但由于它们是允许的,用户代理应该准备好处理不相交的片段。

3. Fragment Identification Syntax
3. 片段识别语法

The syntax for the text/csv fragment identifiers is as follows.

text/csv片段标识符的语法如下所示。

The following syntax definition uses ABNF as defined in RFC 5234 [RFC5234], including the rule DIGIT.

以下语法定义使用RFC 5234[RFC5234]中定义的ABNF,包括规则数字。

NOTE: In the descriptions that follow, specified text values MUST be used exactly as given, using exactly the indicated lowercase letters. In this respect, the ABNF usage differs from [RFC5234].

注意:在下面的说明中,指定的文本值必须完全按照给定的方式使用,并使用指定的小写字母。在这方面,ABNF的用法不同于[RFC5234]。

   csv-fragment =  rowsel / colsel / cellsel
   rowsel       =  "row=" singlespec 0*( ";" singlespec)
   colsel       =  "col=" singlespec 0*( ";" singlespec)
   cellsel      =  "cell=" cellspec 0*( ";" cellspec)
   singlespec   =  position [ "-" position ]
   cellspec     =  cellrow "," cellcol [ "-" cellrow "," cellcol ]
   cellrow      =  position
   cellcol      =  position
   position     =  number / "*"
   number       =  1*( DIGIT )
        
   csv-fragment =  rowsel / colsel / cellsel
   rowsel       =  "row=" singlespec 0*( ";" singlespec)
   colsel       =  "col=" singlespec 0*( ";" singlespec)
   cellsel      =  "cell=" cellspec 0*( ";" cellspec)
   singlespec   =  position [ "-" position ]
   cellspec     =  cellrow "," cellcol [ "-" cellrow "," cellcol ]
   cellrow      =  position
   cellcol      =  position
   position     =  number / "*"
   number       =  1*( DIGIT )
        
4. Fragment Identifier Processing
4. 片段标识符处理

Applications implementing support for the mechanism described in this memo MUST behave as described in the following sections.

实现对本备忘录中所述机制的支持的应用程序的行为必须符合以下各节的描述。

4.1. Syntax Errors in Fragment Identifiers
4.1. 片段标识符中的语法错误

If a fragment identifier contains a syntax error (i.e., does not conform to the syntax specified in Section 3), then it MUST be ignored by clients. Clients MUST NOT make any attempt to correct or guess fragment identifiers. Syntax errors MAY be reported by clients.

如果片段标识符包含语法错误(即,不符合第3节中指定的语法),则客户端必须忽略它。客户端不得尝试更正或猜测片段标识符。客户端可能会报告语法错误。

4.2. Semantics of Fragment Identifiers
4.2. 片段标识符的语义

Rows and columns in CSV are counted from one. Positions thus refer to the rows and columns starting from position 1, which identifies the first row or column of a CSV. The special character "*" can be used to refer to the last row or column of a CSV, thus allowing fragment identifiers to easily identify ranges that extend to the last row or column.

CSV中的行和列从一开始计数。因此,位置是指从位置1开始的行和列,位置1标识CSV的第一行或第一列。特殊字符“*”可用于表示CSV的最后一行或最后一列,因此允许片段标识符轻松标识延伸到最后一行或最后一列的范围。

If single selections refer to non-existing rows or columns (i.e., beyond the size of the CSV), they MUST be ignored.

如果单个选择引用不存在的行或列(即超出CSV的大小),则必须忽略这些行或列。

If ranges extend beyond the size of the CSV (by extending to rows or columns beyond the size of the CSV), they MUST be interpreted to only extend to the actual size of the CSV.

如果范围超出CSV的大小(通过扩展到CSV大小以外的行或列),则必须将其解释为仅扩展到CSV的实际大小。

If selections of ranges of rows, ranges of columns, or ranges of cells 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.

如果指定行范围、列范围或单元格范围的选择方式是“反向”(即“#行=10-5”或“#单元格=10,10-5,5”),则必须忽略这些选择。

Each specification of an identified region is processed independently, and ignored specifications (because of reasons listed in the previous paragraphs) do 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=1-2;5-4;13-16" does identify the first two rows: the second specification is an "inverse" specification and thus is ignored, and the third specification targets rows beyond the actual size of the CSV and thus is also ignored.

已识别区域的每个规范都是独立处理的,被忽略的规范(由于前面段落中列出的原因)不会导致整个片段标识符失败,它们只是意味着忽略了这个规范。对于示例文件,片段标识符“#row=1-2;5-4;13-16”确实标识了前两行:第二个规范是“反向”规范,因此被忽略,第三个规范针对超出CSV实际大小的行,因此也被忽略。

The complete fragment identifier identifies all the successfully evaluated identified parts as a 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=3-6;4-5" 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.

单个零件仍然可以访问(即,在可视化用户代理中可视化)或作为一个单元显示。例如,片段标识符“#row=3-6;4-5”包含完全包含在第一个已识别部分中的第二个已识别部分。用户代理是将此选择保持为两部分,还是简单地表示所识别的片段跨越第三行到第六行,由用户代理决定。

5. IANA Considerations
5. IANA考虑

IANA has added a reference to this specification in the text/csv media type registration.

IANA在文本/csv媒体类型注册中添加了对本规范的引用。

5.1. The text/csv media type
5.1. 文本/csv媒体类型

The Internet media type [RFC6838] for a CSV document is text/csv. The following registration has been copied from the original registration of text/csv [RFC4180], with the exception of the added fragment identification considerations and added security considerations for fragment identifiers.

CSV文档的Internet媒体类型[RFC6838]为text/CSV。以下注册是从text/csv[RFC4180]的原始注册复制而来的,但添加的片段标识注意事项和片段标识符的安全注意事项除外。

Type name: text

类型名称:text

Subtype name: csv

子类型名称:csv

Required parameters: none

所需参数:无

Optional parameters: charset, header

可选参数:字符集、标头

The "charset" parameter specifies the charset employed by the CSV content. In accordance with RFC 6657 [RFC6657], the charset parameter SHOULD be used, and if it is not present, UTF-8 SHOULD be assumed as the default (this implies that US-ASCII CSV will work, even when not specifying the "charset" parameter). Any charset defined by IANA for the "text" tree may be used in conjunction with the "charset" parameter.

“charset”参数指定CSV内容使用的字符集。根据RFC 6657[RFC6657],应使用字符集参数,如果不存在,则应假定UTF-8为默认值(这意味着US-ASCII CSV将起作用,即使未指定“字符集”参数)。IANA为“文本”树定义的任何字符集都可以与“字符集”参数结合使用。

The "header" parameter indicates the presence or absence of the header line. Valid values are "present" or "absent". Implementors choosing not to use this parameter must make their own decisions as to whether the header line is present or absent.

“header”参数表示是否存在标题行。有效值为“存在”或“不存在”。选择不使用此参数的实现者必须自行决定是否存在标题行。

Encoding considerations: CSV MIME entities consist of binary data [RFC6838]. As per Section 4.1.1. of RFC 2046 [RFC2046], this media type uses CRLF to denote line breaks. However, implementers should be aware that some implementations may use other values.

编码注意事项:CSV MIME实体由二进制数据组成[RFC6838]。根据第4.1.1节。在RFC 2046[RFC2046]中,此媒体类型使用CRLF表示换行符。但是,实现者应该知道,一些实现可能使用其他值。

Security considerations:

安全考虑:

Text/csv consists of nothing but passive text data that should not pose any direct risks. However, it is possible that malicious data may be included in order to exploit buffer overruns or other bugs in the program processing the text/csv data.

文本/csv只包含不应构成任何直接风险的被动文本数据。但是,可能包含恶意数据,以利用处理文本/csv数据的程序中的缓冲区溢出或其他错误。

The text/csv format provides no confidentiality or integrity protection, so if such protections are needed, they must be supplied externally.

text/csv格式不提供机密性或完整性保护,因此如果需要此类保护,则必须从外部提供。

The fact that software implementing fragment identifiers for CSV and software not implementing them differs in behavior, and the fact that different software may show documents or fragments to users in different ways, can lead to misunderstandings on the part of users. Such misunderstandings might be exploited in a way similar to spoofing or phishing.

实现CSV片段标识符的软件与未实现CSV片段标识符的软件在行为上存在差异,并且不同的软件可能以不同的方式向用户显示文档或片段,这可能会导致用户产生误解。这种误解可能以类似于欺骗或网络钓鱼的方式被利用。

Implementers and users of fragment identifiers for CSV text should also be aware of the security considerations in RFC 3986 [RFC3986] and RFC 3987 [RFC3987].

CSV文本片段标识符的实现者和用户还应了解RFC 3986[RFC3986]和RFC 3987[RFC3987]中的安全注意事项。

Interoperability considerations: Due to lack of a single specification, there are considerable differences among implementations. Implementers should "be conservative in what you do, be liberal in what you accept from others" (RFC 793 [RFC0793]) when processing CSV files. An attempt at a common definition can be found in Section 2. Implementations deciding not to use the optional "header" parameter must make their own decision as to whether the header is absent or present.

互操作性注意事项:由于缺乏单一规范,实现之间存在相当大的差异。在处理CSV文件时,实施者应该“在你做的事情上保守,在你接受他人的事情上自由”(RFC 793[RFC0793])。在第2节中可以找到一个通用定义的尝试。决定不使用可选“header”参数的实现必须自行决定是否存在该头。

Published specification: While numerous private specifications exist for various programs and systems, there is no single "master" specification for this format. An attempt at a common definition can be found in Section 2 of RFC 4180 [RFC4180].

已发布的规范:虽然各种程序和系统都有许多私有规范,但这种格式没有单一的“主”规范。可在RFC 4180[RFC4180]第2节中找到通用定义的尝试。

Applications that use this media type: Spreadsheet programs and various data conversion utilities.

使用此媒体类型的应用程序:电子表格程序和各种数据转换实用程序。

Fragment identifier considerations: Fragment identification for text/csv is supported by using fragment identifiers as specified by RFC 7111.

片段标识符注意事项:使用RFC 7111指定的片段标识符支持文本/csv的片段标识。

Additional information:

其他信息:

Magic number(s): none

幻数:无

File extension(s): CSV

文件扩展名:CSV

Macintosh file type code(s): TEXT

Macintosh文件类型代码:文本

   Person & email address to contact for further information:
      Yakov Shafranovich <ietf@shaftek.org> and
      Erik Wilde <dret@berkeley.edu>
        
   Person & email address to contact for further information:
      Yakov Shafranovich <ietf@shaftek.org> and
      Erik Wilde <dret@berkeley.edu>
        

Intended usage: COMMON

预期用途:普通

Restrictions on usage: none

使用限制:无

   Author:
      Yakov Shafranovich <ietf@shaftek.org> and
      Erik Wilde <dret@berkeley.edu>
        
   Author:
      Yakov Shafranovich <ietf@shaftek.org> and
      Erik Wilde <dret@berkeley.edu>
        

Change controller: IESG

更改控制器:IESG

6. Security Considerations
6. 安全考虑

The security considerations for text/csv fragment identifiers are listed in the respective section of the media type registration in Section 5.1.

文本/csv片段标识符的安全注意事项列在第5.1节媒体类型注册的相应章节中。

7. Acknowledgements
7. 致谢

Thanks for comments and suggestions provided by Nevil Brownlee, Richard Cyganiak, Ian Davis, Gannon Dick, Leigh Dodds, and Barry Leiba.

感谢Nevil Brownlee、Richard Cyganiak、Ian Davis、Gannon Dick、Leigh Dodds和Barry Leiba提供的评论和建议。

8. References
8. 工具书类
8.1. Normative References
8.1. 规范性引用文件

[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996.

[RFC2045]Freed,N.和N.Borenstein,“多用途Internet邮件扩展(MIME)第一部分:Internet邮件正文格式”,RFC 20451996年11月。

[RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, November 1996.

[RFC2046]Freed,N.和N.Borenstein,“多用途Internet邮件扩展(MIME)第二部分:媒体类型”,RFC 20461996年11月。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.

[RFC3986]Berners Lee,T.,Fielding,R.,和L.Masinter,“统一资源标识符(URI):通用语法”,STD 66,RFC 3986,2005年1月。

[RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005.

[RFC3987]Duerst,M.和M.Suignard,“国际化资源标识符(IRIs)”,RFC 3987,2005年1月。

[RFC4180] Shafranovich, Y., "Common Format and MIME Type for Comma-Separated Values (CSV) Files", RFC 4180, October 2005.

[RFC4180]Shafranovich,Y.,“逗号分隔值(CSV)文件的通用格式和MIME类型”,RFC 41802005年10月。

[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.

[RFC5234]Crocker,D.和P.Overell,“语法规范的扩充BNF:ABNF”,STD 68,RFC 5234,2008年1月。

[RFC6657] Melnikov, A. and J. Reschke, "Update to MIME regarding "charset" Parameter Handling in Textual Media Types", RFC 6657, July 2012.

[RFC6657]Melnikov,A.和J.Reschke,“关于文本媒体类型中“字符集”参数处理的MIME更新”,RFC 6657,2012年7月。

8.2. Informative References
8.2. 资料性引用

[ASCII] ANSI X3.4-1986, "Coded Character Set - 7-Bit American National Standard Code for Information Interchange", STD 63, RFC 3629, 1992.

[ASCII]ANSI X3.4-1986,“编码字符集-信息交换用7位美国国家标准代码”,STD 63,RFC 36291992。

[RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981.

[RFC0793]Postel,J.,“传输控制协议”,标准7,RFC 793,1981年9月。

[RFC5147] Wilde, E. and M. Duerst, "URI Fragment Identifiers for the text/plain Media Type", RFC 5147, April 2008.

[RFC5147]Wilde,E.和M.Duerst,“文本/普通媒体类型的URI片段标识符”,RFC 5147,2008年4月。

[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type Specifications and Registration Procedures", BCP 13, RFC 6838, January 2013.

[RFC6838]Freed,N.,Klensin,J.和T.Hansen,“媒体类型规范和注册程序”,BCP 13,RFC 6838,2013年1月。

Authors' Addresses

作者地址

Michael Hausenblas MapR Technologies 32 Bushypark Lawn Galway Ireland

Michael Hausenblas MapR Technologies 32 Bushypark草坪爱尔兰高威

   Phone: +353-86-0215164
   EMail: mhausenblas@maprtech.com
   URI:   http://mhausenblas.info
        
   Phone: +353-86-0215164
   EMail: mhausenblas@maprtech.com
   URI:   http://mhausenblas.info
        

Erik Wilde UC Berkeley

埃里克·王尔德加州大学伯克利分校

   EMail: dret@berkeley.edu
   URI:   http://dret.net/netdret/
        
   EMail: dret@berkeley.edu
   URI:   http://dret.net/netdret/
        

Jeni Tennison Open Data Institute 65 Clifton Street London EC2A 4JE U.K.

Jei-Thann逊开放数据研究所65克利夫顿街伦敦EC2A 4JE英国。

   Phone: +44-797-4420482
   EMail: jeni@jenitennison.com
   URI:   http://www.jenitennison.com/blog/
        
   Phone: +44-797-4420482
   EMail: jeni@jenitennison.com
   URI:   http://www.jenitennison.com/blog/