📄 rfc2731.txt
字号:
<meta name = "DC.Date.Valid"
content = "1998-05-28">
<meta name = "DC.Date.Created"
content = "triassic">
<meta name = "DC.Date.Acquired"
content = "1957">
<meta name = "DC.Date.Accepted"
scheme = "WTN8601"
content = "1998-12-02T16:59">
<meta name = "DC.Date.DataGathered"
scheme = "ISO8601"
content = "98-W49-3T1659">
<meta name = "DC.Date.Issued"
scheme = "ANSI.X3.X30-1985"
content = "19980514">
Type (性质、流派、类别; 建议用[DCT1])
----
<meta name = "DC.Type"
content = "poem">
<meta name = "DC.Type"
scheme = "DCT1"
content = "software">
<meta name = "DC.Type"
content = "software program source code">
<meta name = "DC.Type"
content = "interactive video game">
<meta name = "DC.Type"
scheme = "DCT1"
content = "dataset">
<meta name = "DC.Type"
content = "web home page">
<meta name = "DC.Type"
content = "web bibliography">
<meta name = "DC.Type"
content = "painting">
<meta name = "DC.Type"
content = "image; woodblock">
<meta name = "DC.Type"
scheme = "AAT"
content = "clipeus (portrait)">
<meta name = "DC.Type"
lang = "en-US"
content = "image; advertizement">
<meta name = "DC.Type"
scheme = "DCT1"
content = "event">
<meta name = "DC.Type"
content = "event; periodic">
Format (物理或逻辑格式以及可选的资源大小)
------
<meta name = "DC.Format"
content = "text/xml">
<meta name = "DC.Format"
scheme = "IMT"
content = "text/xml">
<meta name = "DC.Format"
scheme = "IMT"
content = "image/jpeg">
<meta name = "DC.Format"
content = "A text file with mono-spaced tables and diagrams.">
<meta name = "DC.Format"
content = "video/mpeg; 14 minutes">
<meta name = "DC.Format"
content = "unix tar archive, gzip compressed; 1.5 Mbytes">
<meta name = "DC.Format"
content = "watercolor; 23 cm x 31 cm">
Identifier (资源标识符)
----------
<meta name = "DC.Identifier"
content = "http://foo.bar.org/zaf/">
<meta name = "DC.Identifier"
content = "urn:ietf:rfc:1766">
<meta name = "DC.Identifier"
scheme = "ISBN"
content = "1-56592-149-6">
<meta name = "DC.Identifier"
scheme = "LCCN"
content = "67-26020">
<meta name = "DC.Identifier"
scheme = "DOI"
content = "10.12345/33-824688ab">
Source (来源)
------
<meta name = "DC.Source"
content = "Shakespeare's Romeo and Juliet">
<meta name = "DC.Source"
content = "http://a.b.org/manon/">
Language (内容所使用的语言;建议使用[RFC1766])
--------
<meta name = "DC.Language"
content = "en">
<meta name = "DC.Language"
scheme = "rfc1766"
content = "en">
<meta name = "DC.Language"
scheme = "ISO639-2"
content = "eng">
<meta name = "DC.Language"
scheme = "rfc1766"
content = "en-US">
<meta name = "DC.Language"
content = "zh">
<meta name = "DC.Language"
content = "ja">
<meta name = "DC.Language"
content = "es">
<meta name = "DC.Language"
content = "de">
<meta name = "DC.Language"
content = "german">
<meta name = "DC.Language"
lang = "fr"
content = "allemand">
Relation (相关资源)
--------
<meta name = "DC.Relation.IsPartOf"
content = "http://foo.bar.org/abc/proceedings/1998/">
<meta name = "DC.Relation.IsFormatOf"
content = "http://foo.bar.org/cd145.sgml">
<meta name = "DC.Relation.IsVersionOf"
content = "http://foo.bar.org/draft9.4.4.2">
<meta name = "DC.Relation.References"
content = "urn:isbn:1-56592-149-6">
<meta name = "DC.Relation.IsBasedOn"
content = "Shakespeare's Romeo and Juliet">
<meta name = "DC.Relation.Requires"
content = "LWP::UserAgent; HTML::Parse; URI::URL;
Net::DNS; Tk::Pixmap; Tk::Bitmap; Tk::Photo">
Coverage (内容所涉及的范围)
--------
<meta name = "DC.Coverage"
content = "US civil war era; 1861-1865">
<meta name = "DC.Coverage"
content = "Columbus, Ohio, USA; Lat: 39 57 N Long: 082 59 W">
<meta name = "DC.Coverage"
scheme = "TGN"
content = "Columbus (C,V)">
<meta name = "DC.Coverage.Jurisdiction"
content = "Commonwealth of Australia">
Rights (版权管理声明)
------
<meta name = "DC.Rights"
lang = "en"
content = "Copyright Acme 1999 - All rights reserved.">
<meta name = "DC.Rights"
content = "http://foo.bar.org/cgi-bin/terms">
8、安全性问题
本文所讨论的在HTML中应用DC元数据的语法规则不会给计算机和网络带来直接的危险。这些规则可能被用于编制不准确甚至有意误导(造成“垃圾检索信息”)的元数据信息,这反映了对HTML META标签的滥用,而且也不仅限于对DC元数据的编码。即使传统的元数据编码方案(比如[MARC])也不能免于错误,虽然错误通常发生在数据量远远超出普通网站水平的情况下。
对使用META标签进行编码的元数据进行处理的系统,应该作为设计与实现的一部分考虑与元数据的正确性和有效性有关的问题,使用这些系统的用户也要考虑系统设计和实现中的要求。不同的应用程序可能采用不同的方法,比方说增加元数据来源的声明、对元数据是用数字签名以及元数据创建过程中某些方面的自动化,但是这些都超出了本文以及META标签语法的范畴。
9、附录——处理用META标签编码的元数据的Perl脚本程序
这一节包括两个程序,适用于4和5版本的PERL脚本语言解释器。这两个程序可以自由地用于本单位的需要、研究目的或者风险资本的召唤。根据这些程序,程序员可以很容易把它们改造成其它的应用。
脚本一:源数据格式转换
这是一个简单的Perl脚本程序,能够正确识别本文所有例子中的元数据编码。这个例子说明如何用普通的脚本开发把元数据从一种格式转到另一种格式的实用程序,只要稍作改变就可以支持多种输出格式。
#!/depot/bin/perl
#
# This simple perl script extracts metadata embedded in an HTML file
# and outputs it in an alternate format. Issues warning about missing
# element name or value.
#
# Handles mixed case tags and attribute values, one per line or spanning
# several lines. Also handles a quoted string spanning multiple lines.
# No error checking. Does not tolerate more than one "<meta" per line.
print "@(urc;\n";
while (<>) {
next if (! /<meta/i);
($meta) = /(<meta.*$)/i;
if (! /<meta.*>/i) {
while (<>) {
$meta .= $_;
last if (/>/);
}
}
$name = $meta =~ /name\s*=\s*"([^"]*)"/i
? $1 : "MISSING ELEMENT NAME";
$content = $meta =~ /content\s*=\s*"([^"]*)"/i
? $1 : "MISSING ELEMENT VALUE";
($scheme) = $meta =~ /scheme\s*=\s*"([^"]*)"/i;
($lang) = $meta =~ /lang\s*=\s*"([^"]*)"/i;
if ($lang || $scheme) {
$mod = " ($lang";
if (! $scheme)
{ $mod .= ")"; }
elsif (! $lang)
{ $mod .= "$scheme)" }
else
{ $mod .= ", $scheme)"; }
}
else
{ $mod = ""; }
print " @|$name$mod; $content\n";
}
print "@)urc;\n";
# ---- end of Perl script ----
如果该程序用于第四节中的元数据例子,则输出结果如下:
@(urc;
@|DC.Title; A Dirge
@|DC.Creator; Shelley, Percy Bysshe
@|DC.Type; poem
@|DC.Date; 1820
@|DC.Format; text/html
@|DC.Language; en
@)urc;
脚本二——元数据创建自动化
如果没有一些自动化的帮助——预先设定缺省值、语法检查、数据范围验证以及拼写检查等——创建和维护高质量的元数据可能非常困难。如果有某个脚本程序能够仅仅通过文档标题来加入相应的元数据内容,就可以极大减轻用户的工作量。下面的程序就可完成这项工作。HTML作者可以把整个内嵌资源描述缩写放在HTML注释声明中:
<!--metablock Little Red Riding Hood -->
我们的脚本程序把该声明看作是一种专门的带有文档标题的“元数据块声明”。一般形式为:
<!--metablock TITLE_OF_DOCUMENT -->
该声明的工作方式非常类似于“服务器端引入”,脚本程序用完整的元数据块代替该声明并机或其他的替换。装上后,该脚本就会生成与用户产品Web服务器程序兼容的HTML文件。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -