I'd like to share some quick thoughts on how Drupal Data could be described in RDF. The attached schema represents the mappings between the current Drupal data structure and the proposed RDF Schema, reusing existing ontologies such as Dublin Core, FOAF, SIOC and SKOS.
The green circles represent the Drupal objects (node, revision, user, role, term), with their equivalent RDF class. The rectangles are the values used in Drupal. It's important to differentiate a class from its actual instances (resources) which are each defined by a unique URI, see the examples below. This schema is meant to be simple, incomplete, and to show the main core features.
Comment and Node are 2 different elements in Drupal, they can be combined in the same Class with the recursive property
sioc:has_reply (Comment as Node). Node and Revision objects are separate here as they are in the Drupal Data structure, but they could fundamentally be merged as well.
I presented SIOC at DrupalCon Barcelona, and showed how it can be used to describe online communities. The SIOC
sioc:Item class which I used here as equivalent of a Node is a broad Class with many sub-types: AddressBook, AnnotationSet, AudioChannel, BookmarkFolder, MailingList, MessageBoard, BlogPost, BoardPost, WikiArticle... See the SIOC Types Module for more details.
This is an example of how this schema can be used in the case of a role:
The user 5 has the 'authenticated user' role. This role has 3 permissions: 'create book content', 'view revisions' and 'upload files'.
user 5 is an instance of
sioc:User and its URI is http://example.com/user/5.
'authenticated user' role is an instance of
sioc:Role and its URI is http://example.com/admin/user/permissions/2.
All this information can be expressed in turtle:
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix drupal: <http://drupal.org/ns/> .
@prefix sioc: <http://rdfs.org/sioc/ns#> .
<http://example.com/user/5> sioc:has_function <http://example.com/admin/user/permissions/2> .
<http://example.com/admin/user/permissions/2> dc:title "authenticated user"@en .
<http://example.com/admin/user/permissions/2> drupal:has_permission "create book content"@en .
<http://example.com/admin/user/permissions/2> drupal:has_permission "view revisions"@en .
<http://example.com/admin/user/permissions/2> drupal:has_permission "upload files"@en .
<dc:title>Drupal 6.0 released</dc:title>
<sioc:User rdf:about="http://drupal.org/user/4166" rdfs:label="Gábor Hojtsy" />
<sioc:content>After one year of development we are ready to release Drupal 6.0 to the world. Thanks to the tireless work of the Drupal community, over 1,600 issues have been resolved during the Drupal 6.0 release cycle. These changes are...
<sioc:topic rdfs:label="News and announcements" rdf:resource="http://drupal.org/forum/8"/>
<sioc:topic rdfs:label="Drupal 6.x" rdf:resource="http://drupal.org/taxonomy/term/102"/>
<sioc:Post rdf:about="http://drupal.org/drupal-6.0#comment-728240" />
<sioc:Post rdf:about="http://drupal.org/drupal-6.0#comment-728246" />
<sioc:Post rdf:about="http://drupal.org/drupal-6.0#comment-729369" />