Title: WebML Web Modeling Language
1- WebML Web Modeling Language
slides taken from the WebML tutorial at
www.webratio.com
2References
- Building data-intensive Web applications.
- By Stefano Ceri, Piero Fraternali, Aldo Bongio,
Marco Brambilla, Sara Comai, Maristella Matera,
will be published by Morgan-Kaufmann (Jim Grays
series), December 2002. - www.webml.org
- WebML resources (papers, manuals, )
- Web modeling compendium bibliography
- www.webratio.com
- Tool can be downloaded for academic use
3Introduction
www.webml.org
4Target of WebML
- WebML developed at the Politecnico di Milano
(www.webml.org) - Target data intensive Web sites
- large amount of data
- interfaces directed to general public
- exploratory
- browsing-oriented
- personalized (1 to 1)
- volatile content, structure, navigation,
presentation - WebML is not the right approach for
- Small Web sites (Homepages, )
- Static Web sites
5The WebML models
- WebML a conceptual language for high-level
design of data-intensive web sites - Models
- Structure data organization
- Derivation redundant data definition
- Composition definition of site pages as set of
subpages and elementary publishing units - Navigation definition of links between pages and
between units - Presentation positioning of the units in the
page and definition of graphical appearance
6Preview of WebML concepts
- Site
- Structure Composition Navigation
Presentation
entities,relationships
units, pages,links
site views
styles
navigation composition
structure
presentation
user models
7Structure Model
8Structure Model Glossary
STRUCTURE MODEL
- Based on a simplyfied ER-model
- Entity class of objects in the application
domain, which describes a set of elements with
similar characteristics - Attribute unstructured mono-valued property of
an Entity - Relationship connection between Entities
- Instance (Entity Instance) single real object of
the domain, defined as an element of an Entity - Object the same as Entity Instance
9Structure modellingBasic notations
STRUCTURE MODEL
- Entities are boxes, labelled with the entity name
in the upper half of the box - Attributes are listed in the lower half of the
entity box (optional) - Relationships are represented by a solid line
between two entity boxes - ISA hierarchies are denoted by an arrow pointing
from the sub-entity (more specific concept) the
the super-entity (general concept)
attribute1
10Entity
STRUCTURE MODEL
- An Entity represents a descriptor of a set of
items found in the real world, which have similar
characteristics (e.g., books, authors, products,
etc..) - Individual items in the real world are instances
of an entity they are also called objects (e.g.,
James Joyce, Dubliners, Diet Coke) - All the instances of an entity form the
population of the entity - An Attribute (also called scalar attribute, or
mono-valued attribute) is a property common to
the instances of an entity (e.g., the title of a
book, the birthplace of an author)
11Relationships
STRUCTURE MODEL
- A Binary Relationship instance is a connection
between two objects - A relationship role is one of the two
directions under which a relationship can be
regarded - Relationship roles have user defined names
- E.g. Relationship Author_Book may have the roles
- Role 1 author2book
- Role 2 book2author
Author_Book
12Running case Acme e-Catalog specs
STRUCTURE MODEL
- Acme is a small furniture company, which sells
products thru stores located all over the world.
Now, ACME wants to build a Web site for
publishing a product catalog and attracting new
customers. The site should include information
about products, special offers, i.e. combinations
of products sold at a discounted price, and
stores. Products are associated to a technical
record. Products may have several enlarged images.
13ACME structure design from requirements
STRUCTURE MODEL
- Entities are first located by looking at the
important concepts in the specifications
(products, combinations,technical records,
images, stores) - Not all concepts are important or need to be
modelled (e.g., catalog the set of published
products and combination need not be modelled)
14ACME structure design from requirements
STRUCTURE MODEL
- Relationships and their cardinality contraints
also stem from the specifications
15ACME structure designfrom requirements
STRUCTURE MODEL
- Attributes stem from descriptive sentences
- Combinations have a name, a price, a thumbnail,
etc.. - Products have a numeric code, a name, a price, a
description - Stores have a location, a map, the URL of their
home page, the email address, etc...
16ACME structure design from mockups
STRUCTURE MODEL
- Sometimes specifications are not in written form,
but page mockups are available - Analysing the mockups unveils entities,
attributes and relationships - Look for
- Object in the page to find entities and attribute
- List of objects (e.g., indexes) to find
relationships - Ask yourself
- Whose content is this?
- Where do the items in this index come from?
17Entity identification from mockups
STRUCTURE MODEL
18ACME Complete structure model (initial version)
STRUCTURE MODEL
Product Name string Code integer Price
float Descriptiontext Thumbnailimage
Combination Name string Price
float Descriptiontext Photoimage
Tech record Colorsimage Size text
Big image Description text Photoimage
Store Location string Map image URL
URL Email URL
19Structure Model - Derivation
STRUCTURE MODEL - DERIVATION
20Derivation Objectives
STRUCTURE MODEL - DERIVATION
- Derivation is a modelling phase that makes it
possible - To augment the content of an entity by adding
attributes, either imported or calculated from
related objects. - To define the population of entities or of
relationships, based on some property of the
involved objects.
21WebML OCL
MODEL
- Derivation consist of writing expressions called
derivation queries - Queries can be expressed using WebML OQL
- Derivable concepts
- Entities, relationships, attributes
- Derivation queries can be automatically
transformed into SQl views installed in the
database
22Derivation Model
STRUCTURE MODEL - DERIVATION
- E.g.
- Author.BooksNumber count(self.Author2Book)
- BestSeller Book where Book.Sales gt 50,000
23Derived Entities
STRUCTURE MODEL - DERIVATION
- Sub-Entities population in ISA hierarchies can be
specified by means of OQL queries - A free slot is a slot having 0 reservations
- WebML OQL
- SuperEntity where count(reservation)0
24Derived entities
MODEL
- Sub-Entities population in ISA hierarchies can be
specified by means of OQL queries - E.g. ltENTITY id"Italian" superEntityPerson"
- valuePerson as P where
P.birthPlace like Italy "gt - lt/ENTITYgt
- E.g. ltENTITY idTopSell" superEntityBook"
- valueBook as B where B.Copies
gt 500,000 "gt - lt/ENTITYgt
25Derived attributes
STRUCTURE MODEL - DERIVATION
- Attributes of an entity can be derived by
associating to them a query. - Four types of derived attributes
- Imported attributes maritalName
Self.husband.lastname - Constant attribute affiliation Politecnico di
Milano - Aggregate attributes reservation
count(Self.reservation) - Calculated attributes lastPrice
Self.pricediscount - Derivation rules
- OL.TotalPrice Self.Price Self.Quantity
- Order.TotalPrice Sum (Self.Order2OL.TotalPrice)
- Order.NumLines Count (Self.Order2OL)
26Derived AttributesInformation import
MODEL
- Import a piece of external information into an
entity - E.g.
- Product.BrandLogo Self.Prod2Brand.Logo
27Calculated Attributes
MODEL
- Total price of order as sum of price of order
lines - Derivation rules
- OL.TotalPrice Self.Price Self.Quantity
- Order.TotalPrice Sum (Self.Order2OL.TotalPrice)
- Order.NumLines Count (Self.Order2OL)
price, qty
28Derived attributespossibilities (1)
MODEL
- Constant values
- E.g. Track.Type CD track
- Multi-step relationship navigation
- E.g.Track.Language Self.Track2Album.Album2Arti
st.Language - Filtering predicates
- Artist.NewAlbums count (Self.Artist2Album (as
B) where B.Date gt 01/01/98 )
29Derived attributespossibilities (2)
MODEL
- ISA testing
- Book.TopIcontopImg.gif where Self ISA
TopSeller - Acyclicity condition must be met
- (no recursive derivation)
- no derived concept is defined directly or
indirectlyin terms of itself
30Derived relationships
STRUCTURE MODEL - DERIVATION
- Relationships can be derived by a WebOQL query in
two ways - by subsetting and/or concatenating existing
relationships - by matching pairs of objects by means of a
condition - Variable Self denotes the instance of the source
entity of the relationship
31Derived relationships subsetting/ concatenating
MODEL
- Subsetting existing relationship
- E.g. ltRELATIONSHIP id"Artist2TopSeller"
to"Album" - inverse"TopSeller2Artist"
- value"Self.Artist2Album as A
where A ISA TopSeller" /gt - Concatenating existing relationship
- E.g. ltRELATIONSHIP id"CoParticipation"
- to"Artist" inverse"CoParticipation"
- value"Self.Artist2Compilation.Compilation2Arti
st"/gt
32Derived relationships matching pairs of related
obj
MODEL
- ltRELATIONSHIP id"User2Favorite" to"Article"
- inverseFavorite2User"
- value"Self.Article as A
- where A.category in
Self.User2Preference.name"/gt
User2Favorites relates User to all the Articles
whose category is in the set of the preferred
categories of the user.
33Hypertext Model
HYPERTEXT MODEL
34Hypertext Modelpurpose
MODEL
- Goals
- Modelling at a high level the front-end of a
dynamic Web application and the interactions with
the back end business logic and data - Using a simple, yet formal, visual notation
- Enabling automatic generation of dynamic page
templates and data access and manipulation queries
35Hypertext Modelquestions
MODEL
- Q1 what is the experience of the site that the
user can achieve? - Q2 how is the hypertext divided into pages
served to users? - Q3 what information is published in the
hypertext nodes? - Q4 how are the hypertext nodes connected?
- A1 siteviews
- A2 pages
- A3 content units
- A4 links
36Content Units
HYPERTEXT MODEL
- A WebML unit is the atomic information publishing
element - It is a view defined upon a container of
objects - All the instances of an entity
- Instances of an Entity that meet a selection
condition called selector
IN
OUT
37Composition examples of Content Units description
HYPERTEXT MODEL
DATAUNIT
To publish information about A SINGLE
object (e.g. AuthorDetail) To publish a list
of objects (e.g. IndexOfAuthors)
content
INDEXUNIT
content
38Composition examples of Content Units rendering
HYPERTEXT MODEL
DATAUNIT
Author
INDEXUNIT
Author
39ACME data unit inProduct page
HYPERTEXT MODEL
Product
40ACME case index unit inProducts page
HYPERTEXT MODEL
selOID
Product
- A simple index is provided to the user
- Users can access products by clicking on index
elements
41Basic Content Units
HYPERTEXT MODEL
INDEXUNIT
MULTIDATAUNIT
DATAUNIT
- Content
- instances of an entity
- Selector
- set of conditions
entitySelector
entitySelector
entitySelector
MULTICHOICE
HIERARCHICAL
ENTRYUNIT
SCROLLERUNIT
entitySelector
entitySelector
entitySelector
42Meaning of Content Units
HYPERTEXT MODEL
DATAUNIT
INDEXUNIT
MULTIDATAUNIT
ENTRYUNIT
MULTICHOICE
SCROLLERUNIT
HIERARCHICAL
43Navigation Model Links
HYPERTEXT MODEL
AuthorID is transported
entityauthor
Book author2book
- Semantics of a link
- Moving from one place to another
- Transporting information from one place to
another (navigation context) - Activating a computation (side effect)
44Defaults for selectors
MODEL
- Whenever possible, selectors and their
parameters are inferred from the diagram and need
not be explicitly specified - Example
Book author2book
Author
Book
45Example of links
MODEL
Which authors books?
Which book?
p2
p3
p1
Author OIDp1
Book OIDp3
Book author2book(p2)
46Link Parameters
MODEL
param
Book Author2Book(param)
- Context is transported through links using link
parameters - A link parameter is defined by
- Name
- Source one of the output parameters of the
source unit - Target one of the input parameters of the target
unit
47Default Link Parameters
MODEL
- Whenever possible, link parameters are inferred
from the diagram and need not be explicitly
specified - Diagrams become simpler and more readable
- Example
Book Author2Book
Author
48 Automatic Links
MODEL
source unit
target unit
A
- An automatic link passes some default context to
the destination unit immediately after the
display of the source unit, without the user
intervention - Subsequently, the user can change the passed
context by choosing a different object, using the
anchor(s) representing the link
49Transport Links
MODEL
source unit
target unit
Book Author2Book
Author
- A transport link has a default context that is
passed to the target unit immediately after the
display of the source unit, without the user
intervention - The user cannot change the default context and
therefore the link is not rendered with an anchor
50Types of links
HYPERTEXT MODEL
- Contextual links
- Between units
- Context transported
- Non-contextual links
- Between pages
- No context transported
Voyages
Books
51Examples
MODEL
- No input links and no selector wrong unit!
p1
EntityB
- Input parameter OID of a connected object the
related object is shown
A.oid
B.oid
EntityB Relationship(A2B)
- Input parameter value to be used in the
selector the matching object is shown
param1
B.oid
EntityB B.attr param1
52IndexUnit
HYPERTEXT MODEL
selectedOID
params
Entity Selector(params)
- Index units
- Publish an index of elements (SET OF OBJECTS)
- The container is an entity with (optional)
selector - Input parameters for the computation of the
selector - Values for attribute comparisons
- OID of related object
- Output parameter
- OID of the object selected by the user
53MultiDataUnit
HYPERTEXT MODEL
params
OIDs
Entity Selector(params)
- Multidata units
- Present multiple instances of an entity (SET OF
OBJECTS) - The container is an entity with (optional)
selector - Input parameters requested for the computation of
the selector - Values for attribute comparisons
- OID of participants to relationships
- Output parameter
- The set of OIDs of the published objects
54Entry Unit
HYPERTEXT MODEL
params
- Unit for describing input forms that allow
information submission by the user - Content is shipped to other units via outgoing
links (normally one), using link parameters - Typically translated into HTML using the ltformgt
tag and the associated submit button
55Multichoice Unit
HYPERTEXT MODEL
selOIDs
params
Entity Selector(params) Preselector(params)
- Multichoice units
- Publish indexes of elements (SET OF OBJECTS)
among which the user to select one or more
elements (with checkboxes) - The container is an Entity (with optional
selector pre-selector) - Input parameters
- Those requested for the computation of the
selectors (values for attribute comparisons and
OID of participants to relationships) - Output parameters
- OIDs of the objects checked by the user
- Preselector allows one to define a sub-set of
elements as pre-checked (before any user
interaction)
56Examples
HYPERTEXT MODEL
- No input links all objects shown, no pre-checked
elements
selOIDs (B)
EntityB
sourceOID (A)
selOIDs (B)
- Pre-selector all objects shown, pre-checked
elements related to A
EntityB PRERelationship(A2B)
- Selector only elements related to A shown, no
pre-checked elements
sourceOID (A)
selOIDs (B)
EntityB Relationship(A2B)
57Hierarchical Unit
HYPERTEXT MODEL
selOIDs
params
Entity (Relationship) Selector
- Hierarchical units
- Publish an index of elements, with entries
organized hierarchically using entities connected
by relationships - Allow the user to select one element from any
level of the hierarchy - The container is a set of entities and connecting
relationships (with optional selectors at all
levels) - Input param requested for the computation of the
selectors - Values for attribute comparisons
- OID of partecipants to relationships
- Output parameter OID of the object selected by
the user
58Hierarchical Unit outgoing links
HYPERTEXT MODEL
ParamA
link a
- Tables link a
- Kitchen link b
- Korla KJD54 link c
- Chairs link a
- Stools link b
- Roy LKR34 link c
- OddVar JSQ87 link c
- Office link b
- Jess RLT45 link c
ParamB
link b
ParB,ParC
link c
EntityA selector1 EntityB (A2B) selector2 Enti
tyC (B2C) selector3
Category SubCategory (Cat2SubCat) Product (SubCat2
Prod)
- Each link is rendered as an anchor at the proper
level of the hierarchy - The level where the link is placed depends on the
type of the link parameter(s)
59ScrollerUnit
HYPERTEXT MODEL
selOIDs
params
Entity Selector(params)
- Scroller units
- Add browsing capabilities to a set of objects
- Publish links to the first, previous, next, last
object of the set - Used in conjunction with data, index and
multidata units - Number of scrolled objects block factor
- Input values for attribute comparisons, OID of
participants to a relationship - Output the set of OIDs (possibly 1) of the
current block of objects - Always placed in the same page as another content
unit that publish the current (block of) object(s)
60Scroller data unit
HYPERTEXT MODEL
- The entity is the same for the scroller and the
data unit - It is possible to access the data unit also from
another page and the scroller is automatically
syncronized
61Scroller index
HYPERTEXT MODEL
- Paging the result of a search
t,y
Album Title contains t Year gt y
Album
62Hypertext Model - Operation
HYPERTEXT MODEL - OPERATIONS
63Operation Unit
HYPERTEXT MODEL - OPERATIONS
- Models a generic external operation, or a
built-in content manipulation operation - Input from one or more incoming links (at least
one is declared as normal link, the others as
transport links) - Two kinds of output links
- OK link if the operation completes correctly
- KO link if the operation fails
- The predefined WebML units can be enriched by
adding custom external operations (e.g.
SendMail, )
64Built-in Operations
HYPERTEXT MODEL - OPERATIONS
- WebML predefines a set of frequently used
built-in operations to manage a sites content - They are the traditional database operations
create, delete, modify, create relationship,
delete relationship - Users do not need to define the behaviour and the
implementation they are provided off-the-shelf
in the model
65Write access WebML operations
HYPERTEXT MODEL - OPERATIONS
- Some predefined operations are provided
- Customized operation can be defined
- E.g.
- delete of
- an Author
66Built-in Operations
HYPERTEXT MODEL - OPERATIONS
CREATE
DELETE
MODIFY
CONNECT
DISCONNECT
67In/out flow create
HYPERTEXT MODEL - OPERATIONS
Nothing
value1? attribute1
OID of the new object
value2 ? attribute2
68Example
HYPERTEXT MODEL - OPERATIONS
69In/out flow modify
HYPERTEXT MODEL - OPERATIONS
Identifier(s) of the object(s) to modify
value1 ? attribute2
Value2 ? attribute1
Identifier(s) of the modified object(s)
OIDs of objects to modify
70Example
HYPERTEXT MODEL - OPERATIONS
71In/out flow delete
HYPERTEXT MODEL - OPERATIONS
OIDs of the object(s) to delete
OIDs of the object(s) to delete
Nothing
Example
72In/out flow connect
HYPERTEXT MODEL - OPERATIONS
Identifiers of theobjects to connect
OIDs of source object(s) to connect
Identifiers of theconnected objects
OIDs of destination object(s) to connect
- Note if the any of the input parameters is a set
of OIDs, the operation is applied to each element
of the set - The disconnect operation is similar
73Example
HYPERTEXT MODEL - OPERATIONS
74 Example/2
HYPERTEXT MODEL - OPERATIONS
75Acme administrator
HYPERTEXT MODEL - OPERATIONS
76Composition Model
COMPOSITION MODEL
77CompositionPages
COMPOSITION MODEL
- A Page is a structured container of units and
links - Possibly structured in and/or sub-pages
- Abstraction of screen, frame, card, deck...
- Permits one to cluster related information for
more efficient communication - E.g.
The index of authors and the selected author are
shown together in the same page
Author
Author
78Non contextual links
COMPOSITION MODEL
- A non contextual link is a link between pages
- No context (information) is transported
- The user can browse from a page to another one
via an anchor (e.g., gtgtBooks)
HomePage
Book Index
79Home Page
COMPOSITION MODEL
- The Home Page is the main page of a site
- It is the first page of the site that the user
should see - Each siteview must contain a page marked as
Home
Book Index
HomePage
H
80Landmark pages
COMPOSITION MODEL
Store Page
Books
L
Authors
Book Details
- Landmark pages globally visible pages. The user
can jump to them from everywhere in the site view
- It is equivalent to a non contextual link
implicitly defined from every other page in the
site view to the landmark page
81Areas
COMPOSITION MODEL
Area
- An area is a set of logically homogeneous pages
- Examples of areas
- Sections of a portal Sport, Music, Technology,
- Elements of a data-management system Products
management, News management, - Areas can be nested, so that sub-areas can be
defined inside areas - Each area should have a DEFAULT PAGE or a DEFAULT
SUB-AREA, to give a meaning to landmark areas and
non-contextual links pointing to areas
82Site Views
COMPOSITION MODEL
- A siteview is a set of pages and/or areas forming
a coherent view of the site - Multiple site views can be defined on the same
data model - Different site views can be published for
different types of users and for different types
of output devices - Site views can be
- Public everyone can enter
- Private access control with password protection
is enforced
83Acme site view modeling
COMPOSITION MODEL
- Two site views on the same data model
- Customer public, for customers
- Admin private, for the administrators and
content managers
84Acme customer site view
COMPOSITION MODEL
- Purpose define the customer experience of the
site - Structure
- Two main areas products and combinations
- Other landmark pages home, stores
Customer
Combination area
Product area
L
L
Store Page
Home Page
H,L
L
85ACME HomePage
COMPOSITION MODEL
86ACME product page
COMPOSITION MODEL
87ACME combinationpage
COMPOSITION MODEL
88The Acme public siteview
COMPOSITION MODEL
89Parameterisation and Personalisation
Parametrisation and Personalisation
90Using global information
Parametrisation and Personalisation
- It is often necessary to
- Set a parameter value (e.g. the country or
language preferred by a user) - Use this value globally in all the pages the site
view, without carrying it explicitly along links - Solution
- Use global parameters stored in the session
- Provide means for setting/getting their value
91Set unit
Parametrisation and Personalisation
- Unit that allows to SET the value of a parameter
- It is always placed outside a Page
- It has only an incoming link (carrying the value
to be assigned to the parameter) - It has not outgoing links
92Get unit
Parametrisation and Personalisation
- Unit that allows to RETRIEVE the value of a
parameter - It is always placed inside a Page
- It has only an outgoing link (carrying the value
retrieved from the parameter) - It has not incoming links
- The retrieved value can be used in any compatible
unit
93Example
Parametrisation and Personalisation
94Personalization
Parametrisation and Personalisation
- Personalization has three facets
- Access control login/logout operations for user
recognition - Site view assignement based on the group a user
belong, some site views are accessible (1 or more
site view per Group) - Page personalization user or group dependent
content
95User / Group metaphor
Parametrisation and Personalisation
- Each User can belong to one or more Groups
(predefined entities in the structural model) - Each user has one default Group
- Each Group can contain one or more User and can
be the default Group for many Users - Each group has one associated Siteview
user2group
user2defaultGroup
96Anonymous access
Parametrisation and Personalisation
- One group is predefined (everyone)
- Users belonging to this group need not login, but
access only unprotected site views, which has
unprotected content (the everyone site views) - Other site views can be accessed only after login
(secured site views)
97Login/ Logout
Parametrisation and Personalisation
- A site-view may contain a page allowing users to
login - Each secured site-view should allow users to
logout - Dynamic Role Changing (i.e. group) allowed
Entry Unit
98CurrentUser and CurrentGroup
Parametrisation and Personalisation
- Each WebML project has two predefined global
parameters - CurrentUser the OID of the currently logged User
- CurrentGroup the OID of the Group of the
currently logged user - Login and Logout operations automatically set /
unset these two parameters
99Page personalization (User)
Parametrisation and Personalisation
- Personalization can be achieved as a result of
appropriate structure design
- Hypertext can reflect structure,
- and thus provide personalization
After login UserCtxParam is bound to my
identity, thus the index shows my reservations
Personal Reservations
UserCtxParam
entityuser
relreservation
100Trolley management
Parametrisation and Personalisation
101Page personalization (Group)
Parametrisation and Personalisation
- Personalization can be achieved also at group
level (because a siteview can serve more groups)
Preferred categories
Authors
relationc2a
relationg2c
GroupCtxPar
Category
Group
102Presentation Model
PRESENTATION MODEL
103Presentation
PRESENTATION MODEL
- Presentation dealt with along two lines
-
- Gallery of default presentation styles applicable
to site views or single pages (with elementary
unit positioning on a grid) - each presentation style is an XSL stylesheet
- Compatibility with best selling tools
for presentation editing, for advanced page
design - E.g., WebML extensions for Dreamweaver 3 4
104WebRatio Tool
WebRatio
www.webratio.com
105WebRatioSite Development Studio
WebRatio
- Functionalities
- Structure model design
- Data derivation (Derivation Wizard)
- Hypertext model design (siteviews)
- Consistency checks (warnings)
- Structure Mapping onto a datasource
- Elementary units positioning in the pages
- Automatic web site generation with default
presentation styles
106Structure modelling
WebRatio
107Hypertext modelling
WebRatio
- Allowed
- operations
- New siteview creation
- Add/remove pages, units, links
- Edit elements properties (panel)
- Cutpaste