{ 
  "$schema": "https://alps-io.github.io/schemas/alps.json",
  "alps":
  {
    "version": "1.0",
    "title": "State Watch Profile",
    "doc": {"value": "State-Watch profile for [RWMBook](http://b.mamund.com/rwmbook). There are times when servers themselves do not know what goal the API consumer (client) has in mind. In these cases, you can use this recipe to create a service workflow where the end goal is known by the client alone and the services provide information to help that client determine when the goal is reached."},
    "descriptor" : [
      {"id": "watchID", "type": "semantic", "def": "https://schema.org/identifier",
        "title": "Unique ID of the the state-watch resource",
        "tag":"ontology",
        "doc": {"value": "Unique ID of the state-watch resource. This unique ID is generated by the API client."}
      },
      {"id": "watchURL", "type": "semantic", "def": "https://schema.org/url",
        "title":"URL of the state-watch document.",
        "tag":"ontology",
        "doc": {"value": "URL of the state-watch document. This is the resource that contains the list of selected elements to return in each HTTP response. Services own the URL 'space' (e.g. the authority and path) and clients generate a unique id appended to the service resource space to create a unique URL."}
      },
      {"id": "watchListURL", "type": "semantic", "def": "https://schema.org/url",
        "title":"URL of the element list resource.",
        "tag":"ontology",
        "doc": {"value": "URL of the resource that lists all the available elements that could be selected as watch values. The server is in change of this read-only resource."}
      },
      {"id": "watchElementID", "type": "semantic", "def": "https://schema.org/identifier",
        "title":"Unique identifier of a watch element",
        "tag":"ontology",
        "doc": {"value": "Unique identifier of an element that is availble for watching."}
      },
      {"id": "watchElementURL", "type": "semantic", "def": "https://schema.org/url",
        "title":"URL of a watch element",
        "tag":"ontology",
        "doc": {"value": "URL of a single watch element."}
      },
      {"id": "watchElementValue", "type": "semantic", "def": "https://schema.org/value",
        "title":"Current value of a watch element",
        "tag":"ontology",
        "doc": {"value": "Current value of a single watch element."}
      },
      {"id": "watchElementName", "type": "semantic", "def": "https://schema.org/title",
        "title":"Text name of a watch element",
        "tag":"ontology",
        "doc": {"value": "Text name of a watch element"}
      },
      {"id": "watchElementTag", "type": "semantic", "def": "https://schema.org/tag",
        "title":"Filter tag of a watch element",
        "tag":"ontology",
        "doc": {"value": "Filter tag of a watch element. Use this to associate elements or create searchable groups."}
      },
      
      {"id": "watchElementRecord", "type": "semantic",
       "title":"WatchElement record",
      "tag":"taxonomy", 
        "descriptor": [
          {"href": "#watchElementID"},
          {"href": "#watchElementURL"},
          {"href": "#watchElementName"},
          {"href": "#watchElementValue"},
          {"href": "#watchElementTag"}
        ],
        "doc" : {"value": "Represents one or more watch elements."}
      },

      {"id": "watchListRecord", "type": "semantic",
       "title":"WatchList record",
      "tag":"taxonomy", 
        "descriptor": [
          {"href": "#watchListURL"},
          {"href": "#watchElementRecord"}
        ],
        "doc" : {"value": "Represents the service's list of available watch-able elements."}
      },

      {"id": "watchRecord", "type": "semantic",
       "title":"List of watched elements.",
      "tag":"taxonomy", 
        "descriptor": [
          {"href": "#watchID"},
          {"href": "#watchURL"},
          {"href": "#watchElementRecord"}
        ],
        "doc" : {"value": "Represents the client's list of selected watch-able elements."}
      },
      
     {"id": "home", "type": "semantic",
        "title":"Home (starting point)",
        "tag":"taxonomy", 
        "descriptor": [
          {"href": "#goWatchResource"},
          {"href": "#goWatchList"}
        ],
        "doc" : {"value" : "Home represents any current document or starting point in the flow"}
      },

      {"id": "watchResource", "type": "semantic",
       "title":"List of watched elements",
       "tag":"taxonomy", 
        "descriptor": [
          {"href": "#watchRecord"},
          {"href": "#goWatchList"},
          {"href": "#doWatchUpdate"},
          {"href": "#doWatchClear"},
          {"href": "#goHome"}
        ]
      },

      {"id": "watchListResource", "type": "semantic",
       "title":"List of watch-able elements",
       "tag":"taxonomy", 
        "descriptor": [
          {"href": "#watchListRecord"},
          {"href": "#doWatchCreate"},
          {"href": "#goWatchResource"},
          {"href": "#goHome"}
        ]
      },

      {"id": "goHome", "name": "home", "rel": "self", "type": "safe", "rt":"#home",
        "title":"Go to the Home resource",
        "tag":"choreography",
        "doc": {"value": "A safe, idempotent action to return to the Home document"}
      },
      {"id": "goWatchList", "name": "watchList", "rel": "watchlist", "type": "safe", "rt": "#watchListResource",
        "title":"Go to the list of available elements",
        "tag":"choreography",
        "doc": {"value": "View the list of available watch-able elements."}
      },
      {"id": "goWatchResource", "name": "watch", "rel": "watch", "type": "safe", "rt": "#watchResource",
        "title":"Go to the list of selected watchable elements",
        "tag":"choreography",
        "doc": {"value": "View the list of selected watch-able elements."}
      },
      {"id": "doWatchUpdate", "name": "watchUpate", "rel": "watch update", "type": "idempotent", "rt": "#watchResource",
        "title":"Upate the list of selected watchable elements",
        "tag":"choreography",
        "doc": {"value": "Update the list of selected watch-able elements."}
      },
      {"id": "doWatchClear", "name": "watchClear", "rel": "watch remove", "type": "idempotent", "rt": "#watchResource",
        "title":"Clear the list of selected watchable elements",
        "tag":"choreography",
        "doc": {"value": "Clear the list of selected watch-able elements. This does not remove the resource."}
      },
      {"id": "doWatchCreate", "name": "watchCreate", "rel": "watch create", "type": "idempotent", "rt": "#watchResource",
        "title":"Create a new list of selected watchable elements",
        "tag":"choreography",
        "doc": {"value": "Create a new list of selected watch-able elements."}
      }
    ]
  }
}
