PronomStubCode

From PreservWiki

(Difference between revisions)
Jump to: navigation, search
m
Line 14: Line 14:
The Preservation Planning interface will provide the following new features:
The Preservation Planning interface will provide the following new features:
 +
 +
== getFormatRisk ==
 +
getFormatRisk returns the risk value for the file format. This is based upon the values that are selected for the inherent properties of the file format. Every File Format has the following inherent properties:
 +
 +
*1000 Ubiquity
 +
*1001 Support
 +
*1002 Disclosure
 +
*1003 Document Quality
 +
*1004 Stability
 +
*1005 Ease of Identification
 +
*1006 Ease of validation
 +
*1007 Lossiness
 +
*1008 Intellectual property rights
 +
*1009 Complexity
 +
 +
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
 +
 +
POST /pronom/preservationplanning.asmx HTTP/1.1
 +
Host: pronom.gsi.local
 +
Content-Type: text/xml; charset=utf-8
 +
Content-Length: length
 +
SOAPAction: "http://pp.pronom.nationalarchives.gov.uk/getFormatRiskIn"
 +
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 +
<soap:Body>
 +
<PUID xmlns="http://pp.pronom.nationalarchives.gov.uk">
 +
<Value>PUID (see below)</Value>
 +
</PUID>
 +
</soap:Body>
 +
</soap:Envelope>
 +
 +
HTTP/1.1 200 OK
 +
Content-Type: text/xml; charset=utf-8
 +
Content-Length: length
 +
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 +
<soap:Body>
 +
<FormatRisk xmlns="http://pp.pronom.nationalarchives.gov.uk">
 +
<risk>double (between 100 and 3000)</risk>
 +
</FormatRisk>
 +
</soap:Body>
 +
</soap:Envelope>
 +
 +
== getFormatPropertyRisk ==
 +
Returns the inherent property risk for a given format's property value
 +
 +
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
 +
The risk value will be returned for the inherent property for the file format specified in the PUID. If no option is selected for the inherent property for the file format, 0 will be returned. Otherwise, with the current values in the registry, values from 10 to 300 will be returned.
 +
 +
POST /pronom/preservationplanning.asmx HTTP/1.1
 +
Host: pronom.gsi.local
 +
Content-Type: text/xml; charset=utf-8
 +
Content-Length: length
 +
SOAPAction: "http://pp.pronom.nationalarchives.gov.uk/getFormatPropertyRiskIn"
 +
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 +
<soap:Body>
 +
<FormatPropertyPair xmlns="http://pp.pronom.nationalarchives.gov.uk">
 +
<propertyID>int value (see property list in previous section)</propertyID>
 +
<PUID>string (see below)</PUID>
 +
</FormatPropertyPair>
 +
</soap:Body>
 +
</soap:Envelope>
 +
 +
HTTP/1.1 200 OK
 +
Content-Type: text/xml; charset=utf-8
 +
Content-Length: length
 +
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 +
<soap:Body>
 +
<FormatPropertyRisk xmlns="http://pp.pronom.nationalarchives.gov.uk">
 +
<risk>double (between 10 and 300)</risk>
 +
</FormatPropertyRisk>
 +
</soap:Body>
 +
</soap:Envelope>
 +
 +
= Valid PUID Strings =
 +
 +
An example of valid entries for the PUID is fmt/10 or x-chr/1 or sfw/3. The format is PUID_CODE/PUID_NUMBER where PUID_CODE is one of:
 +
 +
fmt
 +
x-fmt
 +
sfw
 +
x-sfw
 +
hdw
 +
x-hdw
 +
chr
 +
x-chr
 +
cmp
 +
x-cmp
 +
 +
and the PUID_NUMBER is an integer identifying an individual item.

Revision as of 11:18, 3 July 2008

This small tool provides a stub which can be used to validate code which wants to use the as yet unreleased functionality in Pronom. It validates your POST request and INPUT document and feeds back the relavent result.

Pronom is invoked by a series of SOAP calls and a nice way to find out how it works is to refer to the documentation for the bits which are available at the following locations:

http://nationalarchives.gov.uk/pronom/servive.asmx

http://nationalarchives.gov.uk/pronom/characterisation.asmx


Coming Soon is a new interface which this code provides a stub for:

http://nationalarchives.gov.uk/pronom/preservationplanning.asmx

The Preservation Planning interface will provide the following new features:

getFormatRisk

getFormatRisk returns the risk value for the file format. This is based upon the values that are selected for the inherent properties of the file format. Every File Format has the following inherent properties:

  • 1000 Ubiquity
  • 1001 Support
  • 1002 Disclosure
  • 1003 Document Quality
  • 1004 Stability
  • 1005 Ease of Identification
  • 1006 Ease of validation
  • 1007 Lossiness
  • 1008 Intellectual property rights
  • 1009 Complexity

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /pronom/preservationplanning.asmx HTTP/1.1
Host: pronom.gsi.local
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://pp.pronom.nationalarchives.gov.uk/getFormatRiskIn"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
   <PUID xmlns="http://pp.pronom.nationalarchives.gov.uk">
     <Value>PUID (see below)</Value>
   </PUID>
 </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
   <FormatRisk xmlns="http://pp.pronom.nationalarchives.gov.uk">
     <risk>double (between 100 and 3000)</risk>
   </FormatRisk>
 </soap:Body>
</soap:Envelope>

getFormatPropertyRisk

Returns the inherent property risk for a given format's property value

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values. The risk value will be returned for the inherent property for the file format specified in the PUID. If no option is selected for the inherent property for the file format, 0 will be returned. Otherwise, with the current values in the registry, values from 10 to 300 will be returned.

POST /pronom/preservationplanning.asmx HTTP/1.1
Host: pronom.gsi.local
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://pp.pronom.nationalarchives.gov.uk/getFormatPropertyRiskIn"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
   <FormatPropertyPair xmlns="http://pp.pronom.nationalarchives.gov.uk">
     <propertyID>int value (see property list in previous section)</propertyID>
     <PUID>string (see below)</PUID>
   </FormatPropertyPair>
 </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
   <FormatPropertyRisk xmlns="http://pp.pronom.nationalarchives.gov.uk">
     <risk>double (between 10 and 300)</risk>
   </FormatPropertyRisk>
 </soap:Body>
</soap:Envelope>

Valid PUID Strings

An example of valid entries for the PUID is fmt/10 or x-chr/1 or sfw/3. The format is PUID_CODE/PUID_NUMBER where PUID_CODE is one of:

fmt       
x-fmt     
sfw       
x-sfw     
hdw       
x-hdw     
chr       
x-chr     
cmp       
x-cmp     

and the PUID_NUMBER is an integer identifying an individual item.

Personal tools