app-state-diagram

This is a sample ALPS profile demonstrating the semantic descriptors
and operations for a basic e-commerce system. It includes product listing,
shopping cart management, and checkout process, serving as an educational
example for ALPS implementation in online shopping contexts.

View:
Tags:

Semantic Descriptors

Semantic
Safe
Unsafe
Idempotent

address

Cart

id type title
id semantic identifier
goProductList safe View product list
goCheckout safe Proceed to checkout
doUpdateQuantity idempotent Update item quantity
doRemoveItem idempotent Remove item from cart

Checkout

id type title
email semantic email
address semantic address
goPayment safe Proceed to payment

description

doAddToCart

id type title
id semantic identifier
quantity semantic quantity

doPayment

doRemoveItem

id type title
id semantic identifier

doUpdateQuantity

id type title
id semantic identifier
quantity semantic quantity

email

goCart

goCheckout

goPayment

goProductDetail

id type title
id semantic identifier

goProductList

id type title
id semantic identifier

id

name

Payment

id type title
doPayment idempotent Complete payment

price

ProductDetail

id type title
id semantic identifier
name semantic name
description semantic description
price semantic price
goProductList safe View product list
doAddToCart unsafe Add product to cart

ProductList

id type title
id semantic identifier
name semantic name
description semantic description
goProductDetail safe View product details
goCart safe View shopping cart
goProductList safe View product list

quantity


Profile

<?xml version="1.0" encoding="UTF-8"?>
<!--
Welcome to Alps Editor! Let's make API design fun and effective.

Quick tips:
- Press Ctrl + Space to show snippets for auto-completion (suggested terms are from Schema.org)
- To start from scratch, delete all content and press Ctrl + Space, then select "Skeleton"
  (For JSON format, type "{" first)
- Drag and drop an ALPS file (JSON, XML, or HTML) into the editor to open it
  (For HTML files, the ALPS profile contained within will be extracted)
- Hit Ctrl + S to download your work anytime

ALPS bridges vision and implementation, creating APIs that speak business and tech fluently.

Learn more about ALPS:
- Official ALPS website: http://alps.io/
- ALPS-ASD page: https://alps-asd.github.io/

Happy modeling! Remember, solid semantics supports the long-term evolution of your APIs. :)
-->
<alps
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://alps-io.github.io/schemas/alps.xsd">
    <title>app-state-diagram</title>
    <doc>This is a sample ALPS profile demonstrating the semantic descriptors
        and operations for a basic e-commerce system. It includes product listing,
        shopping cart management, and checkout process, serving as an educational
        example for ALPS implementation in online shopping contexts.</doc>

    <!-- Ontology -->
    <descriptor id="id" def="https://schema.org/identifier" title="identifier"/>
    <descriptor id="name" def="https://schema.org/name" title="name"/>
    <descriptor id="description" def="https://schema.org/description" title="description"/>
    <descriptor id="price" def="https://schema.org/price" title="price"/>
    <descriptor id="quantity" def="https://schema.org/Quantity" title="quantity"/>
    <descriptor id="email" def="https://schema.org/email" title="email"/>
    <descriptor id="address" def="https://schema.org/address" title="address"/>

    <!-- Taxonomy -->
    <descriptor id="ProductList" def="https://schema.org/ItemList" title="Product List" tag="collection">
        <descriptor href="#id"/>
        <descriptor href="#name"/>
        <descriptor href="#description"/>
        <descriptor href="#goProductDetail"/>
        <descriptor href="#goCart"/>
        <descriptor href="#goProductList"/>
    </descriptor>

    <descriptor id="ProductDetail" def="https://schema.org/Product" title="Product Detail" tag="item">
        <descriptor href="#id"/>
        <descriptor href="#name"/>
        <descriptor href="#description"/>
        <descriptor href="#price"/>
        <descriptor href="#goProductList"/>
        <descriptor href="#doAddToCart"/>
    </descriptor>

    <descriptor id="Cart" def="https://schema.org/Cart" title="Shopping Cart" tag="collection">
        <descriptor href="#id"/>
        <descriptor href="#goProductList"/>
        <descriptor href="#goCheckout"/>
        <descriptor href="#doUpdateQuantity"/>
        <descriptor href="#doRemoveItem"/>
    </descriptor>

    <descriptor id="Checkout" title="Checkout">
        <descriptor href="#email"/>
        <descriptor href="#address"/>
        <descriptor href="#goPayment"/>
    </descriptor>

    <descriptor id="Payment" def="https://schema.org/PayAction" title="Payment">
        <descriptor href="#doPayment"/>
    </descriptor>

    <!-- Choreography -->
    <descriptor id="goProductList" type="safe" rt="#ProductList" title="View product list">
        <descriptor href="#id"/>
    </descriptor>

    <descriptor id="goProductDetail" type="safe" rt="#ProductDetail" title="View product details">
        <descriptor href="#id"/>
    </descriptor>

    <descriptor id="goCart" type="safe" rt="#Cart" title="View shopping cart"/>

    <descriptor id="goCheckout" type="safe" rt="#Checkout" title="Proceed to checkout"/>

    <descriptor id="goPayment" type="safe" rt="#Payment" title="Proceed to payment"/>

    <descriptor id="doAddToCart" type="unsafe" rt="#Cart" title="Add product to cart">
        <descriptor href="#id"/>
        <descriptor href="#quantity"/>
    </descriptor>

    <descriptor id="doUpdateQuantity" type="idempotent" rt="#Cart" title="Update item quantity">
        <descriptor href="#id"/>
        <descriptor href="#quantity"/>
    </descriptor>
    <descriptor id="doRemoveItem" type="idempotent" rt="#Cart" title="Remove item from cart">
        <descriptor href="#id"/>
    </descriptor>

    <descriptor id="doPayment" type="idempotent" rt="#ProductList" title="Complete payment"/>

</alps>