0

Is it possible to subclass a class found in 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>
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
cgf
  • 3,369
  • 7
  • 45
  • 65

1 Answers1

3

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. However, that latter class is not the FOAF Agent class. The FOAF Agent class is identified by the URI http://xmlns.com/foaf/0.1/Agent (with no #). It might be useful to have a look at the actual FOAF ontology, because you can see how it defines subclasses of Agent. For instance, it declared 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:

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" .
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thanks for the answer. Follow-up question: within the subclass of Agent (the User class described in the question), should I point to a property of Agent as `foaf:name` or `mydomain:name` ? – cgf May 23 '14 at 19:44
  • 1) a followup question should probably be posted as a new question, not as a comment on (an answer to) an existing one. 2) I'm not clear what you're asking. You don't "point to a property", you use a property. If an instance of User has a foaf:name, then you describe its name using foaf:name. – Joshua Taylor May 23 '14 at 19:52