PrimoVE: Discovery Imports for the Innocent, the Eager, and the Doomed
STACY MAGEDANZ, CAL STATE SAN BERNARDINO
BRANDON DUDLEY, CAL STATE CHANCELLOR’S OFFICE
ECAUG CONFERENCE, JULY 30, 2021
Summary
Discovery Imports in VE, Overview
Step 1: Import Profiles
Alma Config > Discovery > (Loading External Data Sources) > Discovery Import Profiles�
Profile setup, continued
Potential problems
We pause now for a haiku:
Errors have occurred
We won’t tell you where or why
Lazy programmers
Potential solution
“What I've done is basically go through the OAI feed 100 records at a time until I hit an error. I went to [https://your.dcservername.edu/do/oai/?verb=ListRecords&metadataPrefix=dcq&set=publication:yourseries] in Firefox and just kept going through the resumption tokens until I hit the error - if you use Firefox, it'll tell you the exact line with the error. I use batch revise to fix the issue, both so that the user won't receive any email that a revision has been made, and so I can see the HTML code for the abstract directly and see what's going on. Sometimes when copying things over from PDFs into the formatted text field on the submission form, weird characters or lines can end up in the text which can cause an error with the OAI output.”
Step 2: Normalization
Preparation: Expose XML of Digital Commons record
https://your.server.here/do/oai/?verb=GetRecord&metadataPrefix=dcq&identifier=oai:your.server.here:series-123
The number is NOT the one that appears in the basic DC document URL!
Instead, view page source, then find in page article= The number following this string is the one you want.
https://scholarworks.lib.csusb.edu/etd/238/
View page source to find the real number
Getting started…
Stumbling blocks!
And now, a word about DROOLS….
Discovery External Data Source Normalization Rules for Dum…SmartPeopleWhoDontYetKnowHowToWorkWithDrools
Drools basics cont.
Drool basics cont.
Remove substring using regex | Return list using regex |
Concatenate with delimiter | Remove string |
Add prefix | Remove leading and trailing spaces |
Add suffix | Replace spaces |
Replace string by string | Lower case |
A simple example: Write a resource type…�Add a resource type field & value
rule "create etd"
when
(true)
then
set "etd" in "dc"."type"
end
Specify that resource type for discovery
rule "etd"
when
"dc"."type" equals "etd"
then
set "etd" in "discovery"."resourceType"
End
*You may write these as separate rules, or string them together in one.
But wait! Primo doesn’t know what discovery resource type that is yet…
Make sure code matches value in DROOL
End result on the public side…
Advanced examples: Workflow
Workflow cont.
Workflow cont.
Why do I need to know this?
Ex: Add thesis program name to record
rule "Primo VE - Lds03"
when
exist "dc"."thesis.degree.name"
then
copy "dc"."thesis.degree.name" to "discovery"."local3"
end
Ex: Add thesis program name to record
rule "Primo VE - Lds03"
when
exist "dc"."thesis.degree.name"
then
copy "dc"."thesis.degree.name" to "discovery"."local3"
end
Ex: Identify Advisor in record
rule "dc:contributor"
when
exist "dc"."contributor"
then
set TEMP"1" to dc value "dc"."contributor"
add suffix (TEMP"1"," (Advisor)")
set "dc"."contributor" to TEMP"1"
end
Ex: Identify Advisor in record
Ex: Set constant field identifying campus as publisher
rule "publisher value"
when
true
then
set "CSUSB ScholarWorks" in "dc"."publisher"
end
Ex: Set constant field identifying campus as publisher
rule "publisher value"
when
true
then
set "CSUSB ScholarWorks" in "dc"."publisher"
end
Ex: Add Thesis Date to Abstract
rule "Primo VE - Lds01"
when
exist "dc"."description.abstract"
then
set TEMP"2" to dc value "dc"."description.abstract"
set TEMP"1" to dc value "dc"."date.created"
remove substring using regex (TEMP"1","(?<=^.{4}).*")
add prefix (TEMP"1","California State University San Bernardino ")
concatenate with delimiter (TEMP"2",TEMP"1"," ")
set "discovery"."local1" to TEMP"2"
end
Ex: Add Thesis Date to Abstract
rule "Primo VE - Lds01"
when
exist "dc"."description.abstract"
then
set TEMP"2" to dc value "dc"."description.abstract"
set TEMP"1" to dc value "dc"."date.created"
remove substring using regex (TEMP"1","(?<=^.{4}).*")
add prefix (TEMP"1","California State University San Bernardino ")
concatenate with delimiter (TEMP"2",TEMP"1"," ")
set "discovery"."local1" to TEMP"2"
end
Add Rules to Tasks, �Tasks to Profile
Add rules to a new Task
FOR TASK LIST, ADD ONE FOR EACH DROOL YOU ARE USING
FOR TASK PARAMETERS, CHOOSE THE DROOL(S) YOU CREATED. ORDER COUNTS!
Add Task to your Import Profile
Step 3: Delivery
LINKING PARAMETERS
Finally: Set the link and its label.�Back at your import profile….
Helpful Non-ExLibris Resources
More resources