问题描述
我正在尝试将RDF本体导入Protégé或webvowl。 RDF文件似乎存在问题,因为导入不起作用,我总是收到错误消息(解析失败)。
我要使用的本体是FRBR-Core。除了FRBR-Core,还有本体FRBR-Extended。奇怪的是,可以将FRBR-Extended的RDF文件导入Webvowl和Protégé,因此该文件可以正常工作。 我查看了核心版本和扩展版本的RDF文件,希望能找到一个可以解释的差异,为什么一个文件可以工作而另一个文件却不能工作,但是我找不到任何东西。
我将FRBR-Core-Ontology复制到OWL Validator中,以查看出了什么问题。我得到的错误是:
有人知道这意味着什么吗?还是没有人知道,FRBR-Core的问题是什么?
谢谢!
解决方法
先前的答案:这在说明相对IRI为什么是问题时是正确的,但认为它在这里适用是错误的。
文件中的本体iri以
string:
开头,这不是有效的网络协议(根据验证者,编辑:该协议有效,但验证者仅限于urn:,http:,https: )。因此,IRI是相对的,这意味着如果存在一个IRI,它将相对于基础IRI进行解析,否则将针对文件位置进行解析。鉴于您看到了这种违规行为,这意味着这些机制都不可用。
本体中的IRI不能是相对的,它们必须是绝对的-否则断言将根据从何处解析文件而改变。这违反了OWL规范,此处重点强调。
我已经在验证器中尝试了本体,并使用OWLAPI 4验证并直接在Protege中尝试了代码。因此,出现以下情况:
-
您使用的在线验证程序正在手动添加本体IRI,因为本体本身没有声明(Protege在加载时会发出以下警告:
INFO 08:02:37从http://purl.org/vocab/frbr/frbr-core-20050810.rdf加载本体 INFO 08:02:41注意:根元素没有xml:base。相对IRI将针对http://purl.org/vocab/frbr/frbr-core-20050810.rdf
进行解析
从您所拥有页面的URL中 -
加载不起作用-而是下载HTML。我不确定这是否是内容协商问题,还是只能通过页面内的链接访问本体。使用此链接有效:
还有其他OWL 2 DL违规行为,但它们不应该阻止您使用本体。
Use of undeclared class: <http://web.resource.org/cc/Work> [ClassAssertion(<http://web.resource.org/cc/Work> <http://purl.org/vocab/frbr/frbr-core-20050810.rdf>) in OntologyID(OntologyIRI(<http://purl.org/vocab/frbr/frbr-core-20050810.rdf>) VersionIRI(<null>))]
Use of undeclared annotation property: <http://purl.org/dc/elements/1.1/creator>
Use of undeclared annotation property: <http://purl.org/dc/terms/issued>
Use of undeclared annotation property: <http://www.w3.org/2004/02/skos/core#changeNote>
Use of undeclared annotation property: <http://www.w3.org/2004/02/skos/core#example>
Use of undeclared annotation property: <http://www.w3.org/2004/02/skos/core#historyNote>
Use of undeclared annotation property: <http://www.w3.org/2004/02/skos/core#definition>
Use of reserved vocabulary for data property IRI: rdf:value [DataPropertyAssertion(rdf:value _:genid2147483651 "application/rdf+xml")
Use of reserved vocabulary for data property IRI: rdf:value [DataPropertyAssertion(rdf:value _:genid2147483649 "text/html")