490 likes | 642 Views
XML for Interoperability. Robin Burke ECT 360. Outline. Schemas Survey: last week The Semantic Web Web services SOAP RDF. Schemas. Some schemas not very detailed to be expected in a draft Some schemas missing a multi-value property <author-list> <author>John Doe</author>
E N D
XML for Interoperability Robin Burke ECT 360
Outline • Schemas • Survey: last week • The Semantic Web • Web services • SOAP • RDF
Schemas • Some schemas not very detailed • to be expected in a draft • Some schemas missing a multi-value property <author-list> <author>John Doe</author> <author>Jane Doe</author> </author-list>
Survey • Current syllabus for week 10 • Media • SMIL • Synchronized Media Integration Language • WML • Wireless Markup Language • Alternative • XSLT 2.0 • XPath 2.0
What the web is good at • Presenting information to people • Allowing people access to a wide range of information services
What the web is not good at • Application integration • Must build site-specific client • “screen scraping” • Must deal with site-to-site heterogeneity • Classic example • FedEx site offers package tracking • What if you have 100 packages? • What if you have 10 different shippers?
Semantic Web • “The web for softbots” • do for applications what the web does for people
Requirements • What do we need • we need to be able to find and invoke applications • we need to understand the results of such invocations
Solutions • How to find and invoke distributed services • web services • How to understand results • intelligible meta-data • shared ontologies
Web services • Family of standards • UDDI • Universal Description, Discovery and Integration • how do I create a catalog where services can be found? • WSDL • Web Services Definition Language • how do I describe a service to its users? • SOAP • Simple Object Access Protocol • how do I communicate with the service
WSDL • message(s) accepted and emitted: abstract description (XML Schema) • network protocol(s) and message format(s) • operation: exchange of messages • port type: collection of operations • port: implementation of a port type • service: collection of ports
UDDI • registry system • business entities, business services, specifications, service types • standard taxonomies to describe businesses, services, and service types
SOAP • message construction (envelope, header, body) • message exchange patterns (MEP) and how to define more • processing model for messaging: originator, intermediaries, destination • extensibility mechanism • fault system • bindings to transport protocols (HTTP, SMTP, ...)
Operation patterns • portType element • one-way • service receives a message; single input element • request-response • service receives a message and sends a response; one input and one output element • solicit-response • service sends a message and receives a response; one output and one input element • notification • service sends a message; single output element
Example • Google WSDL
Envelope • Embedded Information • Namespaces • Encoding information • Header • Optional • Can be handled by intermediaries • Body • Mandatory • Handled only by ultimate receiver
Header • Used for extension • Context • Authentication • Transaction • Management • Made of Header blocks
Body • Made of Body blocks • Carry main end-to-end information • Application data that will be consumed by Ultimate SOAP receiver • RPC method and parameters • SOAP fault
Example • SOAP message • Google query
Example • Google response
Running code import com.google.soap.search.*; public class Test { public static void main(String[] args) { try { GoogleSearch search = new GoogleSearch(); search.setKey(“1234123412341234"); search.setQueryString(args[0]); search.setSafeSearch(true); GoogleSearchResult result = search.doSearch(); System.out.println(result.toString()); } catch(Exception e) { e.printStackTrace();} }}
Where’s the XML? • XML is under the hood • It permits the interoperation • but the programmer can forget about it • Tools do the work • VB.Net • JAXB
Semantic Web Layers • RDF • Resource Description Framework • RDF Schema • OWL • Web Ontology Language
Differences • RDF • Assert facts • The ECT 360 homepage is... • RDF Schema • Create vocabularies and use them • ECT 360 is a CTICourse • OWL • Describe relationships between vocabularies • CTICourse in CTISchema is the same as Class in UICSchema
Semantic Web Idea • Question • What courses at UIC cover the same material as ECT 360 at DePaul CTI? • With the Semantic Web • Get description of ECT 360 • Crawl UIC site for descriptions of courses • Match UIC descriptions against ECT 360 descriptions
Metadata • Information about other data: • web page • Author, timestamp, content-type. • photograph • Photographer, subject, timestamp, camera model, film used. • astronomical observation • date/time, coordinates, instrument, part of the instrument.
RDF • RDF is a specification that defines a model for representing the world, and a syntax for serializing and exchanging that model.
Example: Book reviews • Some web pages are reviews of something else: a book, a recording, another web page. • The item being reviewed has various properties: a title, an author, an ISBN (for books, at least). • Possibility • create an XML document with this information • link somehow from web page
Problem • What schema do we use? • our own? • create a consortium of reviewers? • This is a general problem of metadata • better to have a general solution
The metadata idea • Let authors make assertions about their documents • Standardize the format • but not the content • Should build on web technologies
RDF Building Blocks • Resource • Something with a URI • Property • Special type of resource • With a name • Can also have properties • Statement • Resource / Property / Value triple • Statements may refer to the same resource
Example • Statements • this review is about a book isbn 01930110111 • this book is published by Manning • this book is titled “XSLT Quickly” • this book was written by a person • that person has first name Bob • that person has last name DuCharme • that person has a homepage
Resources • Defined by URI • Not necessarily a URL • Like namespaces
Properties • Can be a literal or a resources • Multiple values allowed • Properties can have properties • Sam owns shares in Enron • The quantity of this ownership relation is 1000 • Properties also have URIs • Typically a base URI with associated prefix • like namespaces
Example: Dublin core • Metadata for “published things” • Created by a library science consortium • Defines elements • creator • publisher • isbn • date • format
Dublin Core • Refer to the Dublin Core namespace • in RDF document • dc: typical prefix
XML Serialization <rdf:RDF xmlns:foaf="http://xmlns.com/foaf/0.1/“ xmlns:dc="http://purl.org/dc/elements/1.1/“ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“ xmlns:rev="http://amk.ca/xml/review/1.0#"> <rev:Review rdf:about="http://example.com/rev1"> <rev:subject rdf:resource="urn:isbn:1930110111"/> </rev:Review> <rdf:Description rdf:about=”urn:isbn:1930110111” <dc:title>XSLT Quickly</dc:title> <dc:creator rdf:resource=“http://example.com/auth/0042”/> <dc:publisher>Manning</dc:publisher> </rdf:Description> <rdf:Description rdf:about="http://example.com/auth/0042"> <foaf:firstName>Bob</FOAF:firstName> <foaf:homepage rdf:resource="http://www.snee.com/bob/"/> <foaf:pastProject rdf:resource="urn:isbn:1930110111"/> <foaf:surname>DuCharme</FOAF:surname> </rdf:Description> </rdf:RDF>
With RDF • We create assertions • triples • Vocabulary creation based on namespaces • Verbose • Low-level
RDF Application: RSS • RSS • RDF Site Summary • used to propagate web content • IE Channels • Netscape My Navigator • blogs • Example
Semantic Web • Important vision for the future • Some tools available now