An Extensible Constraint Markup Language Specification, Modeling, and Processing - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

An Extensible Constraint Markup Language Specification, Modeling, and Processing

Description:

Semantic constraints: those restrictions on the content of XML documents. ... (true/false statement) or a rule (if-then-else) with embedded assertions. ... – PowerPoint PPT presentation

Number of Views:47
Avg rating:3.0/5.0
Slides: 35
Provided by: jhu66
Category:

less

Transcript and Presenter's Notes

Title: An Extensible Constraint Markup Language Specification, Modeling, and Processing


1
An Extensible Constraint Markup
LanguageSpecification, Modeling, and Processing

Dr. Jingkun Hu, Philips Medical Systems Dr. Lixin
Tao, Pace University 18 November 2004
2
Outline
  • XML constraints
  • Problem statement
  • Previous work
  • eXtensible Constraint Markup Language (XCML)
  • Visual modeling of XML constraints
  • XCML constraint processing
  • Conclusions and future work

3
What 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.

4
Semantic XML Constraints
5
Sample 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)

6
Sample 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 .

7
Problem 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.

8
Problem statement (Contd)
  • Manually creating XML constraint documents is a
    painful task.
  • Can XML constraints be visually modeled so that
    constraint documents are automatically generated?

9
Previous work
  • W3C XML Schemas (WXS)
  • Schematron, Jelliffe
  • XML Constraint Specification Language (XCSL),
    Ramalho
  • eXtensible Inter-Nodes Constraint Markup Language
    (XincaML), IBM
  • Xlinkit, Nentwich

10
eXtensible Constraint Markup Language (XCML)-
Specification
11
Syntax
12
Sample 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
13
Sample XCML definitions (Contd)
ltConstraint contextpayrollgt ltParametergt
ltnamegtratelt/namegt
lttypegtfloatlt/typegt ltdefaultValuegt0.07lt/de
faultValuegt lt/Parametergt ltAssertion
testtaxRaterate/gt lt/Constraintgt
14
Sample 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
15
Comparison of XCML with existing XML constraint
languages
16
XCML constraints - Visual modeling
17
XML 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

18
Three-level-design approach
(a)
(b)
19
UML profile for XCML schema
20
Sample physical models
  • XML Schema document
  • XCML instance document

21
XML 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

22
XCML 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
23
XCML constraints - Processing
24
Design and implementation
  • Generation of XML Schemas and XCML instance
    documents
  • XML document validation
  • Technologies UML 1.4, XMI 1.1, and XSLT 1.0

25
Workflow of generating XML Schemas and XCML
instance documents
26
Workflow of XML document validation
27
Conclusions
  • 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.

28
Conclusions (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.

29
Future work
  • OCL 2.0 vs XML Constraint Languages
  • Xlink use in XCML
  • Reference implementation

30
Sample Schema document
31
Conceptual mode of Employee profile(w/o
constraints)
32
Logical model of Employee profile(w/o
constraints)
33
Sample conceptual model
34
Sample logical model
Write a Comment
User Comments (0)
About PowerShow.com