Our Approach allows the semantic specification of 21 common REST (anti)patterns and 24 OCCI (anti) patterns for Cloud RESTful APIs, defines SWRL rules in conjunction with SQWRL queries to specify REST and OCCI (anti)patterns, and finally provides four detection algorithms based on SWRL rules and SPARQL queries for the automatic detection of both OCCI and REST patterns and anti-patterns. Basically, our approach proceeds in four steps, as shows in Figure below:

  • Step 1. Definition of OCCI/REST (Anti)Patterns:
  • This step consists in defining the basic ontology (Anti)Patterns Ontology that provides a semantic specification of OCCI and REST (anti)patterns. (Anti)Patterns Ontology is specified as a set of interrelated ontologies viz. Pattern Ontology, Anti-Pattern Ontology, REST API Ontology, and OCCI Ontology. Together, these ontologies embody the most important and relevant concepts needed for the detection purpose.
  • Step 2. Analysis and Definition of Detection Rules:
  • This step aims to analyze the textual definitions of OCCI and REST (anti) patterns for eliciting their pertinent properties. These pertinent properties will be then exploited to specify the semantic rules to detect patterns and anti-patterns. Both detection rules and (Anti)Patterns Ontology form the knowledge base (KB), will be later interrogated through SPARQL queries for the detection purpose.
  • Step 3. Detection of (Anti) Patterns:
  • The aim of this step is to check the compliance of the selected Cloud REST API with both REST and OCCI best principles. It includes the following two phases:
    • Check compliance for REST principles:
    • This step consists of applying on Cloud REST API the REST detection rules defined in Step 2 to detect REST (anti)patterns. If no REST anti-pattern is detected, the evaluated REST API is considered as REST-compliant and details related to REST patterns will be given to the Cloud API developer for analysis or understanding purposes. Otherwise, details related to both REST patterns and anti-patterns will be displayed.
    • Check compliance for OCCI principles:
    • This step consists of applying, on cloud REST API, the OCCI detection rules defined in Step 2 to detect OCCI (anti)patterns. If no OCCI anti-pattern is detected, the evaluated REST API is considered as OCCI-compliant and details related to OCCI patterns will be given to the Cloud API developer for analysis or understanding purposes. It is worth mentioning that the evaluated REST API can be considered as OCCI and REST compliant when it does not contain any REST and OCCI anti-pattern.
  • Step 4. Cloud REST API Correction:
  • This step allows developers to manually revise their APIs by following the obtained details on REST and OCCI (anti)patterns in order to avoid the REST or OCCI anti-patterns detected in Step 3.

(Anti)Patterns Ontology metrics

REST/OCCI (Anti)Patterns

The REST/OCCI (Anti)Patterns that we defined, are described here.

List of Cloud RESTful APIs

All the RESTful APIs that we analysed are the following:
  1. OOi RESTful API: html
  3. OpenNebula OCCI RESTful API:
  4. Amazon S3 Restful API: API/Welcome.html
  5. Rackspace Restful API: cloud-servers/v2/api-reference/

Implementation and Evaluation

Proof of Concept: ORAP-DT

Our proof of concept implementation is provided as a web-based application based on J2EE solutions concretizing the (anti) patterns detection step. It provides to API developers two main functionalities, which are mainly: Check compliance for REST principles and Check compliance for OCCI principles. Moreover, we relied on three semantic Web APIs namely Pellet API, OWL API and SWRL API to implement the different algorithms described above for the detection of (anti) patterns. These APIs are exploited to handle SPARQL queries and SWRL rules.

Proof Of Concept ORAP-DT (OCCI/REST (Anti)Patterns Detection Tool) Screenshot

Prototype is available for testining at this link

Demonstration Video

Usefulness Evaluation of ORAP-DT prototype:

user-guide: guide.pdf
Usefulness Detection Rate for (a) REST patterns: Correct use of POST, Tidy URLs; (b) REST anti-patterns: Amorphous URIs, Forgetting Hypermedia; (c) OCCI patterns: Compliant Delete, Compliant URL; (d) OCCI anti-patterns: Non-Compliant Create, Non-Compliant Trigger Action

Others Experiments and Results

Detection results of the REST (Anti) Patterns

Detection results of the OCCI (Anti)patterns

Complete validation results of REST patterns and anti-patterns on OOi and Rackspace REST APIs

Complete validation results of OCCI patterns and anti-patterns on OOi and Rackspace REST APIs


  • Hayet Brabra
    Telecom SudParis
    Computer Science Departement
    email: hayet.brabra (-at-)