Browse Source

updated rdf mappings fixed missing class in gbif parser added rdf namespace hook

master
Paul Pound 9 years ago
parent
commit
7680542feb
  1. 2
      .gitignore
  2. 46
      config/install/rdf.mapping.node.islandora_herbarium_object.yml
  3. 11
      islandora_herbarium_object.module
  4. 1
      src/DataParser/GbifParser.php

2
.gitignore vendored

@ -8,3 +8,5 @@ config/install/media_entity.bundle.image_tiff.yml
config/install/media_entity.bundle.jp2.yml config/install/media_entity.bundle.jp2.yml
config/install/media_entity.bundle.tn.yml config/install/media_entity.bundle.tn.yml
config/install/media_entity.bundle.web_content.yml config/install/media_entity.bundle.web_content.yml
config/install/field.storage.node.field_tags.yml
config/install/core.entity_view_mode.node.search_index

46
config/install/rdf.mapping.node.islandora_herbarium_object.yml

@ -50,6 +50,36 @@ fieldMappings:
field_dwc_genus: field_dwc_genus:
properties: properties:
- 'dwc:genus' - 'dwc:genus'
field_dwc_class:
properties:
- 'dwc:class'
field_dwc_kingdom:
properties:
- 'dwc:kingdom'
field_dwc_phylum:
properties:
- 'dwc:phylum'
field_dwc_order:
properties:
- 'dwc:order'
field_dwc_family:
properties:
- 'dwc:family'
field_dwc_continent:
properties:
- 'dwc:continent'
field_dwc_country:
properties:
- 'dwc:country'
field_dwc_stateprovince:
properties:
- 'dwc:stateprovince'
field_dwc_decimallatitude:
properties:
- 'dwc:decimallatitude'
field_dwc_decimallongitude:
properties:
- 'dwc:decimallongitude'
field_dwc_eventdate: field_dwc_eventdate:
properties: properties:
- 'dwc:eventDate' - 'dwc:eventDate'
@ -57,22 +87,6 @@ fieldMappings:
properties: properties:
- 'pcdm:memberOf' - 'pcdm:memberOf'
mapping_type: rel mapping_type: rel
field_tiff:
properties:
- 'pcdm:hasFile'
mapping_type: rel
field_jp2:
properties:
- 'pcdm:hasFile'
mapping_type: rel
field_web_content:
properties:
- 'pcdm:hasFile'
mapping_type: rel
field_tn:
properties:
- 'pcdm:hasFile'
mapping_type: rel
title: title:
properties: properties:
- 'dc:title' - 'dc:title'

11
islandora_herbarium_object.module

@ -25,6 +25,17 @@ function islandora_herbarium_object_help($route_name, RouteMatchInterface $route
} }
} }
/**
* Implements hook_rdf_namespaces().
*/
function islandora_herbarium_object_rdf_namespaces() {
// Yes, it's amazing, rdf is not registered by default!
return [
'dwc' => 'http://rs.tdwg.org/dwc/terms/',
'dwciri' => 'http://rs.tdwg.org/dwc/iri/',
];
}
/** /**
* Implements hook_entity_presave(). * Implements hook_entity_presave().
*/ */

1
src/DataParser/GbifParser.php

@ -49,6 +49,7 @@ class GbifParser extends DataParser
$entity->set('field_dwc_phylum', $this->getValue('phylum')); $entity->set('field_dwc_phylum', $this->getValue('phylum'));
$entity->set('field_dwc_order', $this->getValue('order')); $entity->set('field_dwc_order', $this->getValue('order'));
$entity->set('field_dwc_family', $this->getValue('family')); $entity->set('field_dwc_family', $this->getValue('family'));
$entity->set('field_dwc_class', $this->getValue('class'));
$entity->set('field_dwc_vernacularname', $this->getValue('vernacularName')); $entity->set('field_dwc_vernacularname', $this->getValue('vernacularName'));
} }

Loading…
Cancel
Save