Skip to content
Kirk Wang edited this page Oct 1, 2024 · 1 revision

Valkyrized Implementation

This gem is different from the legacy version in that all the calls have been changed to support Hyrax Valkyrie.


Admin Sets and Collections

When getting the service document with

/sword/service_document
Example: https://hyrax.digitalnest.co.uk/sword/service_document

the user should only see Admin Sets and Collections that they have access to.

Example:
<service xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:sword="http://purl.org/net/sword/terms/" xmlns="http://www.w3.org/2007/app">
  <sword:version>2.0</sword:version>
  <workspace collections="8">
    <atom:title>Hyrax Sword V2 server</atom:title>
    <collection href="http://dev.hyku.test/sword/collections/0328531d-18d2-474c-a8ec-4cd6e052d519">
      <atom:title>Default Admin Set</atom:title>
      <type>AdminSet</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
    <collection href="http://dev.hyku.test/sword/collections/9991b5a2-0be4-48bb-80d2-a3632cde9a1a">
      <atom:title>Kirk's Admin Set</atom:title>
      <type>AdminSet</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
    <collection href="http://dev.hyku.test/sword/collections/be83f0ab-f9ec-4c65-a78f-16c97e894246">
      <atom:title>Test Collection</atom:title>
      <type>Collection</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
    <collection href="http://dev.hyku.test/sword/collections/3cc01693-7fd1-4dd8-b0ed-02c7ea1cbffa">
      <atom:title>Third time's the charm</atom:title>
      <type>Collection</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
    <collection href="http://dev.hyku.test/sword/collections/6456c282-29db-4422-bf5e-9b07481f479d">
      <atom:title>Another collection</atom:title>
      <type>Collection</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
    <collection href="http://dev.hyku.test/sword/collections/4d671bbf-39cd-42b3-8dd1-302d280cbcd4">
      <atom:title>4 score</atom:title>
      <type>Collection</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
    <collection href="http://dev.hyku.test/sword/collections/a4369000-a966-4bfd-86af-8988fb10da94">
      <atom:title>Pick up sticks</atom:title>
      <type>Collection</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
    <collection href="http://dev.hyku.test/sword/collections/e032ab57-a16d-45c7-bc5b-26448e8b71ea">
      <atom:title>High 5</atom:title>
      <type>Collection</type>
      <accept>*/*</accept>
      <accept alternate="multipart-related">
*/*      </accept>
      <sword:collectionPolicy>TODO: Collection Policy</sword:collectionPolicy>
      <dcterms:abstract></dcterms:abstract>
      <sword:mediation>true</sword:mediation>
      <sword:treatment>TODO: Treatment description</sword:treatment>
      <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/BagIt</sword:acceptPackaging>
      <sword:acceptPackaging>http://purl.org/net/sword/package/Binary</sword:acceptPackaging>
    </collection>
  </workspace>
</service>

NOTE: The <type> tag was added to help users differentiate between Admin Sets and Collections.

Metadata

Anything the user can set in the UI should be settable through the API.

Example of an xml payload:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <title>Test record</title>
  <creator>User, Some</creator>
  <subject>Sword</subject>
  <subject>Crosswalk</subject>
  <description>This is a test to create a test record for Hyku Commons</description>
  <publisher>Digital Nest</publisher>
  <contributor>The dublin core generator</contributor>
  <date_created>05/29/2024</date_created>
  <audience>Student</audience>
  <education_level>Community college / Lower division</education_level>
  <learning_resource_type>Activity/lab</learning_resource_type>
  <discipline>Languages - Spanish</discipline>
  <source>http://sword.digitalnest.com</source>
  <language>English</language>
  <rights_statement>http://rightsstatements.org/vocab/InC/1.0/</rights_statement>
  <resource_type>Article</resource_type>
  <keyword>Test</keyword>
  <keyword>Another</keyword>
  <visibility>lease</visibility>
  <visibility_during_lease>authenticated</visibility_during_lease>
  <lease_expiration_date>2025-05-31</lease_expiration_date>
  <visibility_after_lease>restricted</visibility_after_lease>
  <member_of_collection_ids>a4369000-a966-4bfd-86af-8988fb10da94</member_of_collection_ids>
  <member_of_collection_ids>e032ab57-a16d-45c7-bc5b-26448e8b71ea</member_of_collection_ids>
  <admin_set_id>9991b5a2-0be4-48bb-80d2-a3632cde9a1a</admin_set_id>
</metadata>

Note: Instead of using dc:<term>, this gem uses the properties of the work type.

If using lease, the following need to be filled out for it to work properly:

  <visibility>lease</visibility>
  <visibility_during_lease>authenticated</visibility_during_lease>
  <lease_expiration_date>2025-05-31</lease_expiration_date>
  <visibility_after_lease>restricted</visibility_after_lease>

Likewise with embargo:

  <visibility>embargo</visibility>
  <visibility_during_embargo>restricted</visibility_during_embargo>
  <embargo_release_date>2025-05-31</embargo_release_date>
  <visibility_after_embargo>open</visibility_after_embargo>

The <member_of_collection_ids> tag is how you can deposit your record into a collection. Use the service document the find the ID. Likewise, the <admin_set_id> tag is how you can deposit to an admin set.

Clone this wiki locally