-
Notifications
You must be signed in to change notification settings - Fork 0
/
default-alps.xml
106 lines (87 loc) · 4.41 KB
/
default-alps.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?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/
- app-state-diagram: https://www.app-state-diagram.com/
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>ALPS Online Shopping</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>