Skip to content

Commit

Permalink
Addition of the items URI and schema redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckCo committed Dec 22, 2016
1 parent e4c3f80 commit 3b030e2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 35 deletions.
78 changes: 51 additions & 27 deletions api.raml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ protocols:
- HTTPS
description: An API specification for accessing statistical metadata
types:
ClassificationList:
type: !include schemas/metadata-api.xsd#ClassificationList
ClassificationDetails:
type: !include schemas/metadata-api.xsd#ClassificationDetails
ClassificationSchemeList:
type: !include schemas/metadata-api.xsd#ClassificationSchemeList
ClassificationSchemeDetails:
type: !include schemas/metadata-api.xsd#ClassificationSchemeDetails
LevelList:
type: !include schemas/metadata-api.xsd#LevelList
ClassificationListType:
type: !include schemas/metadata-api.xsd#URICodeLabelListType
ClassificationDetailsType:
type: !include schemas/metadata-api.xsd#ClassificationDetailsType
ClassificationSchemeListType:
type: !include schemas/metadata-api.xsd#URICodeLabelListType
ClassificationSchemeDetailsType:
type: !include schemas/metadata-api.xsd#ClassificationSchemeDetailsType
LevelListType:
type: !include schemas/metadata-api.xsd#URICodeLabelListType
ItemListType:
type: !include schemas/metadata-api.xsd#URICodeLabelListType

/classifications:
get:
Expand All @@ -29,17 +31,27 @@ types:
200:
body:
application/xml:
type: ClassificationList
type: ClassificationListType

/classification/{code}:
/classification/{codeClassification}:
get:
displayName: Gets classification details
description: Get details on a classification with code {code}
description: Get details on a classification with code {codeClassification}
responses:
200:
body:
application/xml:
type: ClassificationList
type: ClassificationDetailsType

/classification/{codeClassification}/schemes:
get:
displayName: Get schemes of a classification
description: Gets the list of schemes for the classification with code {codeClassification}
responses:
200:
body:
application/xml:
type: ClassificationSchemeListType

/schemes:
get:
Expand All @@ -49,36 +61,48 @@ types:
200:
body:
application/xml:
type: ClassificationSchemeList
type: ClassificationSchemeListType

/classification/{code}/schemes:
/scheme/{codeScheme}:
get:
displayName: Get schemes of a classification
description: Gets the list of schemes for a given classification
displayName: Get classification scheme details
description: Gets the details on a classification scheme with code {codeScheme}
responses:
200:
description: Successful GET request
body:
application/xml:
type: ClassificationSchemeDetailsType

/scheme/{codeScheme}/levels:
get:
displayName: Get classification scheme levels
description: Gets the levels of a classification scheme with code {codeScheme}
responses:
200:
description: Successful GET request
body:
application/xml:
type: ClassificationSchemeList
type: LevelListType

/scheme/{code}:
/scheme/{codeScheme}/items:
get:
displayName: Get classification scheme details
description: Gets the details on a classification scheme with code {code}
displayName: Get classification scheme items
description: Gets the items of a classification scheme with code {codeScheme}
responses:
200:
description: Successful GET request
body:
application/xml:
type: ClassificationSchemeDetails
type: ItemListType

/scheme/{code}/levels:
/scheme/{codeScheme}/level/{codeLevel}/items:
get:
displayName: Get classification scheme levels
description: Gets the levels of a classification scheme with code {code}
displayName: Get classification scheme items for a given level
description: Gets the items of a classification scheme with code {codeScheme} belonging to the with code {codeLevel}
responses:
200:
description: Successful GET request
body:
application/xml:
type: LevelList
type: ItemListType
14 changes: 6 additions & 8 deletions schemas/metadata-api.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://xml.metadata.org/api" targetNamespace="http://xml.metadata.org/api" elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:element name="ClassificationList" type="CodeLabelList"/>
<xs:element name="ClassificationSchemeList" type="CodeLabelList"/>
<xs:element name="LevelList" type="CodeLabelList"/>

<xs:element name="ClassificationDetails">
<xs:element name="ClassificationDetailsType">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:token"/>
<xs:element name="Label" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
<xs:element name="SchemeList" type="URICodeLabelListType"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="ClassificationSchemeDetails">
<xs:element name="ClassificationSchemeDetailsType">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:token"/>
Expand All @@ -25,13 +22,14 @@
<xs:element name="ValidFrom" type="xs:dateTime"/>
<xs:element name="ValidTo" type="xs:dateTime"/>
<xs:element name="LastModified" type="xs:dateTime"/>
<xs:element name="LevelList" type="CodeLabelList"/>
<xs:element name="LevelList" type="URICodeLabelListType"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="CodeLabelList">
<xs:complexType name="URICodeLabelListType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="URI" type="xs:anyURI"/>
<xs:element name="Code" type="xs:token"/>
<xs:element name="Label" type="xs:string"/>
</xs:sequence>
Expand Down

0 comments on commit 3b030e2

Please sign in to comment.