简体   繁体   English

RDFS:如何对FOAF类进行子类化

[英]RDFS: How to subclass a FOAF class

Is it possible to subclass a class found in FOAF ( http://xmlns.com/foaf/spec/ )? 是否可以继承在FOAF( http://xmlns.com/foaf/spec/ )中找到的类? I tried something like the code below, but I am not sure if it is the proper way to do it or not. 我尝试了类似以下代码的方法,但是我不确定这是否是正确的方法。

<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>

Your snippet, although not a complete RDF document, is the right way to make yourdoc#user a subclass of http://xmlns.com/foaf/0.1/#Agent . 您的代码段虽然不是完整的RDF文档,但却是使yourdoc#user成为http://xmlns.com/foaf/0.1/#Agent子类的正确方法。 However, that latter class is not the FOAF Agent class. 但是,后一类不是FOAF代理类。 The FOAF Agent class is identified by the URI http://xmlns.com/foaf/0.1/Agent (with no # ). FOAF代理类由URI http://xmlns.com/foaf/0.1/Agent (不带# )标识。 It might be useful to have a look at the actual FOAF ontology , because you can see how it defines subclasses of Agent. 查看实际的FOAF本体可能很有用,因为您可以看到它如何定义Agent的子类。 For instance, it declared foaf:Organization with 例如,它声明了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>

If you're writing this by hand, it's much easier to work in the Turtle or N3 serialization, where that would be: 如果您是手工编写的,那么在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" .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM