Last updated January 4, 2012. Created on January 4, 2012.
Edited by xtfer. Log in to edit this page.

Introduction

Simple RDF automatically maps values of Drupal objects (e.g. nodes) to RDF properties. Simple RDF provides RDF mapping configuration for the node, user, and term object types per classification, such as content type in the case of nodes.

Simple RDF also comes with an RDF document display module, Simple RDF View. This module publishes the RDF document for an object on a configurable path under the object's path, e.g. `node/123/rdf`. You can also use the RDF module to display the RDF document, though its capability in Drupal 6 is limited (see *Limitations* below).

The Simple RDF SPARQL module provides an ARC2 SPARQL endpoint for the RDF data mapped for a site. The module maintains its own RDF triples cache optimized for the Drupal workflow so that it always serves the latest site data while updating itself only on site change.

Various aspects of the package are exportable via Features. Each mapping is exportable by type (e.g. node) and classification (e.g. content type). You can also export custom fields and namespaces.

Simple RDF is meant to be easy to use and highly extensible. For a guide to extending the module, please see API.txt.

Why another RDF module?

The well-known RDF project aims to translate the Drupal site structure into a site RDF graph. Each aspect of the site is mapped onto an RDF graph node, with each possible property and relationship mapped onto an RDF graph edge. While this is a semantically robust architecture, some of the simplifications it makes result in the following caveats:

  • Components outside of the Drupal entity model are not part of the Drupal RDF metamodel. To add RDF support for them, the components basically have to be incorporated into the entity model; that may not always be feasible.
  • Anything without a "physical" counterpart in the Drupal metamodel couldn't publish RDF. Metadata for files (as related to a node), for example, cannot be displayed along with the node. Metadata for BNodes as referenced from native entities are not displayed with the entity RDF data and thus nowhere else (though I believe this will be resolved soon, if not already).
  • Drupal entities have fixed URIs. The only addition they may have are aliases. Simple RDF allows for alternative URIs for site objects to provide metadata-oriented canonical URLs).

Simple RDF is meant for mapping Drupal objects into the more fundamental RDF statements. One CCK field may produce more than one set of statements, and multiple fields may be combined into one set of statements. The Drupal RDF model in this sense is loosely coupled with the Drupal metamodel.

In addition, Simple RDF is for Drupal 6 at the moment, which RDF has basically stopped developing new features for. Whether this module will be ported to Drupal 7 or future versions depends on how well it is received by the community and how much overlap this module has with others.

Requirements

This module requires Drupal 6 to run. In addition, it depends on:

- CCK
- CTools (6.x-1.8 or later)
- UUID

Simple RDF View and Simple RDF SPARQL require the ARC2 library. The library can be obtained at: http://arc.semsol.org

Installation

1. Extract the ARC2 library under `sites/all/libraries` such that the path
`./sites/all/libraries/arc/ARC2.php` points to the primary ARC2 file.
2. Extract the module into `sites/all/modules` and enable Simple RDF!

Usage

There are three basic scenarios:

Standalone RDF publishing

You may want to use this module on its own just to publish RDF data. To this end, enable Simple RDF and Simple RDF View. For taxonomy-related RDF mappings, also enable Simple RDF Taxonomy.

Publishing via the RDF module:

If another module requires the use of RDF and provides RDF data that you wish to include with the RDF documents, just enable Simple RDF (and optionally Simple RDF Taxonomy) along with RDF and most data mapped from Simple RDF are publishing with the other RDF triples.

See *Limitations* below.

RDF data served through SPARQL

Enable the Simple RDF and Simple RDF SPARQL modules to configure mappings for each object type (e.g. content) and only expose the RDF data through the SPARQL endpoint.

Of course, the three scenarios above are only the basic use cases. Simple RDF View is designed to work with RDF. It can take over RDF document publishing and
output on the default path; it can be configured to display RDF documents under its own paths; or, it can display RDF documents for term (and other extra types) and give priority over to the RDF module for node and user.

The administration interface can be found under Administer > Site building > Simple RDF (`admin/build/simplerdf`).

Limitations

Because of how RDF is implemented (at least for Drupal 6), RDF triples output for an object, such as a node, are limited to only triples where the subject is the node URI itself. Additionally, the URI (node or user) must be the default aliased path of the object.

As a workaround for the mismatched URI issue, if the URI format is not aliased path, you can enable Simple RDF View and set the view path of, for example, node RDF to something other than 'rdf'. The module should inject an additional RDF document link into the HTML header and display the Simple RDF mapped data there without interfering with the RDF module.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.