TNS Internal:NDR/API/2.0/specification/listResourceMetadata

From NSDLWiki

Jump to: navigation, search


 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.0.

Please provide feedback and comments in the NSDL Data Repository (NDR) API 2.0 Forum of the NSDL Community Forums.


NDR API Documentation - listResourceMetadata

List resources and related metadata and annotations.



Request URL

http://ndr.nsdlib.org/api/listResourceMetadata/[handle]?XMLFormat=[XMLFormat]&pageSize=[pageSize]
where [handle][XMLFormat], and [pageSize] are defined in the Arguments section.
May be an HTTP GET or POST request.


Arguments

Parameters on Request URL:

  • [handle] (optional) - the externally resolvable identifier of a collection (returned by addCollection). NOTE: If passed in, resources are limited to those in the specified collection; otherwise, all resources are returned.
  • [XMLFormat] (optional) - id of the format in which the metadata will be returned transforming if necessary (defaults to native format passed in during addMetadataRecord) NOTE: requires registration of transform in advance
  • [pageSize] (optional) - number of records to return at a time. If smaller than that total number of matching records, a resumption token will be provided.



Request URL Example

Below is an example of a request URL for resources and related metadata and annotations.

http://ndr.nsdlib.org/api/listResourceMetadata/2200/20061212543?XMLFormat=nsdl_dc&pageSize=100




Response

Structure of response:

  • additional primary elements
    • resumptionToken - used to get the next page of records NOTE: empty if this is the last page
    • currentPage - page count of the current set of returned records
    • recordsInCurrentPage - count of the number of records returned in this page
    • totalNumberOfPages - number of pages holding all records matching the request
    • totalNumberOfRecords - total number of records matching the request
  • for each resource
    • header
    • resourceURL - URL to the web resource
      • handle - the externally resolvable identifier for the Resource.
      • handleURL - the permanent URL to an XML representation of the resource in the NDR.
      • contentType - mimetype of internally stored content NOTE: Not specified for external content.
    • annotatedBy - annotations for the resource
    • cataloguedBy
      • for each metadata record
        • header
          • handle - the externally resolvable identifier for the Metadata.
          • handleURL - the permanent URL to an XML representation of the metadata record in the NDR.
          • externalIdentifier - application specific identifier that can be stored to facilitate retrieval by applications
          • XMLFormat - id of the format of the returned metadata
          • collectionName - name of the collection that holds this metadata record
          • collectionHandle - the externally resolvable identifier for the Collection
          • agentName - name of the agent application responsible for the Collection that holds this metadata record
          • agentHandle - the externally resolvable identifier for the Agent
        • metadataXML - the metadata record in the requested format
        • annotatedBy - annotations for the metadata record


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/listResourceMetadata/[handle]?XMLFormat=[XMLFormat]&pageSize=[pageSize]</requestURL>
  <resumptionToken>http://ndr.nsdlib.org/api/listResourceMetadata/2200/20061212543?XMLFormat=nsdl_dc&pageSize=2&page=4</resumptionToken>
  <currentPage>3</currentPage>
  <recordsInCurrentPage>2</recordsInCurrentPage>
  <totalNumberOfPages>29</totalNumberOfPages>
  <totalNumberOfRecords>57</totalNumberOfRecords>
  <resultData>
    <record>
      <header>
        <resourceURL>http://www.frankenstein.org/autobiography</resourceURL>
        <handle>2200/20061643458</handle>
        <handleURL>http://ndr.nsdl.org/api/getResourceMetadata/2200/20061643458</handleURL>
      </header>
      <annotatedBy />
      <cataloguedBy>
        <record>
          <header>
            <handle>2200/20061212656</handle>
            <handleURL>http://ndr.nsdl.org/api/getMetadataRecord/2200/20061212656</handleURL>
            <externalIdentifier>SSC-000-000-000-061</externalIdentifier>
            <XMLFormat>nsdl_dc</XMLFormat>
            <collectionName>Spooky Stuff Collaborative</collectionName>
            <collectionHandle>2200/20061258472</collectionHandle>
            <agentName>NCS</agentName>
            <agentHandle>2200/20061857483</agentHandle>
          </header>
          <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>
          <annotatedBy>
            <record>
              <header>
                <handle>2200/20061293832</handle>
                <handleURL>http://ndr.nsdl.org/api/getAnnotationRecord/2200/20061293832</handleURL>
                <externalIdentifier>SSC-000-000-000-063</externalIdentifier>
                <XMLFormat>nsdl_anno</XMLFormat>
                <collectionName>Spooky Stuff Collaborative</collectionName>
                <collectionHandle>2200/20061258472</collectionHandle>
                <agentName>NCS</agentName>
                <agentHandle>2200/20061857483</agentHandle>
              </header>
              <annotationXML>
                <nsdl_anno:nsdl_anno>
                  <title>Annotations for Global Sun Temperature Project</title> 
                  <date created="2004-11-24"/>
                  <text type="Comment">This resource provides pedagogical 
                    insight concerning learners' pre-conceptions and 
                    misconceptions about the moon's phases and the 
                    seasons.</text> 
                  <rating min="1" max="10">5</rating> 
                </nsdl_anno:nsdl_anno>   
              </annotationXML>
            </record>
          </annotatedBy>
        </record>
        <record>
          <header>
            <handle>2200/20061293824</handle>
            <handleURL>http://ndr.nsdl.org/api/getMetadataRecord/2200/20061293824</handleURL>
            <externalIdentifier>GST-000-000-000-062</externalIdentifier>
            <XMLFormat>nsdl_dc</XMLFormat>
            <collectionName>Ghost Stories and Other Tales</collectionName>
            <collectionHandle>2200/20061258472</collectionHandle>
            <agentName>NCS</agentName>
            <agentHandle>2200/20061857483</agentHandle>
          </header>
          <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 as told by Frankenstein himself.</dc:description> 
              <dc:identifier>http://www.frankenstein.org/autobiography</dc:identifier> 
              <dc:creator>Baron Von Frankenstein</dc:creator> 
            </nsdl_dc:nsdl_dc>   
          </metadataXML>
          <annotatedBy />
        </record>
      </cataloguedBy>
    </record>
    <record>
      <header>
        <resourceURL>http://mycatstuff.com/</resourceURL>
        <handle>2200/20061698994</handle>
        <handleURL>http://ndr.nsdl.org/api/getResourceMetadata/2200/20061698994</handleURL>
      </header>
      <annotatedBy />
      <cataloguedBy>
        <record>
          <header>
            <handle>2200/20061299843</handle>
            <handleURL>http://ndr.nsdl.org/api/getMetadataRecord/2200/20061299843</handleURL>
            <externalIdentifier>FCO-000-000-000-054</externalIdentifier>
            <XMLFormat>nsdl_dc</XMLFormat>
            <collectionName>Feline Collaborative</collectionName>
            <collectionHandle>2200/20061258472</collectionHandle>
            <agentName>NCS</agentName>
            <agentHandle>2200/20061857483</agentHandle>
          </header>
          <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>Brushing a Fluffy Kitty: Important Techniques</dc:title> 
              <dc:description>Taking care of fluffy kitties.</dc:description> 
              <dc:identifier>http://mycatstuff.com</dc:identifier> 
              <dc:creator>Meo W. Feline</dc:creator> 
              <dc:author>Sarah Jane</dc:author> 
            </nsdl_dc:nsdl_dc>   
          </metadataXML>
          <annotatedBy/>
        </record>
        <record>
          <header>
            <handle>2200/20064334529</handle>
            <handleURL>http://ndr.nsdl.org/api/getMetadataRecord/2200/20064334529</handleURL>
            <externalIdentifier>CCH-000-000-000-055</externalIdentifier>
            <XMLFormat>nsdl_dc</XMLFormat>
            <collectionName>Cat Care and Health</collectionName>
            <collectionHandle>2200/20061258472</collectionHandle>
            <agentName>NCS</agentName>
            <agentHandle>2200/20061857483</agentHandle>
          </header>
          <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>Brushing a Fluffy Kitty: Important Techniques</dc:title> 
              <dc:description>Good description of the best brushing techniques for long hair cats.</dc:description> 
              <dc:identifier>http://mycatstuff.com</dc:identifier> 
              <dc:creator>Meo W. Feline</dc:creator> 
              <dc:author>Sarah Jane</dc:author> 
            </nsdl_dc:nsdl_dc>   
          </metadataXML>
          <annotatedBy />
        </record>
      </cataloguedBy>
    </record>
  <resultData>
</NSDLDataRespository>



API Links:


Additional Links Related to This Call:

Personal tools