SWORD 2.0 Technical Lead: Richard Jones, Cottage Labs
SWORD 2.0 Community Manager: Stuart Lewis, University of Auckland
SWORD 2.0 Technical Advisory Group
Julie Allinson, University of York
Tim Brody, University of Southampton
David Flanders, JISC
Graham Klyne, University of Oxford
Alister Miles, University of Oxford
Ben O'Steen, Cottage Labs
Mark MacGillivray, Cottage Labs
Rob Sanderson, LANL
Nick Sheppard, Leeds Metropolitan University
Eddie Shin, MediaShelf
Ian Stuart, University of Edinburgh
Ed Summers, Library of Congress
David Tarrant, University of Southampton
Graham Triggs, BioMed Central
Scott Wilson, University of Bolton
Further acknowledgements of input
Aaron Birkland (Cornell University), Tim Donohue (DuraSpace), Jim Downing (University of Cambridge), Ross Gardler (OSS Watch), Steve Midgley (US Department of Education), Glen Robson (National Library of Wales), Peter Sefton (University Of Southern Queensland), Adrian Stevenson (UKOLN), Paul Walk (UKOLN), Nigel Ward (University of Queensland)
The Atom Publishing Protocol [RFC5023] defines how to create a Media Resource by POSTing the media to a server. It deals exclusively with the upload of a single file to the Media Entry, and does not make explicit allowances for the possibility that this file may be a package or bundle of other files in a particular format. This specification covers extensions to the protocol to support this extra condition.
This specification defines a set of extensions to the Atom Publishing Protocol [RFC5023] to support the transfer and recovering of content packages via the standard.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
All extensions are defined within the namespace:
This document uses the prefix sword for the namespace name.
The AtomPub namespace is:
This document uses the prefix app for the namespace name.
The Atom Syndication Format namespace is:
This document uses the prefix atom for the namespace name.
This section documents extensions to the Atom Service Document.
The sword:mediation element MUST be used to determine if a Media Collection will accept the deposit of content on behalf of a user other than the authenticated depositor. If it is not present the client MUST assume that the server does not support such mediated deposit.
Traditional HTTP authentication is often insufficient during packaged content deposit, as it is possible that content will be delivered machine-to- machine and the authenticating user will be the client not the content owner. The presence of the sword:mediation element, which MUST take a true or false value, indicates whether the On-Behalf-Of HTTP header [SWORD001] can be used to provide the server with a user other than the authenticated one who should be considered the actor in the transfer.
For example:
<service xmlns="http://www.w3.org/2007/app" xmlns:sword="http://purl.org/net/sword/terms/" xmlns:atom="http://www.w3.org/2005/Atom"> <workspace> <atom:title>Main Site</atom:title> <collection href="http://www.appserver.org/col1"> <atom:title>Collection 1</atom:title> <accept>*/*</accept> <sword:mediation>true</sword:mediation> </collection> </workspace> </service>
The sword:acceptPackaging element SHOULD be used to indicate to the client what package formats are acceptable to send to the server. If the server does not supply an element, the client MUST assume that the server only supports an ordinary, unstructured zip file. The server MAY unzip any such files, or MAY store them as opaque binary files. The sword:acceptPackaging element MUST contain a URI identifying the packaging format.
For example:
<service xmlns="http://www.w3.org/2007/app" xmlns:sword="http://purl.org/net/sword/terms/" xmlns:atom="http://www.w3.org/2005/Atom"> <workspace> <atom:title>Main Site</atom:title> <collection href="http://www.appserver.org/col1"> <atom:title>Collection 1</atom:title> <accept>*/*</accept> <sword:acceptPackaging> http://purl.org/net/sword/package/BagIt </sword:acceptPackaging> <sword:acceptPackaging> http://purl.org/net/sword/package/METSDSpaceSIP </sword:acceptPackaging> </collection> </workspace> </service>
This section documents extensions to the Media Entry document which can be retrieved from the server from the Media Entry URI.
The sword:packaging element SHOULD be used by the server to indicate the packaging formats that it is capable of delivering the Media Resource to the client in. If there is no sword:packaging element, the client MUST NOT assume any packaging format; instead it must rely on the atom:content@type as normal, per [RFC5023]. If a sword:packaging element is provided the client MAY request the atom:content@src URI with the Packaging HTTP header [SWORD001] containing the value of the sword:packaging element.
The value of the sword:packaging element MUST contain a URI identifying the packaging format.
For example:
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sword="http://purl.org/net/sword/"> <title>My Deposit</title> <id>info:something:1</id> <updated>2008-08-18T14:27:08Z</updated> <author><name>jbloggs</name></author> <summary type="text">A summary</summary> <generator uri="http://www.appserver.org/engine" version="1.0"/> <content type="application/zip" src="http://www.appserver.org/col1/deposit1.zip"/> <sword:packaging> http://purl.org/net/sword/package/METSDSpaceSIP </sword:packaging> <link rel="edit" href="http://www.appserver.org/col1/my_deposit.atom" /> </entry>
A walkthrough of the process of delivering and retrieving packaged content with a combination of the extensions described in this specification and those detailed in [SWORD001].
The client requests the Service Document from the server, which contains the sword:mediation and sword:acceptPackaging elements. If the sword:mediation element is present and set to true this tells the client that it can use the On-Behalf-Of HTTP header [SWORD001] when delivering the packaged content. The sword:acceptPackaging header tells the client what packaging formats it can use to deliver that content.
<service xmlns="http://www.w3.org/2007/app" xmlns:sword="http://purl.org/net/sword/terms/" xmlns:atom="http://www.w3.org/2005/Atom"> <workspace> <atom:title>Main Site</atom:title> <collection href="http://www.appserver.org/col1"> <atom:title>Collection 1</atom:title> <accept>application/zip</accept> <sword:mediation>true</sword:mediation> <sword:acceptPackaging> http://purl.org/net/sword/package/BagIt </sword:acceptPackaging> </collection> </workspace> </service>
The client constructs a content package which meets the criteria laid out in the app:accept and sword:acceptPackaging headers in the Service Document; for example an application/zip BagIt packaged file. This is delivered to the server as a standard POST of a Media Resource:
POST /col1 HTTP/1.1 On-Behalf-Of: jbloggs Packaging: http://purl.org/net/sword/package/BagIt Content-Type: application/zip
The response to this MUST be as laid out in [SWORD001]
The supported formats for retrieval are listed in the Media Entry document in the sword:packaging element. The client can retrieve this document from the Media Entry URI, and discover the URI for the content of the Media Resource and the supported package formats.
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:sword="http://purl.org/net/sword/"> <title>My Deposit</title> <id>info:something:1</id> <updated>2008-08-18T14:27:08Z</updated> <author><name>jbloggs</name></author> <summary type="text">A summary</summary> <generator uri="http://www.appserver.org/engine" version="1.0"/> <content type="application/zip" src="http://www.appserver.org/col1/deposit1.zip"/> <sword:packaging> http://purl.org/net/sword/package/BagIt </sword:packaging> <sword:packaging> http://purl.org/net/sword/package/METSDSpaceSIP </sword:packaging> <link rel="edit" href="http://www.appserver.org/col1/my_deposit.atom" /> </entry>
The presence of one or more sword:packaging elements tells the user agent that it can request the Media Resource using the Packaging HTTP header [SWORD001] to indicate its desired format.
The client issues an HTTP GET request on the Media Resource URI and specifies the Packaging HTTP header [SWORD001], as follows:
GET /col1/deposit1.zip HTTP/1.1 Packaging: http://purl.org/net/sword/package/BagIt
The server returns the Media Resource packaged as a BagIt zip file. If the server does not support the requested format it MUST respond as described in [SWORD001].
[RFC2119] S. Bradner, "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2616] R. Fielding, UC Irvine, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, T. Berners-Lee "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC5023] Gregorio, J. and B. de hOra, "The Atom Publishing Protocol", RFC 5023, October 2007.
[SWORD001] Jones, R, "Packaged Content Delivery over HTTP", Internet- Draft, February 2011
Copyright (C) SWORD (2011). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to SWORD, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by SWORD or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and SWORD DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.