Best Practices


A semantic descriptor that is a web page contains other semantic descriptors, and they are linked to each other. Such a page semantic descriptor is represented by an upper camel case.

"descriptor": [
  {"id": "BlogPosting", "type": "semantic", "def": "", "descriptor": [
    {"href": "#id"},
    {"href": "#articleBody"},
    {"href": "#dateCreated"},
    {"href": "#blog"}

Safe state transition

A simple safe request is represented by appending a go prefix to the descriptor of the next transition destination.

refer to nbest practice from 8288:

  {"id": "goHome", "type": "safe", "rt": "#Home"},
  {"id": "goFirst", "type": "safe", "rt": "#TodoList"},
  {"id": "goPrevious", "type": "safe", "rt": "#TodoList"},

All methods except safe add the doprefix.

  {"id": "doEditUser", "type": "idempotent", "rt": "#UserList"},
  {"id": "doDeleteUser", "type": "idempotent", "rt": "#UserList"},
Transition ID should be {go do} prefix + application state ID.
  {"id": "goBlogPosting", "type": "safe", "rt": "#BlogPosting"},
  {"id": "doEditBlogPosting", "type": "idempotent", "rt": "#Blog"},


The semantic descriptor of an “element” that is included in a State but is not a State should be lower camel case.

    {"id": "articleBody"},
    {"id": "dateCreated"},

ALPS file structure

The description of the ALPS descriptor is divided into the following three blocks, which are represented in the following order.

  1. semantic descriptors for word definitions with def or doc (ontology)
  2. semantic descriptor group for inclusion relations (taxonomy)
  3. semantic descriptors for state transitions (choreography)
"descriptor" : [
    {"id" : "name", "type" : "semantic", "def": ""},
    {"id" : "age", "type" : "semantic", "def": ""},

    {"id" : "Person", "type": "semantic", "descriptor":[
      {"href": "#name"},
      {"href": "#age"}
    {"id": "goPerson", "type": "safe", "rt": "#Person"},

Hierarchical structures outside ALPS

ALPS can represent hierarchical meanings by position.

"descriptor": [
    {"id": "name", "def": ""},
    {"id": "Product", "descriptor":[
      {"href": "#name"}
    {"id": "Person", "descriptor":[
      {"href": "#name"}

In the above example, name is shared with Product/name and Person/name. The basic rule is to follow the practices of each format when representing such words in a format with only a flat hierarchy.

  • In the html case, it is represented by the Lower camel case.
    <input name="productName" type="text">
    <input name="personName" type="text">

Add Schema References to Your ALPS Documents

It is a good idea to add a reference to ALPS schemas when creating your ALPS profiles.

  "$schema": "",
  "alps" : {