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:
id
title
Tags:
collection
item
Semantic Descriptors
Semantic
Safe
Unsafe
Idempotent
type: semantic
title: Checkout
descriptor
type: unsafe
title: Add product to cart
rt: Cart
descriptor
id
type
title
id
semantic
identifier
quantity
semantic
quantity
type: idempotent
title: Complete payment
rt: ProductList
type: idempotent
title: Remove item from cart
rt: Cart
descriptor
id
type
title
id
semantic
identifier
type: idempotent
title: Update item quantity
rt: Cart
descriptor
id
type
title
id
semantic
identifier
quantity
semantic
quantity
type: safe
title: View shopping cart
rt: Cart
type: safe
title: Proceed to checkout
rt: Checkout
type: safe
title: Proceed to payment
rt: Payment
type: safe
title: View product details
rt: ProductDetail
descriptor
id
type
title
id
semantic
identifier
type: safe
title: View product list
rt: ProductList
descriptor
id
type
title
id
semantic
identifier
id
type
title
doPayment
idempotent
Complete payment
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>