0

是否可以对 FOAF ( http://xmlns.com/foaf/spec/ ) 中的类进行子类化?我尝试了类似下面的代码,但我不确定这是否是正确的方法。

<rdfs:Class rdf:ID="user"> 
    <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/#Agent" />
    <rdfs:comment> 
        The class of users, subclass of foaf:Agent.
    </rdfs:comment>  
</rdfs:Class>
4

1 回答 1

3

您的代码片段虽然不是完整的 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" .
于 2014-05-22T22:25:19.653 回答