-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOW: SWORD v2 Integration #1008
Comments
The TOC here could make for a good checklist of expected functionality: |
We can use Hyku up to start development on this, while pals knapsack is still underway. |
For ref, this is the gem we would essentially be updating https://github.com/CottageLabs/willow_sword |
TODO: Test - how do we handle different tenants? |
|
Contribute bulkrax x embargo back to hyku ref: - samvera/bulkrax@855ce39 Issue: - scientist-softserv/palni-palci#1008
Can we add this list to the acceptance criteria for clarity of expected functionality? https://github.com/CottageLabs/willow_sword/wiki/Usage#contents |
Tested functionalities on staging, here are the results Files used: files_for_testing_willow_sword.zip 1. Get service documentcurl --request GET \
--url https://demo.palni-palci-staging.notch8.cloud/sword/service_document \
--header 'Api-key: some-api-key' \
--header 'Content-Type: application/xml' response: <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="1">
<atom:title>Hyrax Sword V2 server</atom:title>
<collection href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default">
<atom:title>Default collection</atom:title>
<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> 2. Get collectioncurl --request GET \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/36b01b98-de55-4cf1-9328-f53c4ca05dd0 \
--header 'Api-key: some-api-key' \
--header 'Content-Type: application/xml' response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Kirk's Collection</title>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/36b01b98-de55-4cf1-9328-f53c4ca05dd0/works"/>
</feed> 3. Add New work: metadata onlyi. Add new work: Metadata only (binary)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works \
--header 'Api-key: some-api-key' \
--header 'Content-Disposition: attachment; filename=metadata.xml' \
--header 'Content-Type: application/xml' \
--header 'In-Progress: false' \
--header 'On-Behalf-Of: [email protected]' \
--header 'Packaging: application/atom+xml;type=entry' \
--data-binary @dc.xml response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works//file_sets"/>
</feed> 3. Add New work: metadata onlyii. Add new work: Metadata only (form-data)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works \
--header 'Api-key: some-api-key' \
--header 'In-Progress: false' \
--header 'On-Behalf-Of: [email protected]' \
-F [email protected] response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works//file_sets"/>
</feed> 4. Add new work: Zip file with metadata and filei. Add new work: Zip file with metadata and file (binary)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/ \
--header 'Api-key: some-api-key' \
--header 'Content-Disposition: attachment; filename=testPackage.zip' \
--header 'Content-Type: application/zip' \
--header 'In-Progress: false' \
--header 'On-Behalf-Of: [email protected]' \
--header 'Packaging: http://purl.org/net/sword/package/BagIt' \
--data-binary @testPackage.zip response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works//file_sets"/>
</feed> 4. Add new work: Zip file with metadata and fileii. Add new work: metadata and zip payload (form-data)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/ \
--header 'Api-key: some-api-key' \
--header 'In-Progress: false' \
--header 'On-Behalf-Of: [email protected]' \
-F metadata=@testPackage2b/metadata/metadata.xml \
-F [email protected] response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works//file_sets"/>
</feed> 4. Add new work: Zip file with metadata and fileiii. Add new work: zip payload with file and metadata (form-data)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/ \
--header 'Api-key: some-api-key' \
--header 'In-Progress: false' \
--header 'On-Behalf-Of: [email protected]' \
-F [email protected] response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works//file_sets"/>
</feed> 5. Add new work: Metadata and file in bagit zip filei. Add new work: Metadata and file in bagit zip file (binary)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/ \
--header 'Api-key: some-api-key' \
--header 'Content-Disposition: attachment; filename=testPackage1InBagit.zip' \
--header 'Content-MD5: 72722575f682e2b459604db51def039f' \
--header 'Content-Type: application/zip' \
--header 'Packaging: http://purl.org/net/sword/package/BagIt' \
--data-binary @testPackageInBagit.zip response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works//file_sets"/>
</feed> 5. Add new work: Metadata and file in bagit zip fileii. Add new work: payload containing metadata and file in bagit zip (form-data)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/ \
--header 'Api-key: some-api-key' \
--header 'Content-MD5: 72722575f682e2b459604db51def039f' \
--header 'Packaging: http://purl.org/net/sword/package/BagIt' \
-F [email protected] response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works//file_sets"/>
</feed> 6. Get work with only metadatacurl --request GET \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/36425f03-462b-447c-b23c-0b37ab40cc04 \
--header 'Api-key: some-api-key' response: <feed xmlns="http://www.w3.org/2005/Atom" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>test</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/36425f03-462b-447c-b23c-0b37ab40cc04"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/36425f03-462b-447c-b23c-0b37ab40cc04/file_sets"/>
<dc:title>test</dc:title>
<dc:depositor>[email protected]</dc:depositor>
<dc:admin_set_id>5ff17259-9147-43dd-a0b1-ee7aebd0a2fc</dc:admin_set_id>
<dc:member_of_collection_ids>a974a5ee-bc6c-4ea9-87f0-1f92fbd0614f</dc:member_of_collection_ids>
<dc:member_of_collection_ids>f2766aed-8999-47f1-a610-64617e1b3290</dc:member_of_collection_ids>
<dc:creator>0~test</dc:creator>
<dc:keyword>test</dc:keyword>
<dc:rights>http://rightsstatements.org/vocab/NKC/1.0/</dc:rights>
<dc:type>Article</dc:type>
<dc:admin_note></dc:admin_note>
<dc:show_pdf_viewer></dc:show_pdf_viewer>
<dc:show_pdf_download_button></dc:show_pdf_download_button>
<dc:video_embed></dc:video_embed>
</feed> 7. Get work with file and metadatacurl --request GET \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c \
--header 'Api-key: some-api-key' response: <feed xmlns="http://www.w3.org/2005/Atom" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Test record</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets"/>
<entry>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/1d63cd3f-81ef-47c9-8a7e-228c0c200f66"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/1d63cd3f-81ef-47c9-8a7e-228c0c200f66"/>
</entry>
<entry>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/3b8354f2-0338-4e55-82a8-02148ed586bb"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/3b8354f2-0338-4e55-82a8-02148ed586bb"/>
</entry>
<entry>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/8962a3ae-e93a-4b78-bec8-5d1433d10c0d"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/8962a3ae-e93a-4b78-bec8-5d1433d10c0d"/>
</entry>
<dc:title>Test record</dc:title>
<dc:depositor>[email protected]</dc:depositor>
<dc:admin_set_id>5ff17259-9147-43dd-a0b1-ee7aebd0a2fc</dc:admin_set_id>
<dc:member_ids>1d63cd3f-81ef-47c9-8a7e-228c0c200f66</dc:member_ids>
<dc:member_ids>3b8354f2-0338-4e55-82a8-02148ed586bb</dc:member_ids>
<dc:member_ids>8962a3ae-e93a-4b78-bec8-5d1433d10c0d</dc:member_ids>
<dc:representative_id>1d63cd3f-81ef-47c9-8a7e-228c0c200f66</dc:representative_id>
<dc:thumbnail_id>1d63cd3f-81ef-47c9-8a7e-228c0c200f66</dc:thumbnail_id>
<dc:creator>0~User, Some</dc:creator>
<dc:keyword>Test</dc:keyword>
<dc:keyword>Another</dc:keyword>
<dc:rights>http://rightsstatements.org/vocab/InC/1.0/</dc:rights>
<dc:type>Article</dc:type>
<dc:contributor>The dublin core generator</dc:contributor>
<dc:created>05/29/2024</dc:created>
<dc:description>This is a test to create a test record for Hyku Commons</dc:description>
<dc:language>English</dc:language>
<dc:publisher>Digital Nest</dc:publisher>
<dc:source>http://sword.digitalnest.com</dc:source>
<dc:subject>Sword</dc:subject>
<dc:subject>Crosswalk</dc:subject>
<dc:show_pdf_viewer>1</dc:show_pdf_viewer>
<dc:show_pdf_download_button>1</dc:show_pdf_download_button>
</feed> 8. Get work that doesn't existcurl --request GET \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/invalid_id \
--header 'Api-key: some-api-key' response: <sword:error xmlns:sword="http://purl.org/net/sword/" xmlns:arxiv="http://arxiv.org/schemas/atom" xmlns="http://www.w3.org/2005/Atom" href="http://purl.org/net/sword/error/ErrorBadRequest">
<author>
<name>Sword v2 server</name>
</author>
<title>ERROR</title>
<updated>2024-05-31T16:28:20Z</updated>
<generator uri="https://example.org/sword-app/" version="0.1">
[email protected] </generator>
<summary>Server cannot find work with id invalid_id</summary>
<sword:treatment>processing failed</sword:treatment>
</sword:error> 9. Get file metadatacurl --request GET \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/395282cb-830e-42d3-ad6d-cf8b7bde326b \
--header 'Api-key: some-api-key' response: <feed xmlns="http://www.w3.org/2005/Atom" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Swordv2Spec.pdf</title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/395282cb-830e-42d3-ad6d-cf8b7bde326b"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/395282cb-830e-42d3-ad6d-cf8b7bde326b"/>
<dc:title>Swordv2Spec.pdf</dc:title>
<dc:creator>[email protected]</dc:creator>
</feed> 10. Add file to existing work (binary)curl --request POST \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/ \
--header 'Api-key: some-api-key' \
--header 'Content-Disposition: attachment; filename=cat_scan.pdf' \
--header 'Content-MD5: b89d04a5afefdfe3ee11a9de8b230320' \
--header 'Content-Type: application/pdf' \
--header 'In-Progress: false' \
--header 'On-Behalf-Of: [email protected]' \
--header 'Packaging: http://purl.org/net/sword/package/Binary' \
--data-binary @cat_scan.pdf response: <feed xmlns="http://www.w3.org/2005/Atom">
<title></title>
<content rel="src" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/30d666fd-5a74-416a-8172-f4c9612bcad1"/>
<link rel="edit" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/30d666fd-5a74-416a-8172-f4c9612bcad1"/>
</feed> 11. Update file metadata (binary)curl --request PUT \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/file_sets/395282cb-830e-42d3-ad6d-cf8b7bde326b \
--header 'Api-key: some-api-key' \
--header 'Content-Disposition: attachment; filename=metadata.xml' \
--header 'Content-Type: application/xml' \
--header 'Packaging: application/atom+xml;type=entry' \
--data-binary @file_dc.xml No reponse 12. Authorizing sword requests (Currently not implemented)13. Update workcurl --request PUT \
--url https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c/ \
--header 'Api-key: some-api-key' \
--header 'Content-Disposition: attachment; filename=metadata.xml' \
--header 'Content-Type: application/xml' \
--header 'Packaging: application/atom+xml;type=entry' \
--data-binary @updated_work_dc.xml response: <feed xmlns="http://www.w3.org/2005/Atom">
<title>Update Success</title>
<updated>2024-05-31T16:40:30+00:00</updated>
<atom:title>Hyrax Sword V2 server</atom:title>
<link rel="self" href="https://demo.palni-palci-staging.notch8.cloud/sword/collections/default/works/09d32f64-8a1c-424b-9320-ff46f63faf0c"/>
<entry>
<id>09d32f64-8a1c-424b-9320-ff46f63faf0c</id>
<title>Updated Test record</title>
<content type="text">
<text>The work has been successfully updated.</text>
</content>
<updated>2024-05-31T16:33:55Z</updated>
</entry>
</feed> |
@Jill Is sharing the gem's wiki enough? scientist-softserv/amigos#29 one difference is that Hyku is not limited to dc terms. |
Summary
SOW
SoftServ will integrate SWORD v2, a protocol which enables clients and servers to communicate around complex digital objects, into the Hyku application. Although there is precedent for SWORD integration into Hyrax, it was developed and documented for Hyrax 2. Since the current version of Hyku runs on a later version of Hyrax, custom work will be required. This is especially so considering the Valkyrie migration from Fedora.
SoftServ’s approach to this will be to update the existing or create a new SWORD gem that would be both applicable to Hyku Commons as well as broadly usable for Hyrax and Hyku applications.
SoftServ allocates one 1-week sprint (apprx. 90 hours) including one midlevel and one senior engineer, project management, and QA resources to accomplish these goals.
Acceptance Criteria
Ref
willow_sword
#1012willow_sword
#1013willow_sword
functionality #1014Testing Instructions
These are a summary of the instructions found in the wiki: https://github.com/CottageLabs/willow_sword/wiki/Usage
Adjust URL to match your set up.
Test files:
swordv2_test_files.zip
Unzip the test files into a directory. Open a terminal from that directory and run the following commands:
1. Get service document
2. Get collection
3. Add New work: metadata only
i. Add new work: Metadata only (binary)
3. Add New work: metadata only
ii. Add new work: Metadata only (form-data)
4. Add new work: Zip file with metadata and file
i. Add new work: Zip file with metadata and file (binary)
4. Add new work: Zip file with metadata and file
ii. Add new work: metadata and zip payload (form-data)
4. Add new work: Zip file with metadata and file
iii. Add new work: zip payload with file and metadata (form-data)
5. Add new work: Metadata and file in bagit zip file
i. Add new work: Metadata and file in bagit zip file (binary)
5. Add new work: Metadata and file in bagit zip file
ii. Add new work: payload containing metadata and file in bagit zip (form-data)
6. Get work with only metadata
7. Get work with file and metadata
8. Get work that doesn't exist
9. Get file metadata
10. Add file to existing work (binary)
11. Update file metadata (binary)
12. Authorizing sword requests (Currently not implemented)
13. Update work
The text was updated successfully, but these errors were encountered: