RDF API functions

Statement-centric queries

rdf_exists($subject[, $predicate, $object, $options])
Determines whether a given statement exists.
rdf_count($subject[, $predicate, $object, $options])
Returns the number of matching statements.
rdf_query($subject[, $predicate, $object, $options])
Finds all statements matching a given triple pattern.

Statement-centric operations

rdf_insert_all($statements[, $options])
Inserts multiple new statements.
rdf_insert($subject[, $predicate, $object, $options])
Inserts a new statement.
rdf_delete_all($statements[, $options])
Deletes multiple existing statements.
rdf_delete($subject[, $predicate, $object, $options])
Deletes an existing statement.

RDF/PHP normalization


RDF/PHP serialization


RDF API hooks

The RDF API exposes the following Drupal hooks that third-party extension modules can implement to provide extended functionality:


Allows modules to take action when RDF statements are inserted or deleted.

Example of usage

 * Implementation of hook_rdf().
function mymodule_rdf($op, $subject, $predicate, $object) {
  switch ($op) {
    case 'insert':
      // A new statement was asserted
    case 'delete':
      // An existing statement was unasserted


Defines URI abbreviations for use in CURIEs and QNames.

Example from the RDF API module

* Implementation of hook_rdf_namespaces().
function rdf_rdf_namespaces() {
return array(
'_' => 'http://bnode.net/',
'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#',
'xsi' => 'http://www.w3.org/2001/XMLSchema-instance#',
'xsd' => 'http://www.w3.org/2001/XMLSchema#',

RDF API concepts

Note that this document is not intended at introducing the RDF model or assorted specifications, but rather at introducing their specific application in the context of the RDF API for Drupal. If any of the basic concepts touched upon in the following are unfamiliar, you may wish to consult the RDF introduction and glossary before proceeding onwards.


A repository is a storage container for RDF data, and can be implemented, for instance, in terms of an in-memory triple store, a serialized file on disk, an RDBMS database, or even an RPC connection to a remote service.

For example, the RDF DB module implements RDBMS-backed repositories, and the RDF Import module allows any serialized RDF graph (e.g. an RDF/XML file) to be used as a read-only repository.

Drupal modules can define repositories by implementing the hook_rdf_repositories() hook.


Resource Description Framework (RDF)

The Resource Description Framework project is an ensemble of modules providing comprehensive RDF functionality and interoperability. In 2009, Stéphane "scor" Corlosquet and others published Produce and Consume Linked Data with Drupal! which presents the approach for using Drupal (or any other CMS) as a Linked Data producer and consumer platform.

Group level administration


The site I'm building needs to support creation of accounts with multiple users and an account administrator. Features I'd like to implement:

Various questions: Comments, OpenID, etc.

Hi there!

I'm in the process of moving my website to drupal (6). Currently I'm using a homebrewn CMS but I think drupal is the way to go. There are some things I can't get to work though and searching and irc'ing has brought me no further. So here's whats bugging me:

1. OpenID is nice. Very nice. So nice I want to make it the default and only login mechanism on my site. Right now when a user goes to user/login he has to follow yet another link for OpenID login. I don't like this. Is there no way to disable the default login mechanism alltogether? I think this should be a theme thing but I can't find any documentation here. Any hints?

2. I don't like the default way comments are handled in drupal. I'd like the current fields and everything stay just the way it is. But additionally there should be an OpenID field for those, who are not yet logged in. The data from OpenID should then be populated on my website. To sum it up:
required input: OpenID, comment text
optional input: comment title
output: comment, number, openID (linked)
-> optional output (if supplied by openID resource): website, email

Do I have to implement all that on my own? Or are there modules I haven't found out there which can help me with that?


Subscribe with RSS Subscribe to RSS - Drupal 6.x