/[drupal]/contributions/modules/rdf/rdf.services.inc
ViewVC logotype

Contents of /contributions/modules/rdf/rdf.services.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Mon Feb 16 13:27:09 2009 UTC (9 months, 1 week ago) by arto
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA6, DRUPAL-6--1-0-ALPHA7, HEAD
Changes since 1.4: +0 -0 lines
File MIME type: text/x-php
Merged latest changes from http://github.com/bendiken/drupal-rdf.

Changelog:
- #330541 by jmiccolis: Views integration.
- Cache rdf_db_get_repository_tables() and rdf_db_count_repository_triples() results (by alex.k).
- Refactored rdf_db_get_repository_tables() and rdf_db_count_repository_triples().
- Prevent duplicate RDF statements from being inserted (in accordance with repository settings).
- Merge any duplicated RDF statements on cron runs (in accordance with repository settings).
- Implemented support for CCK Fieldgroup fields when outputting RSS feeds from the Views plugin.
- Honor Location module content-type-specific RSS settings when outputting RSS feeds from the Views plugin.
- Folded the RDF Schema module back into the base module, leaving a placeholder (for the time being) in order to allow users to cleanly uninstall the submodule.
- Renamed the 'RDF API' module to 'RDF'.
- Minor coding conventions cleanup.
- Updated the information in README.txt and INSTALL.txt; added contributors to README.txt.
1 <?php
2 // $Id$
3
4 //////////////////////////////////////////////////////////////////////////////
5 // Services API hooks
6
7 /**
8 * Implementation of hook_service().
9 */
10 function rdf_service() {
11 return array(
12 array(
13 '#method' => 'rdf.insert',
14 '#callback' => 'rdf_service_insert',
15 '#return' => 'boolean',
16 '#args' => array(
17 array('#name' => 'statement', '#type' => 'array', '#optional' => FALSE, '#description' => t('Subject, predicate, and object.')),
18 ),
19 '#help' => t('Inserts a new statement into the database.'),
20 ),
21 array(
22 '#method' => 'rdf.delete',
23 '#callback' => 'rdf_service_delete',
24 '#return' => 'boolean',
25 '#args' => array(
26 array('#name' => 'statement', '#type' => 'array', '#optional' => FALSE, '#description' => t('Subject, predicate, and object.')),
27 ),
28 '#help' => t('Deletes an existing statement from the database.'),
29 ),
30 array(
31 '#method' => 'rdf.query',
32 '#callback' => 'rdf_service_query',
33 '#return' => 'struct',
34 '#args' => array(
35 array('#name' => 'pattern', '#type' => 'array', '#optional' => TRUE, '#description' => t('Subject, predicate, and object.')),
36 ),
37 '#help' => t('Finds all statements in the database matching a given triple pattern.'),
38 ),
39 );
40 }
41
42 function rdf_service_insert(array $statement) {
43 return !!call_user_func_array('rdf_insert', $statement);
44 }
45
46 function rdf_service_delete(array $statement) {
47 return !!call_user_func_array('rdf_delete', $statement);
48 }
49
50 function rdf_service_query(array $pattern = array()) {
51 return rdf_deobjectify(rdf_normalize(call_user_func_array('rdf_query', $pattern)));
52 }

  ViewVC Help
Powered by ViewVC 1.1.2