1.0 SPECIFICATION
This specification defines a resource model of requirements and other artefacts from the domain of requirements definition and management. The resource model is defined in terms of representations of resources, media types, the basic HTTP 1.1 methods and response codes. The capabilities of this "RESTful" API is not declared nor intended to be general purpose; they are driven by a set of scenarios that were the focus of the work group which authored this specification.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC2119. Domain name examples use RFC2606.
Resource | URI | GET | POST | PUT | DELETE | Description |
---|---|---|---|---|---|---|
Requirement | {URI} | MUST | Undefined | MUST | MAY | Representation of a requirement (see Requirement resource) |
Requirement Collection | {URI} | MUST | Undefined | MUST | MAY | A collection of references to requirements (see Requirement Collection resource) |
The RM resource model supports the creation of certain resources via "factory" resources. Requirements can also be created via delegated web UIs. Details of each of these capabilities will follow in subsequent sections; the following table provides a summary:
Purpose | Resource | URL | Support |
---|---|---|---|
Requirement Creation | oslc_rm:requirementFactory | {Requirement Factory} | MUST |
Requirement Selection UI | oslc_rm:requirementSelectionDialog in service discovery document | {Requirement Selection URL} | MUST |
Requirement Creation UI | oslc_rm:requirementCreationDialog in service discovery document | {Requirement Creation URL} | MUST |
Requirement Collection Selection UI | oslc_rm:requirementCollectionSelectionDialog in service discovery document | {Collection Selection URL} | MUST |
The following table lists the namespace prefixes and associated namespaces used for samples and specification text. Service Providers MUST support these reserved namespace prefixes.
Prefix | Namespace | Defined |
---|---|---|
oslc_rm | http://open-services.net/xmlns/rm/1.0/ | By this specification |
oslc_disc | http://open-services.net/xmlns/discovery/1.0/ | Service Provider Catalog |
dc | http://purl.org/dc/terms/ | Dublin Core Terms |
rdf | http://www.w3.org/1999/02/22-rdf-syntax-ns# | RDF/XML |
rdfs | http://www.w3.org/2000/01/rdf-schema# | RDF Schema |
The following table summarizes the MIME media types used for various resource requests. See appropriate sections for specification requirements on usage.
Media Type | Defined | Resource |
---|---|---|
application/x-oslc-rm-service-description-1.0+xml | Service Discovery Document | Service Description Document |
application/x-oslc-disc-service-provider-catalog+xml |
Service Provider Catalog | Service Provider Catalog |
application/x-oslc-rm-requirement-1.0+xml | Requirement Resource Definition | Requirement. |
application/x-oslc-rm-requirement-collection-1.0+xml | Requirement Collection Resource Definition | Requirement collection. |
application/xml text/xml |
W3C Extensible Markup Language (XML) | General XML format request/response |
application/xhtml+xml | W3C XHTML 1.1 | XHTML presentation format |
text/html | W3C HTML 4 | HTML presentation format |
application/rdf+xml | RDF/XML media type | General XML representation of RDF |
Service providers MUST follow the HTTP/1.1 (RFC 2616) specification.
In particular:
Each of the operations on a given URI may support a different default MIME type, as described elsewhere in this specification.
HEAD behaves as GET in all cases, with the exception that the response entity is omitted in the case of HEAD.
The resource model describes properties as
Each resource representation describes various properties, their meaning, and behaviour on read (GET/HEAD) and write (POST/PUT).
A provider MUST respond with a 400 (Forbidden) when a service consumer attempts to update a resource (using POST/PUT) with a representation where one or more "required on write" properties is absent. A provider MUST tolerate an update (a POST/PUT) to a resource with a representation regardless of whether any "not required on write" properties are absent.
A provider MUST include in all resource representations those "required on read" properties (on GET/HEAD). Properties which are "not required on read" MAY be excluded.
This specification defines the meaning of several properties in the RM resource model, some of which are declared to be "not required on read". The RM resource model specification is open (in the sense that providers MAY contribute properties from other vocabularies, and providers MAY tolerate clients contributing properties from other vocabularies): such foreign properties MUST be treated as "not required on read", and "required on write".
All implementations of this interface MUST implement all of the REQUIRED behaviours. Such implementations are termed "conditionally compliant". Implementations which additionally implement all of the OPTIONAL behaviours are "unconditionally compliant".
Certain facets of behaviour are explicitly left "undefined" by this specification; providers are free to implement any behaviour in such cases. However, clients consuming OSLC RM services are strongly recommended not to exploit or to rely on such behaviours since future revisions of this specification may require compliant implementations to change those behaviours. (Notice as a special case that service providers may choose to implement "undefined" in this specification as "405 (Method Not Allowed)": consumer reliance on this response code would be contrary to this recommendation.)
Requirement resource formats are defined elsewhere in this specification (see requirement resources).
The following table describes HTTP methods on requirement resources:
Method | Required | Comments |
GET/HEAD | MUST | Fetches a representation of the requirement [1]. |
PUT | MUST | Updates the resource with the supplied representation [1,2].
|
POST | Undefined | The behaviour of a POST to a requirement resource is not defined by this specification. |
DELETE | MAY | Deletes the resource [3]. |
A service provider MUST support at least the following HTTP response status codes in response to a PUT to a requirement resource:
Code | Content | Description |
---|---|---|
403 (Forbidden) | Error message | The request is well-formed but is invalid in some other way. This request should not be retried. (This would happen if the requirement representation were missing one or more of its required properties.) |
404 (Not found) | Error message | The request URI was not found on the server. |
406 (Not Acceptable) | Error message | The supplied media type is not acceptable as a representation of a requirement. A list of acceptable content types SHOULD be supplied in the response entity. |
409 (Conflict) | Error message | The request is well-formed but is invalid in some other way. A description of the problem MAY be provided in the response body. |
415 (Unsupported Media Type) | Error message | The Content-Type of the request is not recognised by the server. The provider SHOULD provide a list of acceptable content types in the response body. |
Requirements are created by POSTing an application/x-oslc-rm-requirement-1.0+xml resource representation to the {Requirement Factory} URI described in the service document. Service providers MUST support this media type on POST. Requirement resource formats are defined elsewhere in this specification (see requirement resources).
The following table describes the HTTP methods on the {Requirement Factory}:
Method | Required | Comment |
GET/HEAD | Undefined | [1] |
PUT | MUST | Returns 405 (Method Not Allowed) [2] |
POST | MUST | Creates a new requirement [3]. |
DELETE | MUST | Returns 405 (Method Not Allowed) [2] |
Notes:
A service provider MUST support at least the following HTTP response status codes in response to a POST to the {Requirement Factory}:
Code | Content | Description![]() |
---|---|---|
201(Created) | Requirement resource | Representation of the created requirement. The Location header MUST contain the URI of the newly created requirement [1]. |
415 (Unsupported Media Type) | Error message | The Content-Type of the request is not recognised by the server. The provider SHOULD provide a list of acceptable content types in the response body. |
400 (Bad request) | Error message | The POST could not be processed because the request was not well-formed. |
409 (Conflict) | Error message | The request is well-formed but is invalid in some other way. A description of the problem MAY be provided in the response body. |
403 (Forbidden) | Error message | The request is well-formed but is invalid in some other way. This request should not be retried. (This would happen if the requirement representation were missing one or more of its required properties.) |
404 (Not found) | Error message | The request URI was not found on the server. |
406 (Not Acceptable) | Error message | The supplied media type is not acceptable as a representation of a requirement. A list of acceptable media types SHOULD be supplied in the response entity. |
Notes:
Requirement collection resource formats are defined elsewhere in this specification (see requirement collection resources).
The following table describes operations on requirement collection resources:
Method | Required | Comments |
GET/HEAD | MUST | Fetches a representation of the collection [1]. |
PUT | MUST | Updates a the collection resource [2,3]. |
POST | Undefined | |
DELETE | MAY | Deletes the collection resource [4]. |
Notes:
Code | Content | Description |
---|---|---|
403 (Forbidden) | Error message | The request is well-formed but is invalid in some other way. This request should not be retried. (This would happen if the requirement representation were missing one or more of its required properties.) |
404 (Not found) | Error message | The request URI was not found on the server. |
406 (Not Acceptable) | Error message | The supplied media type is not acceptable as a representation of a requirement collection. A list of acceptable content types SHOULD be supplied in the response entity. |
409 (Conflict) | Error message | The request is well-formed but is invalid in some other way. A description of the problem MAY be provided in the response body. |
415 (Unsupported Media Type) | Error message | The Content-Type of the request is not recognised by the server. The provider SHOULD provide a list of acceptable content types in the response body. |
Some requirements management service providers have Web-based UI that can perform complex actions for handling of rules needed for selection of requirements, for example, providing navigation, query and search capabilities to locate requirements and collections of requirements. Clients of these services can utilize this capability within their own Web UI by following some simple standards-based methods for cross application interaction. This is interaction is detailed in a separate specification document titled Delegated Resource Selection and Creation. Conforming service providers MUST support this delegated model.
Service providers and consumers MAY support HTTP basic authentication.
Service providers and consumers MAY support OAuth.
Service providers and consumers MAY use the secure communication protocol HTTPS (HTTP interaction using Transport Layer Security).
Whenever an HTTP request results in an error, a status code in the range of 400-599 is returned from the server. A service provider returns a response body containing additional information about the error. The response's body media type MUST be application/rdf+xml, with the following properties defined in the http://open-services.net/xmlns/rm/1.0
namespace:
Implementations MAY provide additional properties. The error message text SHOULD be appropriate to the locale of the requesting client.
In application/rdf+xml
format:
<?xml version="1.0" encoding="UTF-8"?> <rdm:Error xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdm="http://open-services.net/xmlns/rm/1.0/"> <rdm:statusCode>404</rdm:statusCode> <rdm:message> A requirement with the given URI wasn't found on this server. </rdm:message> </rdm:Error>