Community:NDR/modifyMetadataProvider

From NSDLWiki

Jump to: navigation, search

Contents

[hide]

modifyMetadataProvider

Modify an existing MetadataProvider object (see ObjectTypes) in the NDR.

Request URL

http://ndr.nsdl.org/api/modifyMetadataProvider
Must be an HTTP POST request.

Arguments

  • inputXML (required) - while inputXML is required, no specific element is required for the modifyMetadataProvider request. Only data desired to be added, deleted, or replaced should be included. The inputXML may lack or contain empty <properties>, <relationships> and/or <data> elements.

    • Properties
      • [command] (optional) - see below.
        • setSpec (optional) - if this property is provided (and command is not "delete"), it will replace the previous setSpec in the object. This property must be present in the MetadataProvider object for the NDR's OAI server to expose metadata from this MetadataProvider as an OAI harvestable set. The value must be unique among the NDR's OAI server's setSpecs, and must adhere to the OAI-PMH specification of setSpecs (see the OAI-PMH and its XML schema: http://www.openarchives.org/OAI/openarchivesprotocol.html). To see setSpecs currently in use by the NDR, do a ListSets request of the NDR's OAI server: http://ndr.nsdl.org/oai?verb=ListSets . The NDR will ensure that MetadataProvider objects have no more than one setSpec property.
        • setName (optional) - a short, human-readable description of the objects described by this provision of metadata (e.g. a group of resources), to be available when an OAI-PMH ListSets request is made of the NDR's OAI server. The NDR will ensure that MetadataProvider objects have no more than one setName property.

    • Relationships
      • [command] (strongly recommended, but optional) - best practice is to use only explicit "add" or "delete".
        • metadataProviderFor (optional) - the handle of the Agent responsible for this MetadataProvider. The NDR will ensure that MetadataProvider objects have exactly one metadataProviderFor relationship.
        • aggregatedBy (optional) - the handle of the Aggregator object representing a grouping of objects which the provided metadata will describe. The NDR will ensure that MetadataProvider objects have no more than one aggregatedBy relationship.

    • Datastreams
      • [command] (optional) - see below.
        • serviceDescription (optional) - If the command is "replace", the serviceDescription provided here will replace the existing serviceDescription in the MetadataProvider object. The NDR will ensure that MetadataProvider objects have exactly one serviceDescription datastream. If a serviceDescription is present, the following elements are required or optional as indicated.
          • dc:title (required) - a short name for the MetadataProvider (a few words).
          • dc:description (required) - a description of the MetadataProvider.
          • dc:identifier (optional) - a URL appropriate to the MetadataProvider (e.g. the baseURL for an OAI data provider).
          • image (optional) - a brand image to be associated with the MetadataProvider. If a brand image is included, all four fields below must be present.
            • brandURL - the URL from which the image can be uploaded. This should resolve to just the image itself, not to a page with a link to the image or to a page with the image as well as other information. The image must be of type jpg, gif or png. See http://metamanagement.comm.nsdlib.org/brandGuidelines.html.
            • title - text to be displayed if a web client doesn't display the image.
            • width - the width of the image, in pixels. Per the guidelines, the image must not be wider than 100 pixels.
            • height - the height of the image, in pixels. Per the guidelines, the image must not be taller than 30 pixels.
          • contacts (optional) - contact information to be associated with this MetadataProvider. While contact information is optional, it's very helpful to us if it is included.
            • contact - Each contact listed must include <name> and <email>, but the <info> element is optional.
              • name - the name of the person, entity or organization.
              • email - email address for the person, entity or organization
              • info - may contain additional information about the contact, such as "OAI administrator," "project lead," "technical", "metadata," etc.


where [command] is one of:

  • add - add the contained properties, relationships or datastreams to the object.
  • delete - remove the contained properties, relationships or datastreams from the object.
  • modify (default) - if the contained properties, relationships or datastreams already exist in the object, replace them with what is contained here. If the contained properties, relationships or datastreams do NOT exist in the object, add them.


Below is example inputXML for a MetadataProvider object to be modified. The object's existing setName property will be replaced with the value indicated below. The serviceDescription in the request below will replace the existing service description in this MetadataProvider object.
<?xml version="1.0" encoding="UTF-8"?>
<inputXML 
    xmlns="http://ns.nsdl.org/ndr/request_v1.00/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://ns.nsdl.org/ndr/request_v1.00/ http://ns.nsdl.org/schemas/ndr/request_v1.00.xsd" 
    schemaVersion="1.00.000">
  <metadataProvider>
    <properties>
      <modify>
        <setName>Get Your Rocks Off My Rocks Collection</setName>
      </modify>
    </properties>
    <data>
      <serviceDescription xmlns:dc="http://purl.org/dc/elements/1.1/">
        <dc:title>metadataProvider for rocks on rocks</dc:title>
        <dc:description>A collection of metadata provided by me</dc:description>
        <contacts>
          <contact>
            <name>Peter Parker</name>
            <email>pparker@dailyplanet.com</email>
            <info>newspaperman</info>
          </contact>
        </contacts>
      </serviceDescription>
    </data>
  </metadataProvider>
</inputXML>
Note that an XML schema for the dc namespace (http://purl.org/dc/elements/1.1/) will be imported as part of the inputXML schema.
See also AddMetadataProvider.

Response Fields

  • handle - the handle for the new Aggregator object

Response Example

<?xml version="1.0" encoding="UTF-8"?>
<NSDLDataRepository 
    schemaVersion="1.00.000" 
    xmlns="http://ns.nsdl.org/ndr/response_v1.00/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://ns.nsdl.org/ndr/response_v1.00/ http://ns.nsdl.org/schemas/ndr/response_v1.00.xsd">
  <responseTime>2006-04-10T18:07:53Z</responseTime>
  <requestURL>http://ndr.nsdl.org/api/modifyMetadataProvider/2200/200504201223123T</requestURL>
  <resultData>
    <handle>2200/200504201223123T</handle>
  </resultData>
</NSDLDataRepository>

API Links:

Personal tools