Top Banner
Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada
26

Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Dec 27, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Pervasive e-commerce with XML

Babak EsfandiariCarleton University

Ottawa, Canada

Page 2: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

XML introduction eXtensible Markup Language “a markup language for documents

containing structured information” (Walsh) this structure is defined mainly with a set

of tags subset of SGML HTML can be seen as an instance of XML

(it is not really though, but that is not important…)

Page 3: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

XML example

<?xml version="1.0" ?><!-- a simple tagset for museums><Museum name="Louvre">

<city> Paris</city>

</Museum>

Page 4: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

DTD Document Type Definition Describes the XML tagset

<!DOCTYPE Museum [ <!ELEMENT Museum (city)> <!ATTLIST Museum name CDATA #REQUIRED> <!ELEMENT city (#PCDATA)>]>

Not mandatory (!)

Page 5: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

XML - what for? content is independent from rendering meta-data makes search easier standard tags enable data interchange

across tools format for data and object persistence,

human readable and editable no need for a custom parser anymore

Page 6: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

TourTags “The purpose of TourTags.org is to

foster dialogue within the community in order to arrive at open standards for conducting electronic commerce by settling on common tag sets and methods in which they are to be used.”

supports IFITT’s RMSIG

Page 7: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

XML and TourTags derive a tagset from RMSIG specs discuss/modify the tagset use the tagset for B2B (ebXML) allow device-neutral access to

business info we have a process…

Page 8: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

The Acronym Hell Diagram our process is a series of

transformations

UML

XMI

XML/DTD

ebXML

Webform

XML

VoiceXML

WML

HTML

meta-data registration

document

display

Page 9: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Meta-data Why not directly model tags?

Tags are not for modeling! Lack of a graphical notation Semantically poor:

Hard to represent relationships XML can be seen as one

possible mapping of a model The RMSIG has chosen

UML…

UML

XMI

XML/DTD

Page 10: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Meta-data UML: Unified Modeling

Language Object-oriented Graphical Covers:

Requirements Static representation Activities and processes

UML

XMI

XML/DTD

Page 11: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Meta-data A UML class diagram:

UML

XMI

XML/DTD

-name : String

Museum City

Page 12: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Meta-data But we need the tags! Is it possible to transform

UML into XML? We can use XMI

XMI is the direct textual representation of UML using the XML format

Most UML tools support XMI

UML

XMI

XML/DTD

Page 13: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Meta-data A sample XMI document:<Class>

<name>Museum</name><feature>

<Attribute><name>name</name></Attribute>

</feature></Class>

UML

XMI

XML/DTD

Page 14: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Meta-data We still need to transform

XMI into our XML tagset Since a DTD describes the

structure of an XML document, it is the ideal target!

What is the easiest way to do the concrete transformation?

UML

XMI

XML/DTD

Page 15: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Transformations Different methods:

Parsing: use existing XML parsing libraries based on standard APIs (SAX, DOM) with a programming language

Transformations: specify the transformations in a (yet

another) XML document called an XSLT stylesheet

Use an XSLT processor (Saxon, XT, …)

Page 16: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

XSLT example (excerpt)<xsl:stylesheet><xsl:template match="Class">

blah <xsl:value-of select="name"/> blah<xsl:apply-templates select="feature/Attribute"/>

</xsl:template><xsl:template match="feature/Attribute">

<xsl:value-of select="name"/></xsl:template></xsl:stylesheet>

Page 17: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

XSLT example The XSLT in the previous slide, applied

on the Museum XMI, should generate something like:blah Museum blah name

Nothing exciting but you get the idea!

Page 18: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Meta-data Some of the issues in the

transformation from XMI to DTD: Ambiguity in choice of attributes and

elements -> open for discussion! Inheritance: compound the inherited

attributes Composition: recursively add sub-

elements, or use separate documents

DTDs support for primitive types is limited… XML schema an alternative

UML

XMI

XML/DTD

Page 19: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Registration The resulting DTDs can now be

used for B2B e-commerce We now have a domain

“ontology” to base transactions on!

We can use this ontology to: Publish/advertize a business Search for a business

We need a registry to enable that

ebXML

Webform

Page 20: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Registration ebXML is one of the leading

consortiums for e-business It describes a standard for B2B

registries Third parties (TourTags?) have the

opportunity to create and host such registries

To access such registries and allow publishing and search, Web forms are an intuitive front-end interface Guess what…

ebXML

Webform

Page 21: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Registration We can use the DTDs and XSLT

to generate such web forms! The web forms for publishing and

search are very similar Each leaf element or attribute

becomes a field to fill in Better support (than DTDs) for data

types would allow for a better customization of the data fields

ebXML

Webform

Museum name:

Page 22: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Registration Different deployment

scenarios are possible for registries: Traditional Client/server Peer to peer

Decentralized Less resource intensive

ebXML

Webform

Page 23: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Document rendering The result of a registry

search is an XML document that follows the structure specified by our DTD

Such a document does not contain any instructions for rendering (i.e. display)

This is a good thing!

XML

VoiceXML

WML

HTML

Page 24: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Search and rendering rendering adapted to

device: XML -> HTML for web browser XML -> WML for cell phones XML -> VoiceXML for regular

phones Yes, we can use XSLT again! No duplication of data! No need to maintain

redundant documents!

XML

VoiceXML

WML

HTML

Page 25: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

Conclusion A completely XML-based process

that takes us from the inception of a domain ontology to the delivery of business info

The process relies on a series of transformations

Page 26: Pervasive e-commerce with XML Babak Esfandiari Carleton University Ottawa, Canada.

References xml.org rmsig.org tourtags.org ebxml.org

It had to be on the web!