为什么我在 FOAF 上尝试使用关系时会出现错误?
我正在尝试验证 W3C RDF 上的 foaf 代码,并且以下块会导致问题。在这里,我试图展示兰迪和阿迪尔之间的关系,请纠正我为什么我不能在这里使用“rel”标签或者为什么它会引起问题?
<foaf:knows>
<foaf:Person>
<foaf:name>Randy</foaf:name>
<foaf:mbox_sha1sum>0525a7bfaf263d404e751bb12b89e4acc1ce68a7</foaf:mbox_sha1sum>
<rdfs:workplaceHomepage rdf:resource="randy.html" />
<rel:friendOf rdf:resource="adil.html"/>
</foaf:Person>
</foaf:knows>
错误:
FatalError: The prefix "rel" for element "rel:friendOf" is not bound.[Line = 39, Column = 46]
I am trying to validate a foaf code on W3C RDF and the from following block it is causing problem. Here I am trying to show relation between Randy and Adil, please currect me why I can't use "rel" tag here or why is it causing problem?
<foaf:knows>
<foaf:Person>
<foaf:name>Randy</foaf:name>
<foaf:mbox_sha1sum>0525a7bfaf263d404e751bb12b89e4acc1ce68a7</foaf:mbox_sha1sum>
<rdfs:workplaceHomepage rdf:resource="randy.html" />
<rel:friendOf rdf:resource="adil.html"/>
</foaf:Person>
</foaf:knows>
Error:
FatalError: The prefix "rel" for element "rel:friendOf" is not bound.[Line = 39, Column = 46]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该将 FOAF 内容包装在声明适当名称空间的
RDF
元素中:You should wrap the FOAF content in an
RDF
element that declares the appropriate namespaces:您需要以与在 RDF/XML 文档顶部指定
foaf
相同的方式声明命名空间rel
。这个例子应该适合你......
无论如何,你对 rdfs:workplaceHomepage 的使用是错误的,你应该使用 foaf:workplaceHomepage 和 rel:friendOf< /code> 没有多大意义。您也可以在这里使用
foaf:knows
。You need to declare the namespace
rel
in the same way that you must have specifiedfoaf
at the top of your RDF/XML document.This example should work for you ...
Anyway the use you make of
rdfs:workplaceHomepage
is wrong, you should usefoaf:workplaceHomepage
and alsorel:friendOf
doesn't make much sense. You can usefoaf:knows
here also.