Community:NDR/addAgent

From NSDLWiki

Jump to: navigation, search

Contents

[hide]

NDR API Documentation - addAgent

Create an Agent object (see ObjectTypes) in the NDR.

Request URL

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

Arguments

  • inputXML (required) - descriptive and contact information about an Agent.
    • Properties
      • identifier (required) - a unique identifier for the Agent. The type attribute currently must be "URL", "HOST", or "OTHER" (upper case required); URL identifiers should be used whenever possible.
    • Relationships
      • memberOf (optional) - the handle of any Aggregator objects of which this Agent is a member.
    • Datastreams
      • (DC metadata) (required) - authoritative simple Dublin Core XML metadata about the agent. The metadata provided should be as complete as possible including information such as description, title (e.g. "Cornell Lab of Ornithology"), subject. Metadata must be compliant with the XML schema provided by the Open Archives Initiative at http://www.openarchives.org/OAI/2.0/oai_dc.xsd. The dc and oai_dc namespaces must be indicated, as well as the schema location for oai_dc. See the example below.

InputXML Example

Below is example inputXML for an Agent object to be added to the NDR. Note that the command is understood to be "add" (rather than "replace" or "delete") so the inputXML does not require a command as the first child of the <properties>, <relationships>, or <data> elements.
<?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">
  <agent>
    <properties>
      <identifier type="URL">http://www.stuffonmycat.com</identifier>
    </properties>
    <data>
      <DC>
        <oai_dc:dc 
             xmlns:dc="http://purl.org/dc/elements/1.1/" 
             xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"  
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
          <dc:title>Agent for stuffonmycat.com</dc:title>
          <dc:description>The stuffonmycat organization is responsible for http://www.stuffonmycat.com content.</dc:description>
          <dc:subject>pure silliness</dc:subject>
        </oai_dc:dc>
      </DC>
    </data>
  </agent>
</inputXML>


Response Fields

  • handle – an externally resolvable identifier for the new Agent object. All Agent objects receive a handle reference when created in the NDR.
  • handleURL – a permanent URL to an XML representation of the Agent object in the NDR.

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/addAgent</requestURL>
  <resultData>
    <handle>2200/20060410173455215T</handle>
    <handleURL>http://ndr.nsdl.org/api/describe/2200/20060410173455215T</handleURL>
  </resultData>
</NSDLDataRepository>

API Links:

Personal tools