我正在尝试将RDF文件导入到AllegroGraph tripple-store中,但我一直收到以下错误:
Import failed: MALFORMED DATA: [in Sax parser]
parse of #<file-simple-stream #P"/tmp/agwebview-upload-EoncCgvalid.xml"
for input pos 3 @ #x100413feb2> failed filename nil, position 1我的名为"valid.xml“的文件应该是有效的,因为它来自http://rdf.freebase.com/rdf/venture_capital.views.investment_round,并且我在其开头添加了以下内容:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:fb="http://www.my.com/site"
xmlns:xhtml="http://www.my.com/xhtml" xmlns:cc="http://www.my.com/cc">发布于 2011-11-18 02:06:18
为什么你要把它加到开头呢?它已经开始了:
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:cc="http://creativecommons.org/ns#"
xmlns:fb="http://rdf.freebase.com/ns/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xhtml="http://www.w3.org/1999/xhtml/vocab#"
>所以你的添加会破坏这个文件。
要查看这一点,请尝试,例如:
$ curl -s http://rdf.freebase.com/rdf/venture_capital.views.investment_round | head
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:cc="http://creativecommons.org/ns#"
xmlns:fb="http://rdf.freebase.com/ns/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xhtml="http://www.w3.org/1999/xhtml/vocab#"
>
<fb:common.document rdf:about="http://rdf.freebase.com/ns/venture_capital.views.investment_round">
<cc:attributionName>Source: Freebase - The World's database</cc:attributionName>
<xhtml:license rdf:resource="http://creativecommons.org/licenses/by/3.0/"/>或者更好的W3C RDF validation service:Validate the freebase data
发布于 2011-11-18 19:10:24
在freebase站点上托管的文件是有效的,您不需要更改它。
您可以使用工具“rapper”确认这一点:
$ rapper -c -i rdfxml http://rdf.freebase.com/rdf/venture_capital.views.investment_round rapper:使用解析器解析URI http://rdf.freebase.com/rdf/venture_capital.views.investment_round rdfxml rapper:解析返回16个三元组
https://stackoverflow.com/questions/8167834
复制相似问题