CTS2-LE REST API: Read Maps and Map Versions

Aus CTS2-LE
Zur Navigation springen Zur Suche springen

Root-URL: /WebCts2LE/rest/

Retrieve all maps

  • MapCatalogQueryService:resolve: Resolve a MapCatalogDirectoryURI as a set of MapCatalogSummaryEntries. This service does not support the QueryService and thus, no query parameters (except referencelanguage and format) will be processed.
  • Path: /maps
  • Method: GET
  • Path Parameters: -
  • Query Parameters:
page the 0-based page number used for paging result sets. Default is 0.
maxtoreturn the maximum number of entries that may be present in a return Directory. If maxToReturn is not supplied, a block size of 100 is used.
  • returns: map:MapCatalogEntryList

Example Response Structure for call /maps

<?xml version="1.0" encoding="UTF-8"?>
<MapCatalogEntryList xmlns="http://www.omg.org/spec/CTS2/1.1/MapCatalog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" complete="COMPLETE" numEntries="1">
   <core:heading xmlns:core="http://www.omg.org/spec/CTS2/1.1/Core">
       <core:resourceRoot>http://localhost:8080/WebCts2LE/rest/</core:resourceRoot>
       <core:resourceURI>maps</core:resourceURI>
       <core:parameter arg="Accept">
           <core:val>application/xml</core:val>
       </core:parameter>
       <core:parameter arg="Accept-Language">
           <core:val>de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4</core:val>
       </core:parameter>
       <core:parameter arg="page">
           <core:val>0</core:val>
       </core:parameter>
       <core:parameter arg="maxtoreturn">
           <core:val>100</core:val>
       </core:parameter>
       <core:accessDate>2016-07-14T14:02:41</core:accessDate>
   </core:heading>
   <entry xmlns="http://www.omg.org/spec/CTS2/1.1/MapCatalog">
       <entry mapName="UNKNOWN" about="example:mapping">
           <fromCodeSystem uri="example:terminology">ExampleCS2013</fromCodeSystem>
           <toCodeSystem uri="example:anotherTerminology">ExampleCS2016</toCodeSystem>
           <versions>http://localhost:8080/WebCts2LE/rest/map/_/mapversions?mapuri=example:mapping</versions>
           <currentVersion>
               <core:mapVersion xmlns:core="http://www.omg.org/spec/CTS2/1.1/Core">ExampleMappingVersion2</core:mapVersion>
           </currentVersion>
       </entry>
   </entry>
</MapCatalogEntryList>

Retrieve a Map by uri

  • Retrieve a MapCatalogEntry by URI. Accessing a Resource By a 'URI'
  • A CTS2 Resource may also be accessed by its URI or "AlternateID." This convention varies slightly from the 'by name' convention in that the URI is not specified in the URL path, but as a query parameter. This is done to eliminate the need for complex encoding that would be necessary to embed a URI into a URL path. The convention for accessing a resource by its URI is
    /{resourceType}byuri?uri={uri|alternateId}
  • Path: /mapbyuri
  • Method: GET
  • Path Parameters: -
  • Query Parameters:
uri the URI, OID or alternateID of the requested resource
  • returns: redirect to /map/_?mapuri=uri
Exceptions
  • UnknownMap if there is no map with the given uri

Retrieve a Map by name

  • MapCatalogReadService:read: Retrieve a MapCatalogEntry by name or URI.
    Please note that this service implementation does not support to request a map by its name. The client has to specify a query parameter and replace the path parameter by an underscore '_'. e.g. "/map/_?mapuri=http://www.somemapping.de".
  • Path: /map/{mapid}
  • Method: GET
  • Path Parameters:
mapid the Name of the Map - this parameter will be ignored; it should always be set to '_'
  • Query Parameters:
mapuri the URI, OID or alternateID of the requested resource
  • returns: map:MapCatalogEntryMsg without the following elements and attributes: currentVersion, versions, href-attributes in from and to elements

Example Response Structure for call /map/_?mapuri=example:mapping

<?xml version="1.0" encoding="UTF-8"?>
<MapCatalogEntryMsg xmlns="http://www.omg.org/spec/CTS2/1.1/MapCatalog" xmlns:core="http://www.omg.org/spec/CTS2/1.1/Core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <core:heading xmlns:core="http://www.omg.org/spec/CTS2/1.1/Core">
       <core:resourceRoot>http://localhost:8080/WebCts2LE/rest/</core:resourceRoot>
       <core:resourceURI>map/_</core:resourceURI>
       <core:parameter arg="Accept">
           <core:val>application/xml</core:val>
       </core:parameter>
       <core:parameter arg="Accept-Language">
           <core:val>de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4</core:val>
       </core:parameter>
       <core:parameter arg="mapuri">
           <core:val>example:mapping</core:val>
       </core:parameter>
       <core:accessDate>2016-07-14T14:30:23</core:accessDate>
   </core:heading>
   <map xmlns="http://www.omg.org/spec/CTS2/1.1/MapCatalog" mapName="UNKNOWN" about="example:mapping">
       <fromCodeSystem uri="example:terminology">ExampleCS2013</fromCodeSystem>
       <toCodeSystem uri="example:anotherTerminology">ExampleCS2016</toCodeSystem>
       <versions>http://localhost:8080/WebCts2LE/rest/map/_/mapversions?mapuri=example:mapping</versions>
       <currentVersion>
           <core:mapVersion xmlns:core="http://www.omg.org/spec/CTS2/1.1/Core">ExampleMappingVersion2</core:mapVersion>
       </currentVersion>
   </map>
</MapCatalogEntryMsg>

Exceptions
  • UnknownMap if
    • the name of the map (path parameter mapid) is not set to an underscore
    • the query parameter mapuri is not specified or is not an uri
    • there is no map with the given uri