Skip to content

Latest commit

 

History

History
401 lines (346 loc) · 10.4 KB

PITCHME.md

File metadata and controls

401 lines (346 loc) · 10.4 KB

DSpace REST Reporting Tools – A REST Based Application within DSpace 6

Terry Brady

Georgetown University Library

https://github.com/terrywbrady/info


REST Report Tools

  • Released as a part of DSpace 6
  • Intended for Repository Managers
  • As DSpace 6 adoption increases, it is a good time to consider these tools
  • Built on the legacy DSpace 6 REST API

+++

Purpose

  • Metadata-centric view of your repository
  • Check for consistency
  • Generate metadata update files to repair inconsistencies
  • Answer questions
  • Locate feature use cases

+++

Background

  • Georgetown created a PHP of these tools for DSpace 1.8
    • Difficult to share
  • Switched the code to use DSpace REST
  • Contributed to DSpace 6
  • Look at API landing page

+++

Results

  • No longer writing reports/queries
  • Self-service reports for Digital Services team
  • Self-service data exports

+++

Try it yourself


Setup/Test Data

The test files referenced in this presentation are available on github.

See the tutorial for instructions.

+++

Note about the test data

The examples in this demo are contrived to make it easy to follow.

Our repository has half a million items. We have used these tools to fix inconsistencies in thousands of item records.


Create Tutorial Community

  • Login as Administrator
  • Create a community for the tutorial

+++ +++ +++


Task 1: Metadata Consistency

+++

Test Data

This test will use the following file to create 14 items with unique metadata. metadataUpload.csv +++ +++

Create a Collection named Demo 1

+++ +++

Navigate to the Collection and Get Its Handle

+++ Edit metadataUpload.csv, replace "your-coll-handle-goes-here" +++ +++ Bulk Import metadataUpload.csv +++ +++

+++

Review the report and select "Apply Changes"

+++

Demo 1 Queries

+++ Open the REST Report Query Tool:

  • /rest/static/reports/query.html +++

Select your "Demo 1" collection from the collection list

+++ +++

Run the pre-defined query "Has compound subject"

  • Include dc.subject in the report output +++ +++
  • Export the results and fix the metadata with a bulk update
    • Change kitten; puppy
    • to kitten||puppy

+++ +++

Run the pre-defined query "Has compound dc.creator"

  • Include dc.creator in the report output +++ +++
  • Export the results and fix the metadata with a bulk update
    • Change Person Five and Person One
      • to Person Five||Person One
    • Change Person Six and Person Seven
      • to Person Six||Person Seven +++ +++

Run the pre-defined query "Has URL in dc.description"

  • Include dc.description in the report output +++ +++ +++

Run the pre-defined query "Has non-ascii character in metadata"

  • Include dc.subject in the report output +++ +++ +++

Select "New Query" to return all items

+++ +++

  • Export all results as a CSV
  • Fix the lowercase titles in the export file
  • Bulk update the file +++

Queries and Filters

  • Step 1 - run query, count results
  • Step 2 - assemble "page" of results
  • Step 3 - apply filter to page of results
    • Filter counts are scoped to 1 page
  • Step 4 - add requested metadata

Task 2: Filter for Unique items

DSpace will provide a listing of all withdrawn or private items, but it is difficult to see these properties in the context of other query criteria. +++

Demo 2: Item Special Cases - Exploring Filters

+++ Query for items containing "TODO" in dc.description.abstract +++ +++ +++ In DSpace, edit the item "TODO: withdraw" and Withdraw it +++ +++ In DSpace, edit the item "TODO: make private" and Make it private +++ +++ Rerun the query tool, note that the withdrawn item does not appear

Items that a user cannot access will be filtered from the result set (unless you override this behavior in code) +++ Login to the REST interface to include withdrawn items in the report +++

  • In a new tab, open /rest/static/reports/authenticate.html
  • Sign in as an administrator +++ RE-run the TODO query +++ +++

Collection Report - Special Filters

Open the "Collection Filter" Report: /rest/static/reports/index.html +++ +++ Set Filters to View Counts of Private and Discoverable Items +++ +++ View Filter Counts +++ +++ +++ Add dc.description.abstract to Item Listing +++ +++ View Item Listing with dc.description.abstract +++

Task 3: Filter Items based on Bitstream Properties

+++

Bitstream Properties

Ingest Items with Zero, One, and Two Items and apply Bitstream Filters

The file itemsWithBitstreams.zip will be used to populate a collection used in this demonstration.

+++ In your test community, create a new Collection Named "Demo 3". Ingest the itemsWithBitstreams.zip. +++ +++

Query for Items based on Bitstream Filters

+++ Open the Collection Report +++ Set the Filter based on Original Bitstream Count

This report can be used to ensure consistent bitstream content within a collection. +++ +++ +++ Set the Filter based on Original Bitstream Type (Document or Image)

  • This report can be used to ensure consistent bitstream content within a collection.
  • If this filter is paired with the metadata query tool, it can be used to enforce required metadata for a specific bitstream type. +++ +++

Task 4: Filter Items based on Embargo Properties

+++

Ingest Items with Embargoes

Upload a Zip file containing embargoed items into Collection "Demo 3".

The file itemsWithEmbargoBitstreams.zip will be used to populate a collection used in this demonstration.

The contents file for each item sets a read restriction for the group Administrator for each item.

+++ +++ Set a filter to query for items with a restricted original bitstream (not visible to anonymous group) +++ +++

Task 5: View Bitstream Properties

Search Collection Demo 3 +++ +++ Add Bitstream Properties to the Result Set +++ +++ View Results +++

Task 6: Custom Extensions to the the REST Query Tools

Adding Custom Queries to the Query Tool

The query tool can be easily expanded to view/enforce local metadata conventions. +++ +++ +++

Code example - Add Query

See restQueryReport.js +++

Code example: Add Query to the List

this.initQueries = function() {
  $("#predefselect")
    .append($("<option value='gu2'>GU: Has sharestream audio</option>"))

+++

Code example: Set Metadata Query

} else if (val ==  'gu2') {
  self.drawFilterQuery("dc.relation.uri","matches","^https://mediapilot.georgetown.edu.*$");                                            
  self.drawFilterQuery("dc.type","equals","Audio");                                             
}

Adding Custom Filters

+++ +++

Code Example: Custom Filter

    public class ItemFilterDefsGU implements ItemFilterList {
        public static final String CAT_GU = "GEORGETOWN Filters";
        private enum EnumItemFilterDefs implements ItemFilterTest {
            stream_auth_image("Original Bitstream with Description: Auth Image", null, CAT_GU) {
                public boolean testItem(Context context, Item item) {
                        return ItemFilterUtil.countBitstreamByDesc(BundleName.ORIGINAL, item, "Sharestream Auth Image") > 0;
                }
            },

+++

Making Results Sortable

Using code from https://kryogenix.org/code/browser/sorttable/, you can make the tables in the report tools sortable. +++ +++ To enable this feature, add sorttable.js to your distribution and enable the following feature in restReport.js

    //Override this method is sortable.js has been included
    this.hasSorttable = function() {
      return false;
    }

+++

Enabling an Export to Google Sheets

See https://github.com/terrywbrady/PlainTextCSV_GoogleAppsScript to enable a Google Apps Script service that will create a Google Sheet from CSV. +++ +++ +++

    this.gsheet = function(rows) {
      var form = $("<form/>");
      $("#itemdiv").append(form);
      form.hide();
      form.attr("method","POST");
      form.attr("action","https://script.google.com/a/macros/<<your-domain>>/s/<<your-app>>/exec");
      var input = $("<textarea rows='10' cols='100'/>");
      input.attr("name","data");
      input.val(this.makeCsv(rows));
      form.append(input);
      input = $("<input type='submit'/>");
      form.append(input);
      form.submit();
    }

Demo of Georgetown's Report Tools

(Time and Network Permitting)

How might you use these tools?


Thank You

Terry Brady

Georgetown University Library

https://github.com/terrywbrady/info