home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (rdf_test.module)

This example Drupal source code file (rdf_test.module) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, bundle, datatype, dc:creator, function, mapping, php, predicates, rdftype, rel, return, test_bundle, title, type

The rdf_test.module Drupal example source code

<?php
// $Id: rdf_test.module,v 1.4 2010/04/22 21:41:09 webchick Exp $

/**
 * @file
 * Test API interaction with the RDF module.
 */

/**
 * Implements hook_rdf_mapping().
 */
function rdf_test_rdf_mapping() {
  return array(
    array(
      'type' => 'test_entity',
      'bundle' => 'test_bundle',
      'mapping' => array(
        'rdftype' => array('sioc:Post'),
        'title' => array(
          'predicates' => array('dc:title'),
        ),
        'created' => array(
          'predicates' => array('dc:created'),
          'datatype' => 'xsd:dateTime',
          'callback' => 'date_iso8601',
        ),
        'uid' => array(
          'predicates' => array('sioc:has_creator', 'dc:creator'),
          'type' => 'rel',
        ),
        'foobar' => array(
          'predicates' => array('foo:bar'),
        ),
        'foobar1' => array(
          'datatype' => 'foo:bar1type',
          'predicates' => array('foo:bar1'),
        ),
        'foobar_objproperty1' => array(
          'predicates' => array('sioc:has_creator', 'dc:creator'),
          'type' => 'rel',
        ),
        'foobar_objproperty2' => array(
          'predicates' => array('sioc:reply_of'),
          'type' => 'rev',
        ),
      ),
    ),
    array(
      'type' => 'node',
      'bundle' => 'blog',
      'mapping' => array(
        'rdftype' => array('sioct:Weblog'),
      ),
    ),
  );
}

/**
 * Implements hook_rdf_namespaces().
 */
function rdf_test_rdf_namespaces() {
  return array(
    'dc'       => 'http://purl.org/conflicting/namespace',
    'foaf'     => 'http://xmlns.com/foaf/0.1/',
    'foaf1'    => 'http://xmlns.com/foaf/0.1/',
  );
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal rdf_test.module source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.