They are not related, at all. They just happen to share a name because they both have something to do with resources.
The term "resource" is central to the RDF data model (it's Resource Description Framework, after all). A resource in RDF is, very generally speaking, anything that can be identified by a URI (there's heaps of technical details regarding how things like blank nodes and literals fall under this definition, but for simplicity's sake we'll ignore that here).
rdf:resource
is just a syntax element in the RDF/XML syntax, namely an attribute to identify the resource that is the property value. For example, here's a simple RDF model (1 triple), in RDF/XML:
<rdf:Description rdf:about="http://example.org/Bob">
<foaf:address rdf:resource="http://example.org/address1"/>
</rdf:Description>
Here, http://example.org/Bob
is the subject resource, and foaf:address
is a property of that subject (used to link the subject resource to a value). The property value in this case is also a resource (http://example.org/address1
), so in the RDF/XML syntax we use rdf:resource
attribute to link it. If you were to write the same RDF model in a different syntax though (for example, Turtle), you wouldn't see rdf:resource
appear at all:
<http://example.org/Bob> foaf:address <http://example.org/address1> .
In RDF Schema, the class rdfs:Resource
is the class of all resources. It is a concept, not a syntax-specific mechanism. Since pretty much anything in RDF is a resource, it is the 'top-level' class of things. All things are resources, so if you introduce a new class, for example "Person", it will (automatically) be a subclass of rdfs:Resource
.
<http://example.org/Bob> rdf:type <http://example.org/Person> .
<http://example.org/Bob> rdf:type rdfs:Resource .
Note that the second triple is a logical consequence of the first triple. Therefore, in practice, the fact that bob is a Resource is almost never explicitly written down in RDF models - if needed, it can be inferred.