XML Data and Process Modelling - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

XML Data and Process Modelling

Description:

Models used for communication and interoperability by humans and ... expressive - tends to be incomprehensible. Business Process Modeling (design and execution) ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 37
Provided by: itu75
Category:

less

Transcript and Presenter's Notes

Title: XML Data and Process Modelling


1
XML Data and Process Modelling
  • Fall 2005
  • Thomas Hildebrandt
  • Programming, Logic and Semantics Group, ITU

2
Road Map
  • Why XML ?
  • XML data model, XML Namespaces, XMLSchema
  • XML Business Process ModelsWF and Com.
    patterns, the case of BPEL

3
Why XML?
  • Models used for communication and
    interoperability by humans and programs
  • inter-business and inter-application
  • XML the de facto standard for tailor-made
    specifications of (semi) structured data
    collections shared and exchanged between humans
    and programs
  • support for internationalisation (unicode) and
    platform independence (text based)

4
XML very briefly
  • XML eXtensible Markup Language
  • a merge of Hypertext languages and Markup
    Languages (SGML)
  • text markup tagsltgreeting stylebiggthello
    worldlt/greetinggt
  • a specific XML language constrains the use of tags

5
Recipe Example
  • semi-structured mix of tags and unstructured
    text

6
Ordered trees
The underlying data model of XML is that of
ordered, node labelled trees
7
Node types
  • text nodes
  • element nodes
  • attribute nodes
  • comment nodes
  • processing instruction nodes
  • root nodes

8
XML recipe collection as tree
9
Textual representation
  • properly nested, case sensitive tags
  • attributes in-lined in start element
  • predefined entities written as Unicode character
    references (e.g. lt as lt)
  • comments as lt!-- .... --gt
  • usually begins with an XML declarationlt?xml
    version1.0 encodingUTF-8?gt

10
Applications of XML
  • data-oriented (e.g. replacing relational DB)
  • document-oriented (e.g. XHTML)
  • protocols and programming languages (e.g.
    XMLSchema, XSLT, WSDL, SOAP, BPEL4WS )
  • hybrids (e.g. the RecipeML language)

11
XML Namespaces
  • The XML namespaces mechanism allows one to
    combine XML languages
  • ltexample xmlnsfoohttp//www.itu.dk/people/hilde
    /myfoospace xmlnshttp//www.itu.dk/people/hild
    e/mydefspacegtltfoofooelementgtlt/foofooelementgtlt
    /examplegt

12
Formal Language Specification
  • needed for computers/programs to understand the
    language
  • Consists of the Syntaxthe set of valid
    sentences and the Semanticsthe meaning of the
    valid sentences
  • Often only syntax is specified formally...

13
Syntax
  • Natural languages and programming languages are
    usually specified by a grammar (e.g. in
    Backus-Naur Form)
  • Examples the 40-year old program Eliza, PASCAL,
    Algol 60 programming language
  • Data collections are usually described by
    so-called schemas (e.g. databases and XML)

14
Schema languages
  • A Schema/grammar can be described in a
    Schema/grammar language
  • A schema processer/parser isused to validate
    (and normalize)a document

15
Why Schemas/grammars?
  • Humans write documents that programs can parse
    and give meaningful error messages to invalid
    docs
  • Why use standard schema language Standard
    parsers, program generation, ...
  • Schema language should be expressive, efficient
    and comprehensive

16
XMLSchema
  • Plenty of XML Schema languages, but DTDs and
    XMLSchema by far the most common
  • XMLSchema is the most expressive of the two (and
    is itself an XML language)
  • both uses regular expressions as subgrammar

17
Regular expressions
  • Build from symbols, ?, sequencing, and
  • Very effective (linear time, constant space)
  • Very comprehensive
  • Limited expressiveness Correspond to finite
    automata, that is, finite memory and thus can not
    express that a begin tag should be matched by an
    end tag

18
XMLSchema overview
  • Namespace declarations
  • Simple type definitions
  • Complex type definitions
  • Element declarations
  • Attribute declarations

19
Student Records
ltschema xmlns"http//www.w3.org/2001/XMLSchema"
xmlnss"http//www.brics.dk/ixwt/students
" targetNamespace"http//www.brics.dk/ix
wt/students"gt ltelement name"student"
type"sStudentType"/gt ltattribute name"id"
type"string"/gt ltattribute name"score"
type"sScore"/gt ltsimpleType name"Score"gt
ltrestriction base"integer"gt ltminInclusive
value"0"/gt ltmaxInclusive value"100"/gt
lt/restrictiongt lt/simpleTypegt ltcomplextType
name"StudentType"gt ltattribute ref"sid"
use"required"/gt ltattribute ref"sscore"
use"required"/gt lt/complextTypegt lt/schemagt
Definitions and declarations populate the target
namespace
20
Simple type examples
  • The student record example contains both
    primitive types and derived types ltattribute
    name"id" type"string"/gtltattribute name"score"
    type"sScore"/gtltsimpleType name"Score"gt
    ltrestriction base"integer"gt ltminInclusive
    value"0"/gt ltmaxInclusive value"100"/gt
    lt/restrictiongtlt/simpleTypegt

21
Derived types
  • Patterns (regular expressions)ltsimpleType
    name"percentage"gt ltrestriction base"string"gt
    ltpattern value"(0-91-90-9100)"/gt
    lt/restrictiongtlt/simpleTypegt
  • EnumerationltsimpleType name"passnonpass"gt
    ltrestriction base"string"gt ltenumeration
    value"passed"/gt ltenumeration value"not
    passed"/gt lt/restrictiongtlt/simpleTypegt
  • UnionltsimpleType name"mark"gtltuniongtltsimpleTypegt
    ltrestriction base"passnonpass"/gtlt/simpleTypegtltsi
    mpleTypegtltrestriction base"percentage"/gtlt/simpleT
    ypegtlt/uniongtlt/simpleTypegt

22
XMLSchema declarations
lt?xml version"1.0"?gt ltstudent xmlns"http//www.b
rics.dk/ixwt/students"
xmlnsxsi"http//www.w3.org/2001/XMLSchema-instan
ce" xsischemaLocation"http//www.brics.
dk/ixwt/students
http//www.itu.dk/courses/IXMR/student.xsd"gt
id"hilde071072" score"97" lt/studentgt
  • associates a Schema to an XML document
  • may appear at sub-elements

23
Complex Types
  • Complex types allow to specify elements and
    attributes as content of elementsExample with
    only attributesltelement name"student"
    type"sStudentType"/gtltcomplexType
    name"StudentType"gt ltattribute ref"sid"
    use"required"/gt ltattribute ref"sscore"
    use"required"/gtlt/complexTypegt
  • elements as content may be specified by a regular
    expression? Element reference ltelement
    ref"t..." cardinality /gt? Concatenation
    ltsequencegt ... lt/sequencegt? Union ltchoicegt ...
    lt/choicegtand cardinalities minOccurs, maxOccurs
    "0","1","..", "unbounded"(default
    cardinalities are 1)

24
ltelement name"order" type"norder_type"/gt lteleme
nt name"email" type"nemail_type"/gt ltattribute
name"id" type"unsignedInt"/gt ltcomplexType
name"order_type" mixed"true"gt ltchoicegt
ltelement name"address"gt ltsequencegt
ltelement name"street" type"string"/gt
ltelement name"number" type"positiveInteger"/gt
ltelement name"floor" type"string"/gt
lt/sequencegt lt/elementgt ltsequencegt
ltelement ref"nemail"
minOccurs"0" maxOccurs"unbounded"
default"no email provided"/gt ltelement
name"phone" type"nphone_type"/gt
lt/sequencegt lt/choicegt ltattribute ref"nid"
use"required"/gt ltattribute name"priority"
default"normal"gt ltsimpleTypegt ltrestriction
base"string"gt ltenumeration value"normal"/gt
ltenumeration value"high"/gt lt/restrictiongt
lt/simpleTypegt lt/attributegt lt/complexTypegt
25
XML Summary
  • de facto standard for tailor-made semi-structured
    data collections shared on the internet
  • use namespaces to combine XML languages
  • use XMLSchema to specify syntax
    formally,expressive - tends to be
    incomprehensible

26
Business Process Modeling(design and execution)
  • Web services compositionacross organizational
    boundaries
  • Technology push
  • Need to improve efficiency
  • BPEL4WS v1.1 Schemahttp//xml.coverpages.org/BPE
    L4WSv11-Schema-xsd.html

27
BPEL overview
  • Process PartnerLinks variables flowchart of
    activities
  • Primitive activities invoke, receive, reply,
    wait, assign, throw, terminate, empty
  • Structured activities sequence, flow, while,
    switch, pick, scope

28
WF Patterns in BPEL
  • Sequencing, Parallel Split Synchronisation
  • Exclusive Choice and Simple Merge

ltsequencegt ltflowgt lt!-- activityA1 --gt
lt!-- activityA2 --gt lt/flowgt lt!-- activity
B --gt lt/sequencegt
ltsequencegt ltswitchgt ltcase conditionC1gt
lt!-- activityA1 --gt lt/casegt ltcase
conditionC2gt lt!-- activityA2 --gt
lt/casegt lt/switchgt lt!-- activity C
--gt lt/sequencegt (Example of condition
getVariableData(status)rejected )
29
  • Multi-Choice and Synchronizing Merge(using the
    WSFL features)

30
  • Cycles (using while loops)
  • More detailed example (multible instances)

ltwhile conditionCgt ltsequencegt lt!--
activityA --gt lt!-- update condition data
--gt lt/sequencegt lt/whilegt
ltvariable namei typexsdinteger/gt ...
ltassigngtltcopygtltfrom expression0/gtltto
variablei/gtlt/copygt lt/assigngt ltwhile
conditionbpwsgetVariableData(i) !5gt
ltsequencegt ltinvoke .../gt ltassigngt
ltcopygtltfrom expressionbpwsgetVariableData(i)
1/gt ltto variablei/gt
lt/copygt lt/assigngt lt/sequencegt lt/whilegt
31
  • Multiple Instances with Synchronisation

32
  • Deferred Choice (using pick)
  • Cancel Activity Using fault and compensation
    handlers
  • Cancel Case ltterminate/gt action

ltpick namemessageortimeoutgt ltonMessage
partnerLink.. ...gt lt!-- activityA --gt
lt/onMessagegt ltonAlarm forPT10Dgt lt!--
activityB --gt lt/onAlarmgt lt/pickgt
33
Patterns not directly supported in BPEL
  • WP8 Multi-merge
  • WP17 Interleaved Parallel Routing
  • WP18 Milestone

34
Communication Patterns
  • Synchronous CommunicationRequest/reply and
    One-way (empty reply)
  • Asynchronous CommunicationMessage passing no
    outputContainer
  • No direct support for publish/subscribe nor
    broadcast

35
BPEL conclusions
  • Anchored in the web services world
  • Mix of flow/graph and control structures
  • Expressive, perhaps too expressive
  • Formalisation could provide precise semantics
  • Not the only proposal (BPML, XPDL, WSCL,..

36
Course Evaluation
  • Please spend the time... we do listen to your
    comments!!
Write a Comment
User Comments (0)
About PowerShow.com