Title: An Extensible Constraint Markup Language Specification, Modeling, and Processing
1An Extensible Constraint Markup
LanguageSpecification, Modeling, and Processing
Dr. Jingkun Hu, Philips Medical Systems Dr. Lixin
Tao, Pace University 18 November 2004
2Outline
- XML constraints
- Problem statement
- Previous work
- eXtensible Constraint Markup Language (XCML)
- Visual modeling of XML constraints
- XCML constraint processing
- Conclusions and future work
3What are XML constraints
- Syntactic constraints and semantic constraints
- Syntactic constraints those restrictions on the
structures, data types, and data formats. - Semantic constraints those restrictions on the
content of XML documents. - A semantic constraint can be expressed in the
form of an assertion (true/false statement) or a
rule (if-then-else) with embedded assertions. The
content of a constraint can be static or dynamic.
4Semantic XML Constraints
5Sample XML constraints- Assertion-based
- The value of element taxRate must be 0.06.
- The value of element taxRate must be greater than
0.02 and less than 0.10. - The value constraint of element taxRate varies
from state to state. - The amount of tax must equal to the product of
net income and tax rate. - (Schema diagram of sample XML document)
6Sample XML constraints - Rule-based
- If the value of an employees role does not equal
to manager, then department element must not be
present. Otherwise, it must be present at least
once. - If the value of netIncome is less than or equal
to a given value of parameter level, then the
value of taxRate should be 0.05 .
7Problem statement
- Validating XML documents against Schemas
(syntactic validation) is not sufficient in
practice. - Syntactic validity cant guarantee if XML
documents meaningful. - Semantic validation is necessary.
- How to express semantic constraints.
8Problem statement (Contd)
- Manually creating XML constraint documents is a
painful task. - Can XML constraints be visually modeled so that
constraint documents are automatically generated?
9Previous work
- W3C XML Schemas (WXS)
- Schematron, Jelliffe
- XML Constraint Specification Language (XCSL),
Ramalho - eXtensible Inter-Nodes Constraint Markup Language
(XincaML), IBM - Xlinkit, Nentwich
10eXtensible Constraint Markup Language (XCML)-
Specification
11Syntax
12Sample XCML definitions
ltConstraint contextpayrollgt ltAssertion
testtaxRate0.06/gt lt/Constraintgt
ltConstraint contextpayrollgt ltAssertion
testtaxRate gt 0.02
and taxRate lt 0.10/gt lt/Constraintgt
ltConstraint contextpayrollgt ltAssertion
testtax netIncome taxRate/gt lt/Constraintgt
13Sample XCML definitions (Contd)
ltConstraint contextpayrollgt ltParametergt
ltnamegtratelt/namegt
lttypegtfloatlt/typegt ltdefaultValuegt0.07lt/de
faultValuegt lt/Parametergt ltAssertion
testtaxRaterate/gt lt/Constraintgt
14Sample XCML definitions (Contd)
ltConstraint context"employee"gt ltRulegt ltIf
testyearsOfWork gt 5/gt ltThen
testpayroll/hasSavingFund true/gt ltElse
testpayroll/hasSavingFund false/gt lt/Rulegt
lt/Constraintgt
15Comparison of XCML with existing XML constraint
languages
16XCML constraints - Visual modeling
17XML data modeling
- UML and XML Schemas
- Carson, Provost, and Routledge et al.
- Three-level-design approach without constraints
- Conceptual, logical, and physical
- Three-level-design approach with constraints
- Conceptual, logical, and physical
18Three-level-design approach
(a)
(b)
19UML profile for XCML schema
20Sample physical models
- XML Schema document
- XCML instance document
21XML schema document of employee profile
- ltxsschema xmlnsxs"http//www.w3.org/2001/XMLSch
ema"gt - ltxselement name"employee" typeEmployee"/gt
- ltxscomplexType nameEmployee"gt
- ltxssequencegt
-
- ltxselement name"role" typeRoleType"/gt
- ltxselement name"department"
typeDepartmentType" minOccurs"0"/gt - ltxselement name"yearsOfWork"
type"xsinteger"/gt - ltxselement name"payroll" typePayrollType"/gt
- lt/xssequencegt
- ltxsattribute name"employeeID"
type"xsstring" use"required"/gt - lt/xscomplexTypegt
-
- ltxscomplexType namePayrollType"gt
- ltxssequencegt
- ltxselement name"salary" type"xsfloat"/gt
- ltxselement name"bonus" type"xsfloat"/gt
- ltxselement name"taxRate" type"xsfloat"/gt
- ltxselement name"tax" type"xsfloat"/gt
22XCML instance document for employee profile
ltxcmlConstraints name"Employee Profile
Constraints" xmlnsxcml"http//www.csis.pace.edu
/dps/xcml" xmlnsxsi"http//www.w3.org/2001/XMLS
chema-instance" xsischemaLocation"http//www.csi
s.pace.edu/dps/xcml ..\..\schema\xcml\Constraints.
xsd"gt ltConstraint context"employee"gt ltRulegt
ltIf testyearsOfWork gt 5/gt ltThen
test"payroll/hasSavingFund 'true'"/gt ltElse
test"payroll/hasSavingFund 'false'"/gt lt/Rulegt
lt/Constraintgt ltConstraint context"employee/pay
roll"gt ltAssertion test"salary bonus - tax
netIncome"/gt lt/Constraintgt ltConstraint
context"employee"gt ltRulegt ltIf test"role
manage/gt ltThen test"count(department) gt
1"/gt ltElse test"count(department)
0"/gt lt/Rulegt lt/Constraintgt lt/xcmlConstraintsgt
23XCML constraints - Processing
24Design and implementation
- Generation of XML Schemas and XCML instance
documents - XML document validation
- Technologies UML 1.4, XMI 1.1, and XSLT 1.0
25Workflow of generating XML Schemas and XCML
instance documents
26Workflow of XML document validation
27Conclusions
- Proposed XCML is much more powerful than the
existing XML constraint languages in expressing
various constraints specifically dynamic and
composite rule-based ones. - Using OCL and the proposed UML profile for XCML
schema together with a UML profile for W3C XML
Schema can model XML constraints over XML data
models.
28Conclusions (Contd)
- UML modeling of XCML makes the design of XCML
instance documents model-driven. - The automation of XCML instance documents
generation can be done using XMI and XSLT
technologies.
29Future work
- OCL 2.0 vs XML Constraint Languages
- Xlink use in XCML
- Reference implementation
30Sample Schema document
31Conceptual mode of Employee profile(w/o
constraints)
32Logical model of Employee profile(w/o
constraints)
33Sample conceptual model
34Sample logical model