Search code examples
rdfsemantic-webontologyrdfs

subClassOf and instance of RDF rdfs:Class


In RDFS, all things are instances of rdfs:Resource. All other classes are subclasses of rdfs:Resource. And rdfs:Resource is an instance of rdfs:Class.

My question is: Could any one help explain this paragraph above? I am confused about this subclass and instance and why they have that relationship.


Solution

  • There are three parts here:

    All things are instances of rdfs:Resource.

    Yup, everything is a resource. You, me, the value true, etc. Everything is a resource. Resource is the catch-all class of everything.

    All other classes are subclasses of rdfs:Resource.

    The word "other" here might be misleading, since rdfs:Resource is an rdfs:Resource too, since every class is a subclass of itself. But yes, every class is a subclass of rdfs:Resource. X is a subclass of Y when being an instance of X implies being an instance of Y. Since everything is an rdfs:Resource, then for any class X, if something is an X, that same thing is also an rdfs:Resource. (In a sense, this is trivial.)

    rdfs:Resource is an instance of rdfs:Class.

    Yes. Everything that is a class is an instance of rdfs:Class. rdfs:Resource is a class, so it's an instance of rdfs:Class.

    If you want to think in terms of triples, the above mean that

    1. For all x, we have the triple: [x rdf:type rdfs:Resource].
    2. For all x, we have the relationship: if [x rdf:type Class] then [x rdfs:subClassOf rdfs:Resource].
    3. We have the triple: [rdfs:Resource rdf:type rdfs:Class].

    You don't mention it in the question, but I wonder if this may be confusing because it leads to the situation that we have all of the following:

    • [rdfs:Resource rdf:type rdfs:Class]
    • [rdfs:Class rdf:type rdfs:Resource]
    • [rdfs:Class rdfs:subClassOf rdfs:Resource]

    These might look a little bit odd, but looking at their meaning, they all seem acceptable:

    • resource is a class (i.e., rdfs:Resource is the kind of thing that something can be; it makes sense to say "x is an rdfs:Resource").
    • class is a resource (everything's a resource!)
    • every class is a resource (after all, everything's a resource!)