【问题标题】:Virtuoso DBpedia load - parsing errorsVirtuoso DBpedia 加载 - 解析错误
【发布时间】:2015-09-17 01:42:07
【问题描述】:

当我想加载 DBpedia 数据集时,我遇到了很多错误。例如:

 22007 XM003: XML parser detected an error:     ERROR  : Tag nesting
 error: name 'img' of end tag does not match the name 'p' of start tag
 at line 4 column 432 at line 4 column 438 of source text
 04/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"></img></p>
 ----------------------------------------------------------------------^

好的,我们找到出错的那一行(我放了一个换行符,这样更容易看到):

<http://core-project.kmi.open.ac.uk/data-description> <http://purl.org/rss/1.0/modules/content/encoded> "<h2 xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:og=\"http://ogp.me/ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:sioc=\"http://rdfs.org/sioc/ns#\" xmlns:sioct=\"http://rdfs.org/sioc/types#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">What data are exposed</h2>\n<p xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:og=\"http://ogp.me/ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:sioc=\"http://rdfs.org/sioc/ns#\" xmlns:sioct=\"http://rdfs.org/sioc/types#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">The CORE project exposes data about the aggregated content. The following schema shows the kind of metadata CORE holds about each resource. </p>\n<h2 xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:og=\"http://ogp.me/ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:sioc=\"http://rdfs.org/sioc/ns#\" xmlns:sioct=\"http://rdfs.org/sioc/types#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">Data Schema</h2>\n<p xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:og=\"http://ogp.me/ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:sioc=\"http://rdfs.org/sioc/ns#\" xmlns:sioct=\"http://rdfs.org/sioc/types#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"></img></p>
    \n<h2 xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:og=\"http://ogp.me/ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:sioc=\"http://rdfs.org/sioc/ns#\" xmlns:sioct=\"http://rdfs.org/sioc/types#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">Data License</h2>\n<p xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:og=\"http://ogp.me/ns#\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:sioc=\"http://rdfs.org/sioc/ns#\" xmlns:sioct=\"http://rdfs.org/sioc/types#\" xmlns:skos=\"http://www.w3.org/2004/02/skos/core#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">All data from CORE (unless otherwise specified) are available under the a Creative Commons Attribution 3.0 Unported License. </p>\n"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .

为什么 Virtuoso 会尝试检查文字中的 HTML/XML 标签的一致性?!是否可以关闭它?我的数据集中有太多错误,试图找到所有有错误的行并手动删除它们是浪费时间。

【问题讨论】:

  • 哪个 DBpedia 数据集?你能说得更具体点吗?
  • 对不起,我错了,它是 BTC 2014 数据集。不过,没关系。问题在于上面显示的 RDF 文字中的 HTML/XML 标记不一致。
  • 更准确地说,我认为问题出在文字类型规范中:^^w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> 删除后,没有显示错误。 IE。 Virtuoso 尝试检查文字中的内容是否与 XMLLiteral 一致。怎么关掉?

标签: rdf dbpedia virtuoso rdfstore


【解决方案1】:

您的主要问题是为什么 Virtuoso 会尝试检查您向我们展示的词汇形式是否可以被解析为正确的 XML 内容。 Virtuoso 这样做是因为它试图符合the RDF 1.1 specification。

根据该规范,如果 RDF 文字的数据类型是 rdf:XMLLiteral,那么词法形式应该是“平衡良好、自包含的 XML 内容”(根据 XML 1.0)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-12
    • 2016-12-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多