Enterprise Modeling with Conceptual XML

Enterprise Modeling with
Conceptual XML
Stephen W. Liddle
Rollins Center for eBusiness and
School of Accountancy & Information Systems
David W. Embley & Reema Al-Kamha
Department of Computer Science
Brigham Young University, Provo, Utah, USA
ER2004, Shanghai, China
XML for Fun and Profit

The benefits of XML are clear:




Great for hierarchical, mostly human-readable,
textual data
Meta-data travels with the data
Standardized, “commoditized” data interchange
XML enjoys a significant “network effect”

Value of XML = O(n2), where n is number of users
11 Nov 2004
ER2004, Shanghai, China
2
Death by a Thousand Paper Cuts

But XML also has disadvantages:


(Aside from minor issues like query-processing
and storage efficiency concerns)
Schema definitions are complex and numerous



Details can be laborious, tedious
Allows arbitrary amounts of heterogeneity
The number of schemata increases geometrically


Thanks to the network effect, XML is ubiquitous
Rigid tree structure influences XML data modeling
11 Nov 2004
ER2004, Shanghai, China
3
The Modern Enterprise
Wide variety of data sources
Increasing heterogeneity
Increasing need for integration
Customers
Remote Divisions
& Employees
CRM and
Support
Employees
Employee
Systems
ERP
Partner
& Channel
Management
Supply Chain
Management
Suppliers
11 Nov 2004
Strategic
Partners
FIREWALL
Distributors
& Channel
Partners
From Carey, Enterprise Information Integration – XML to the Rescue!, ER2003
ER2004, Shanghai, China
4
Model-Driven Nirvana


OMG’s Model-Driven Architecture
(MDA) hopes to lead us to
the Promised Land
Vision: integrate all assets into one enterprise-wide,
global information appliance by separating
business logic from platform technology
Abstract
Model

PlatformIndependent
Model
Translate
Automated
Mapping
PlatformSpecific
Model
Executable
System
Reverse-engineer legacy components

Semi-automated (at best)
11 Nov 2004
ER2004, Shanghai, China
5
Mike Carey’s ER2003 Challenge to the
Conceptual Modeling Community

Produce a simple conceptual model that:





Works well with XML and XML Schema
Abstracts well for conceptual entities and
relationships
Scales to handle large data sets and complex
object interrelationships
Allows for queries and defined views via XQuery
Accommodates heterogeneity
11 Nov 2004
ER2004, Shanghai, China
6
Our Vision: Conceptual XML

We have an answer to the challenge!


Collectively we’ve been developing it for 30 years
Conceptual XML (C-XML) is a conceptual
model:



High-level object and relationship sets
Seamless abstraction
“Model-equivalent” with XML Schema
11 Nov 2004
ER2004, Shanghai, China
7
How C-XML Helps the Enterprise
Enterprise Application Infrastructure
 Standards-based
 XML-compliant
C-XML Model Management Layer
 Supports conceptual abstractions
 Integrates XML Schema, XQuery views into enterprise view
XML View
XML View
XML View
XML View
Data
Source
Data
Source
Data
Source
Data
Source
11 Nov 2004
ER2004, Shanghai, China
8
C-XML Example
11 Nov 2004
Data frame annotations are not shown
ER2004, Shanghai, China
9
C-XMLXML Schema Translations


We need information- and constraintpreserving translations in both directions
Translations need not be inverses


It is sufficient that they create equivalence classes
Our community has created numerous XML
generation algorithms


But there hasn’t been much work on the reverse
We can guarantee certain good design properties
with respect to generated XML Schema
11 Nov 2004
ER2004, Shanghai, China
10
C-XML Example
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
11 Nov 2004
<xs:element name="Customer" abstract="true"/>
<xs:element name="PreferredCustomer" substitutionGroup="Customer">
<xs:complexType>
<xs:group ref="CustomerDetails"/>
...
</xs:complexType>
</xs:element>
<xs:element name="RegularCustomer" substitutionGroup="Customer">
<xs:complexType>
<xs:group ref="CustomerDetails"/>
</xs:complexType>
</xs:element>
ER2004, Shanghai, China
11
C-XML Example
56: <xs:group name="CustomerDetails">
57:
<xs:sequence>
58:
<xs:element name="CustomerName" type="xs:string"/>
59:
<xs:element name="CustomerAddr" type="xs:string"/>
60:
...
79:
</xs:sequence>
80: </xs:group>
11 Nov 2004
ER2004, Shanghai, China
12
C-XML Example
11: <xs:element ... minOccurs="0" maxOccurs="5">
11 Nov 2004
ER2004, Shanghai, China
13
C-XML Example
35: <xs:key name="OrderKey">
36:
<xs:selector xpath=".//Order"/>
37:
<xs:field xpath="@OrderID"/>
38: </xs:key>
...
60: <xs:element name="Order" minOccurs="0" maxOccurs="unbounded">
61:
<xs:complexType>
62:
<xs:sequence>
...
74:
</xs:sequence>
75:
<xs:attribute name="OrderID" type="xs:positiveInteger" use="required"/>
...
77:
</xs:complexType>
78: </xs:element>
11 Nov 2004
ER2004, Shanghai, China
14
Converting XML Schema back to C-XML

We separate structural from non-structural
concepts



Structural: elements, attributes, …
Non-structural: attribute types, order constraints, …
Algorithm overview:




Generate object sets for each element, attribute
Connected by relationship sets
Nested according to XML hierarchy
Re-code all constraints in C-XML
11 Nov 2004
ER2004, Shanghai, China
15
Initial Result of Reverse Conversion
11 Nov 2004
ER2004, Shanghai, China
16
Strikingly Different?
11 Nov 2004
ER2004, Shanghai, China
17
Or Not?
Artifact of XML Schema
Artifact of XML nesting
n-ary relationship
decomposition
11 Nov 2004
ER2004, Shanghai, China
18
Preserving Information and Constraints



We formalize C-XML using predicate calculus
See the paper for definitions, lemmas,
theorems
We claim that our translations between CXML and XML Schema preserve information
and constraints
11 Nov 2004
ER2004, Shanghai, China
19
View Mechanisms in C-XML

High-level abstractions


C-XML XQuery views


For model management, reducing cognitive load
Generate XQuery from conceptual description
XQuery integration mappings

For bringing together disparate chunks of XML
11 Nov 2004
ER2004, Shanghai, China
20
C-XML XQuery Views

Need to generate XQuery views from C-XML views



XQuery can be cumbersome
Must follow hierarchical XML layout
C-XQuery borrows syntax from XQuery


FLWOR expressions
Path expressions are conceptual



“A//B” designates path from A to B regardless of hierarchy or
intervening steps
Attribute/element distinction is not necessary
Execution is by view unfolding and translation to
standard XQuery
11 Nov 2004
ER2004, Shanghai, China
21
XQuery vs. C-XQuery
Consider conceptual path “Item//OrderID”
“OrderID” or “@OrderID”?
11 Nov 2004
ER2004, Shanghai, China
22
Our Contributions


A vision for applying conceptual modeling to
the task of enterprise-wide XML support
A framework to support the vision:



Information- and constraint-preserving mappings
between C-XML and XML Schema
Defined mechanisms for producing and using firstclass, high-level, conceptual abstractions
XQuery view definitions over both standard and
federated conceptual-model instances
www.deg.byu.edu
11 Nov 2004
ER2004, Shanghai, China
23
C-XQuery Example
define view CustomersByItemsOrdered
{
for $item in Item
return
<Item>
{$item/ItemNr, $item/Description}
{
for $customer in $item/Order/Customer
return
<Customer>
{$customer/CustomerName, $customer/CustomerAddr}
{
for $order in $customer/Order,
$item2 in $order/Item
where $item2 = $item
return
<Order>
{$order/OrderDate, $item2/Qty, $item2/SalePrice}
</Order>
}
</Customer>
}
</Item>
}
11 Nov 2004
ER2004, Shanghai, China
24
Views within Views
define view RecentNitrogenFertilizerCustomers
{
for $i in CustomersByItemsOrdered
where $i/Description = “Nitrogen Fertilizer”
return
<Customer>
{
for $c in $i/Customer
let $total := sum( for $o in $c/Order
where $o/OrderDate > add-days(current-date(), -90)
return $o/Qty * $o/SalePrice )
return
{$c/CustomerName, Total=$total}
}
</Customer>
}
for $c in RecentNitrogenFertilizerCustomers/Customer
where $c/Total > 300
return
<PotentialThreatCustomer>
{$c/CustomerName, $c/Total}
</PotentialThreatCustomer>
11 Nov 2004
ER2004, Shanghai, China
25
C-XQuery Mapping
define view CatalogItemToItem
{
for $cItem in CatalogItem
let $itemNr := CatalogNr-to-ItemNr($cItem)
let $price := $cItem/MSRP * (1 + $cItem/MarkupPercent)
return
<Item>
<ItemNr>{$itemNr}</ItemNr>
<Description>{$cItem/ShortName}</Description>
<Price>{$price}</Price>
</Item>
}
11 Nov 2004
ER2004, Shanghai, China
26
C-XML Workflow Diagram
11 Nov 2004
ER2004, Shanghai, China
27