TNS Internal:NDR/API/2.0/specification/addMetadataRecord
From NSDLWiki
< TNS Internal:NDR | API | 2.0
| NDR Project Documentation | Conceptual Framework | v1.0 NDR-API Index | v2.0 NDR-API Index | Model |
Under Construction
Proposed method for inclusion in NDR/API 2.x.
- Please provide feedback and comments in the NSDL Data Repository (NDR) API 2.0 Forum of the NSDL Community Forums.
NDR API Documentation - addMetadataRecord
Create a metadata record about a resource. If the resource is not already registered in the NDR, it will be registered as part of the add metadata record process.
Request URL
- http://ndr.nsdlib.org/api/addMetadataRecord
- Must be an HTTP POST request.
Arguments
Structure of input:
- inputXML (required)
- collection (required) - the externally resolvable identifier (handle) of the collection (returned by addCollection).
- metadataXML (required) - metadata in the format specified by the XMLFormat parameter
- XMLFormat (required) - id of the format of metadataXML NOTE: requires registration in advance
- resourceURL (required) - URL to a web resource
- externalIdentifier (optional) - application specific identifier that can be stored to facilitate retrieval by applications
InputXML Example
Below is example inputXML for adding a metadata record about a resource to the NDR.
<?xml version="1.0" encoding="UTF-8"?>
<inputXML
xmlns="http://ns.nsdlib.org/ndr/request_v2.00/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.nsdlib.org/ndr/request_v2.00/ http://ns.nsdlib.org/schemas/ndr/request_v2.00.xsd"
schemaVersion="1.00.000">
<collection>2200/20061212543</collection>
<metadataXML>
<nsdl_dc:nsdl_dc
xmlns:nsdl_dc="http://ns.nsdl.org/nsdl_dc_v1.02/"
schemaVersion="1.02.000" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.nsdl.org/nsdl_dc_v1.02/ http://ns.nsdl.org/schemas/nsdl_dc/nsdl_dc_v1.02.xsd">
<dc:title>My life: a Monster's Story.</dc:title>
<dc:description>The story of Frankenstein.</dc:description>
<dc:identifier>http://www.frankenstein.org/autobiography</dc:identifier>
<dc:creator>Baron Von Frankenstein</dc:creator>
<dc:author>Mary Shelly</dc:author>
</nsdl_dc:nsdl_dc>
</metadataXML>
<XMLFormat>nsdl_dc</XMLFormat>
<resourceURL>http://stuffonmycat.com/</resourceURL>
<externalIdentifier>CLC-000-000-000-097</externalIdentifier>
</inputXML>
Response
Structure of response:
- handle - the externally resolvable identifier for the Metadata. NOTE: All Metadata related API calls that manipulate a specific metadata record expect this handle as a parameter.
- handleURL - the permanent URL to an XML representation of the metadata record in the NDR.
Response Example
Below is an example response for this request.
<?xml version="1.0" encoding="UTF-8"?>
<NSDLDataRepository schemaVersion="1.00.000"
xmlns="http://ns.nsdlib.org/ndr/response_v2.00/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.nsdlib.org/ndr/response_v2.00/ http://ns.nsdlib.org/schemas/ndr/response_v2.00.xsd">
<responseTime>2006-04-10T18:07:53Z</responseTime>
<requestURL>http://ndr.nsdlib.org/api/addMetadataRecord</requestURL>
<resultData>
<handle>2200/20061212656</handle>
<handleURL>http://ndr.nsdlib.org/api/getMetadataRecord/2200/20061212656</handleURL>
<resultData>
</NSDLDataRespository>
API Links:
- Conceptual Framework (2.0 philosophy)
- APIBasics
- ObjectTypes
- Encoding
- APIRequestsByObject v1.0
- APIRequestsAlphabetical v1.0
- APIRequestsByObject v2.0

