我在 和
<td rel="dc:date" content="2017-02-10">10 February 2017 </td>
这样的元素中使用 DC 标签时,验证器会识别这些元数据元素。
此验证器也无法识别元和链接元素中的DC标签。
示例未验证但应该:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://dublincore.org/specifications/dublin-core/dc-html/2008-08-04/">
<title>Services to Government</title>
<link rel="schema.DC" href="http://example.org/terms/" />
<meta name="DC.date" content="2007-05-05" />
</head>
<body>
</body>
</html>
元数据无效还是验证器错误?是否有支持
<meta >
和 <link>
的验证器?
看起来像前缀: @prefix dc:http://purl.org/dc/elements/1.1/。 由于某种原因没有出现验证器结果。
我尝试添加额外的词汇,例如:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://dublincore.org/specifications/dublin-core/dc-html/2008-08-04/">
<title>Services to Government</title>
<link rel="schema.DC" href="http://example.org/terms/" />
<link rel="schema.DC" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:gml="http://www.opengis.net/gml" xmlns:v="http://rdf.data-vocabulary.org/#"/>
<meta name="DC.date" content="2007-05-05" />
</head>
<body>
<td rel="dc:date" content="2017-02-10">10 February 2017</td>
</body>
</html>
没有成功。
要重新创建,只需将示例 html 粘贴到上面链接的验证器之一即可。
这些示例是使用明显不受支持的语法编写的。 因此验证器不应该检测到它,因为它们支持常见语法,例如 RDFa、JSON-LD、Microdata 等。
这里有一段可能相关的引言:
主要搜索引擎现在提取并索引嵌入的元数据 几种语法之一:HTML Microdata,表达能力有限,但 网站管理员最容易部署; RDFa,一种更丰富的语法 更好地支持国际化和多个 RDF 名称空间; JSON-LD,流行 Javascript 的 RDF 兼容变体 对象表示法 (JSON)。这些有效地得到广泛支持的语法 已过时开发了一系列IETF和DCMI语法规范 2008 年之前专门用于表达 Dublin Core™ 元数据。
https://www.dublincore.org/resources/metadata-basics/
解析这些示例将需要特定语法的解析器(似乎没有很多......)。
因此解决方案可能是使用一些常见的序列化(JSON-LD、Microdata、RDFa)