我正在尝试验证 W3C RDF上的foaf代码,并且从下面的块中导致问题.在这里,我试图展示兰迪和阿迪尔之间的关系,请告诉我为什么我不能在这里使用“rel”标签或为什么它会导致问题? foaf
<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]您应该将FOAF内容包装在声明相应名称空间的RDF元素中:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:rel="http://www.perceive.net/schemas/relationship/">
