Projet

Général

Profil

Paste
Télécharger (1,55 ko) Statistiques
| Branche: | Révision:

root / drupal7 / modules / rdf / tests / rdf_test.module @ db2d93dd

1
<?php
2

    
3
/**
4
 * @file
5
 * Test API interaction with the RDF module.
6
 */
7

    
8
/**
9
 * Implements hook_rdf_mapping().
10
 */
11
function rdf_test_rdf_mapping() {
12
  return array(
13
    array(
14
      'type' => 'test_entity',
15
      'bundle' => 'test_bundle',
16
      'mapping' => array(
17
        'rdftype' => array('sioc:Post'),
18
        'title' => array(
19
          'predicates' => array('dc:title'),
20
        ),
21
        'created' => array(
22
          'predicates' => array('dc:created'),
23
          'datatype' => 'xsd:dateTime',
24
          'callback' => 'date_iso8601',
25
        ),
26
        'uid' => array(
27
          'predicates' => array('sioc:has_creator', 'dc:creator'),
28
          'type' => 'rel',
29
        ),
30
        'foobar' => array(
31
          'predicates' => array('foo:bar'),
32
        ),
33
        'foobar1' => array(
34
          'datatype' => 'foo:bar1type',
35
          'predicates' => array('foo:bar1'),
36
        ),
37
        'foobar_objproperty1' => array(
38
          'predicates' => array('sioc:has_creator', 'dc:creator'),
39
          'type' => 'rel',
40
        ),
41
        'foobar_objproperty2' => array(
42
          'predicates' => array('sioc:reply_of'),
43
          'type' => 'rev',
44
        ),
45
      ),
46
    ),
47
    array(
48
      'type' => 'node',
49
      'bundle' => 'blog',
50
      'mapping' => array(
51
        'rdftype' => array('sioct:Weblog'),
52
      ),
53
    ),
54
  );
55
}
56

    
57
/**
58
 * Implements hook_rdf_namespaces().
59
 */
60
function rdf_test_rdf_namespaces() {
61
  return array(
62
    'dc'       => 'http://purl.org/conflicting/namespace',
63
    'foaf'     => 'http://xmlns.com/foaf/0.1/',
64
    'foaf1'    => 'http://xmlns.com/foaf/0.1/',
65
  );
66
}