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.tn.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,28 +50,42 @@ fieldMappings:
field_dwc_genus:
properties:
- 'dwc:genus'
field_dwc_eventdate:
field_dwc_class:
properties:
- 'dwc:eventDate'
field_memberof:
- 'dwc:class'
field_dwc_kingdom:
properties:
- 'pcdm:memberOf'
mapping_type: rel
field_tiff:
- 'dwc:kingdom'
field_dwc_phylum:
properties:
- 'pcdm:hasFile'
mapping_type: rel
field_jp2:
- 'dwc:phylum'
field_dwc_order:
properties:
- 'pcdm:hasFile'
mapping_type: rel
field_web_content:
- 'dwc:order'
field_dwc_family:
properties:
- 'pcdm:hasFile'
mapping_type: rel
field_tn:
- 'dwc:family'
field_dwc_continent:
properties:
- 'dwc:continent'
field_dwc_country:
properties:
- 'pcdm:hasFile'
- 'dwc:country'
field_dwc_stateprovince:
properties:
- 'dwc:stateprovince'
field_dwc_decimallatitude:
properties:
- 'dwc:decimallatitude'
field_dwc_decimallongitude:
properties:
- 'dwc:decimallongitude'
field_dwc_eventdate:
properties:
- 'dwc:eventDate'
field_memberof:
properties:
- 'pcdm:memberOf'
mapping_type: rel
title:
properties:

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().
*/

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_order', $this->getValue('order'));
$entity->set('field_dwc_family', $this->getValue('family'));
$entity->set('field_dwc_class', $this->getValue('class'));
$entity->set('field_dwc_vernacularname', $this->getValue('vernacularName'));
}

Loading…
Cancel
Save