Skip to content

Commit

Permalink
Resolves #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed May 5, 2021
1 parent 1aaaca1 commit 66bcc73
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Introduction

A Drupal 8/9 module that serializes PREMIS metadata generated by various Islandora modules and microsrevices. This module produces PREMIS v3 in Turtle RDF for a node by appending `/premis` to the end of the node's URL, e.g., `https://localhost/node/250/premis`.
A Drupal 8/9 module that serializes PREMIS metadata generated by various Islandora modules and microsrevices, including Islandora, JSON-LD, and Riprap. This module produces PREMIS v3 in Turtle RDF for a node by appending `/premis` to the end of the node's URL, e.g., `https://localhost/node/250/premis`.

This module is not ready for prodcution use. But could be soon with your feedback and testing!
Feedback on what PREMIS entities and events you'd like to see in this output is welcome.

Output will look like this:

Expand Down Expand Up @@ -72,6 +72,8 @@ Note that the fixity events are added by the [Islandora Riprap](https://github.c

* [Islandora 8](https://github.com/Islandora/islandora)

If [Islandora Riprap](https://github.com/mjordan/islandora_riprap) is installed, fixity check events will be added to the PREMIS output.

## Installation

1. Clone this repo into your Islandora's `drupal/web/modules/contrib` directory.
Expand Down
12 changes: 10 additions & 2 deletions islandora_premis.module
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ function islandora_premis_islandora_premis_turtle_alter($nid, &$turtle) {
if (count($media) > 0) {
foreach ($media as $medium) {
$file = $media_source->getSourceFile($medium);
$binary_resource_url = $file_uri_lookup->getUrl($medium->id());
if (is_null($binary_resource_url)) {
$file_url = $file_uri_lookup->getUrl($medium->id());
if (is_null($file_url)) {
return;
}

$binary_resource_url = $file_url;
if (\Drupal::moduleHandler()->moduleExists('islandora_riprap')) {
$riprap_config = \Drupal::config('islandora_riprap.settings');
if ($riprap_config->get('use_drupal_urls')) {
$binary_resource_url = $islandora_riprap_utils->getLocalUrl($medium->id());
}
}

// Register some namespaces.
$ns = new RdfNamespace();
$ns->set('premisObject', 'http://www.loc.gov/premis/rdf/v3/Object');
Expand Down

0 comments on commit 66bcc73

Please sign in to comment.