snowtam trial: rest interface. aixm xml developers' seminar 2 contents digital-snowtam trial...

Download SNOWTAM Trial: REST Interface. AIXM XML Developers' Seminar 2 Contents Digital-SNOWTAM Trial Introduction REST Introduction REST in the Digital-SNOWTAM

Post on 04-Jan-2016

217 views

Category:

Documents

5 download

Embed Size (px)

TRANSCRIPT

  • ContentsDigital-SNOWTAM Trial IntroductionREST Introduction

    REST in the Digital-SNOWTAM TrialWhy it is usedArchitectureHow it is used

    Example

  • Digital-SNOWTAM Trial Introduction

  • Demo

  • REST Introduction

  • RESTRepresentational State TransferAn architectural style

  • Main definitionsResourcesRepresentationsActions VerbsType of data

  • ResourcesA resource is a real thing that can be acted upon with a requestAnything that can be named can be a resource e.g. PDF, XML, SVG, HTML page, todays weather report.They are found using URIs (see www.purl.org)

  • Resources and timeResources can vary over time.The only thing that must be static is the semantic of the mapping (name).

  • RepresentationsThe data transmitted to and from the resource is called a representationCaptures the current or intended state of the resourceIt can be a copy of the file or a description of it

  • TransparencyHow the representation is found should be transparent to the user

    It could involve the server parsing the URL, constructing a database query and returning the result

  • Actions - VerbsOnce the representation of the resource has been returned, an action can be performedThe interaction is determined by the HTTP verbs: GET, PUT, POST and DELETEThe interaction is stateless

  • Type of dataWhen performing an action on a resource it is important to know what the resource isMIME types can help here (e.g. text/xml)The format of the request/response can be specified in a schema

  • ActionsGETUsed to read a resource or as a queryShould be side-effect free

    PUTReplaces the target resource in its entirety

    DELETERemoves the resource

    POSTHas a variety of meanings e.g. it can be used when only a subset of a resource has to be modified

  • REST in the Digital-SNOWTAM Trial

  • Why it is usedSupport the provision of AIXM 5.1 data to end-user applications

    The REST interface shall enable digital users to:Query the Digital SNOWTAM database for the list of airports contained in the database and select one of these airports;Get the list of airports features for a selected airport;Get the surface contamination records for each such feature;Get the feature related through xlink:href;Get the SNOWTAM text and the free text translation associated with an Airport.

  • ArchitectureThe REST implementation framework used is Struts 2 REST plug-in which in turn uses the Convention plug-in.See http://struts.apache.org/2.x/docs/rest-plugin.html for more information.Please note the REST plug-in is only available for Struts 2.1.1 or above.

  • ImplementationOnly GET is need for the trial.

  • WorkflowIn order to interrogate the database:request the list of airportsselect one airport and use the xlink:href to get the details about this airportselect a runway and use the corresponding xlink:href to get the details about this feature

    The xlink:href is a URL compliant to the Digital SNOWTAM REST request structure

  • Base URLBase:

    http:///E.g. http://l-accept-04.pulsar.be/ec-xsnowtam-rest-accept

    Then add a Suffix:

    /

  • Find AirportsSuffix:/airportheliports[?designator=]

    There are about 15000 airports/heliports in the database so

    Optional Parameter:The pattern is of the form [A-Z*]{1,4} where * is the wildcard character.Pattern samples:EB* matches any designator beginning with EB*BBR matches any designator ending in BBRE*R matches any designator beginning with E and ending with R

  • Query an AirportSuffix:/airportheliports/[?features=yes/no&contaminations=yes/no&date=]

    Mandatory parameter:gml:identifier UUID

    Optional parameters:date - is the search date&time features - specify if xlink:href pointing to related features must be included in the results, e.g. runways, taxiways, etccontaminations - specify if contaminations must be included or not in the result

  • Examples

  • 1 Create ContaminationUse Bromma to create a contamination

  • 2 Use REST to find the airporthttp://l-accept-04.pulsar.be/ec-xsnowtam-rest-accept/airportheliports?designator=ESSB

  • 3 Find SNOWTAM Texthttp://l-accept-04.pulsar.be/ec-xsnowtam-rest-accept/airportheliports/77a0de0e-277a-4824-a561-2ba779a3658c?features=yes&contaminations=yes

    snowtam-icao SW** ESSB 10090900 (SNOWTAM A)ESSB B)10090900 C)12 F)3/2/2 G)1/1/1 H)2/3/3 BRD )

  • 4 Get Airport datahttp://l-accept-04.pulsar.be/ec-xsnowtam-rest-accept/airportheliports/77a0de0e-277a-4824-a561-2ba779a3658c?features=yes

  • 5- Get Runway contaminationhttp://l-accept-04.pulsar.be/ec-xsnowtam-rest-accept/runways/58ea128d-1bbe-47f6-92fe-a8961b4bf5ee?contaminations=yes

    2009-10-09T09:00:00Z 1 MEDIUM BRD NO 1 WATER 2_THIRD

  • 6 - Time basedhttp://l-accept-04.pulsar.be/ec-xsnowtam-rest-accept/runways/58ea128d-1bbe-47f6-92fe-a8961b4bf5ee?date=9/10/2009%2009:00&contaminations=yes

  • AIXM 5.1TEMPDELTA and a BASELINE

    http://en.wikipedia.org/wiki/Representational_State_TransferRESTRepresentational State Transfer It is an architectural style. OFTEN LEAD TO REStful Web Services E.g. Amazon S3 REST API.

    These are represented using URIs (see purl.org)Anything can be a resource e.g. PDF, XML, SVG, HTML page.A resource is a real thing that can be acted upon with a requestThe data transmitted to and from the resource is called a representation.It can be a copy of the file or a description of it.The interaction of the representation on the resource is determined by the verb.Once the resource has been found, an action can be performed.These use the HTTP verbs: GET, PUT, POST and DELETEWhen performing an action on a resource it is important to know what the resource is.MIME types can help here (text/xml).The format of the response can be specified in a schema. Likewise, a schema can define the format of the response.Read-OnlyExcept for the list of Airports always returns an AIXM Basic Message which contains featuresThere is no AIXM message yet for list of airports http://struts.apache.org/2.x/docs/rest-plugin.htmlhttp://struts.apache.org/2.x/docs/convention-plugin.htmlWill work on HTTPSThe response to this request is not AIXM5.1-compliant since AIXM5.1 doesnt define the concept of list of airports/heliports.Can add date&time if needed.

    Use the gml identidfier from the Find Airport stage

    Here are a few remarks valid for all the suffixes described below:date is an optional parameter and is the search date&time in the format dd/mm/yyyy hh:mm (e.g.: 11/06/2009 12:35). In each case, the response will be limited to data valid at that date&time. If no date&time is provided, the current date and time is used.features is an optional parameter to specify if xlink:href pointing to related features must be included in the results,e.g. runways, taxiways, apron of an airport or runway directions of a runway. Possible values are yes and no. If missing, no is assumed.contaminations is an optional parameter to specifiy if contaminations must be included or not in the result. Possible values are yes and no. If missing, no is assumed.

    Use FireFox with text link plug in: https://addons.mozilla.org/en-US/firefox/addon/1939http://l-accept-04.pulsar.be/ec-xsnowtam-rest-accept/runways/58ea128d-1bbe-47f6-92fe-a8961b4bf5ee?date=9/10/2009%2009:00&contaminations=yes

Recommended

View more >