Browse Source

RDF mapping refactor.

7.x-2.x
Daniel Lamb 10 years ago
parent
commit
a0886358fe
  1. 73
      islandora/include/rdf_mapping.inc
  2. 10
      islandora/islandora.module
  3. 2
      islandora_basic_image/islandora_basic_image.info
  4. 8
      islandora_basic_image/islandora_basic_image.module
  5. 41
      islandora_collection/islandora_collection.module

73
islandora/include/rdf_mapping.inc

@ -0,0 +1,73 @@
<?php
function islandora_get_default_rdf_mapping($bundle) {
return array(
array(
'type' => 'node',
'bundle' => $bundle,
'mapping' => array(
'rdftype' => array('islandora:collection'),
'field_dcterms_contributor' => array(
'predicates' => array('dc:contributor'),
'datatype' => 'xsd:string',
),
'field_dcterms_coverage' => array(
'predicates' => array('dc:coverage'),
'datatype' => 'xsd:string',
),
'field_dcterms_creator' => array(
'predicates' => array('dc:creator'),
'datatype' => 'xsd:string',
),
'field_dcterms_date' => array(
'predicates' => array('dc:date'),
'datatype' => 'xsd:string',
),
'field_dcterms_description' => array(
'predicates' => array('dc:description'),
'datatype' => 'xsd:string',
),
'field_dcterms_format' => array(
'predicates' => array('dc:format'),
'datatype' => 'xsd:string',
),
'field_dcterms_identifier' => array(
'predicates' => array('dc:identifier'),
'datatype' => 'xsd:string',
),
'field_dcterms_language' => array(
'predicates' => array('dc:language'),
'datatype' => 'xsd:string',
),
'field_dcterms_publisher' => array(
'predicates' => array('dc:publisher'),
'datatype' => 'xsd:string',
),
'field_dcterms_relation' => array(
'predicates' => array('dc:relation'),
'datatype' => 'xsd:string',
),
'field_dcterms_rights' => array(
'predicates' => array('dc:rights'),
'datatype' => 'xsd:string',
),
'field_dcterms_source' => array(
'predicates' => array('dc:source'),
'datatype' => 'xsd:string',
),
'field_dcterms_subject' => array(
'predicates' => array('dc:subject'),
'datatype' => 'xsd:string',
),
'field_dcterms_title' => array(
'predicates' => array('dc:title'),
'datatype' => 'xsd:string',
),
'field_dcterms_type' => array(
'predicates' => array('dc:type'),
'datatype' => 'xsd:string',
),
),
),
);
}

10
islandora/islandora.module

@ -21,6 +21,16 @@ function islandora_ctools_plugin_api($owner, $api) {
}
}
/**
* Implements hook_rdf_namespaces().
*/
function islandora_rdf_namespaces() {
return array(
'islandora' => 'http://islandora.ca/ontology/v2/',
'fedora' => 'http://fedora.info/definitions/v4/repository#',
);
}
/**
* Implements hook_default_services_endpoint().
*/

2
islandora_basic_image/islandora_basic_image.info

@ -3,4 +3,4 @@ description = "Content type, viewer, and hooks for Basic Image objects"
package = Islandora
version = 7.x-dev
core = 7.x
dependencies[] = islandora
dependencies[] = islandora

8
islandora_basic_image/islandora_basic_image.module

@ -27,3 +27,11 @@ function islandora_basic_image_node_info() {
function islandora_basic_image_form($node, array &$form_state) {
return node_content_form($node, $form_state);
}
/**
* Implements hook_rdf_mapping().
*/
function islandora_basic_image_rdf_mapping() {
module_load_include('inc', 'islandora', 'include/rdf_mapping');
return islandora_get_default_rdf_mapping(ISLANDORA_BASIC_IMAGE_CONTENT_TYPE);
}

41
islandora_collection/islandora_collection.module

@ -42,49 +42,12 @@ function islandora_collection_form($node, array &$form_state) {
return node_content_form($node, $form_state);
}
/**
* Implements hook_rdf_namespaces().
*/
function islandora_collection_rdf_namespaces() {
return array(
'islandora' => 'http://islandora.ca/ontology/v2/',
'fedora' => 'http://fedora.info/definitions/v4/repository#',
);
}
/**
* Implements hook_rdf_mapping().
*/
function islandora_collection_rdf_mapping() {
return array(
array(
'type' => 'node',
'bundle' => ISLANDORA_COLLECTION_CONTENT_TYPE,
'mapping' => array(
'rdftype' => array('islandora:collection'),
'field_dcterms_contributor' => array(
'predicates' => array('dc:contributor'),
'datatype' => 'xsd:string',
),
'field_dcterms_coverage' => array(
'predicates' => array('dc:coverage'),
'datatype' => 'xsd:string',
),
'field_dcterms_creator' => array(
'predicates' => array('dc:creator'),
'datatype' => 'xsd:string',
),
'field_dcterms_date' => array(
'predicates' => array('dc:date'),
'datatype' => 'xsd:string',
),
'field_dcterms_description' => array(
'predicates' => array('dc:description'),
'datatype' => 'xsd:string',
),
),
),
);
module_load_include('inc', 'islandora', 'include/rdf_mapping');
return islandora_get_default_rdf_mapping(ISLANDORA_COLLECTION_CONTENT_TYPE);
}
/**

Loading…
Cancel
Save