您的代码片段虽然不是完整的 RDF 文档,但却是 yourdoc#user
创建http://xmlns.com/foaf/0.1/#Agent
. 然而,后一类不是 FOAF 代理类。FOAF 代理类由 URI 标识http://xmlns.com/foaf/0.1/Agent
(没有#
)。查看实际的FOAF 本体可能很有用,因为您可以看到它如何定义 Agent 的子类。例如,它声明了 foaf:Organization with
<rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Organization" rdfs:label="Organization" rdfs:comment="An organization." vs:term_status="stable">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
<rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
<rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
<owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
<owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
</rdfs:Class>
如果您是手动编写的,那么在 Turtle 或 N3 序列化中工作会容易得多,其中将是:
foaf:Organization a rdfs:Class , owl:Class ;
rdfs:comment "An organization." ;
rdfs:isDefinedBy foaf: ;
rdfs:label "Organization" ;
rdfs:subClassOf foaf:Agent ;
owl:disjointWith foaf:Person , foaf:Document ;
vs:term_status "stable" .