[DSBW Spring 2010] Unit 10: XML and Web And beyond


Published on

[DSBW Spring 2010] Unit 10: XML and Web And beyond

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

[DSBW Spring 2010] Unit 10: XML and Web And beyond

  1. 1. <ul><li>XML </li></ul><ul><ul><li>DTD, XMLSchema </li></ul></ul><ul><ul><li>XSL, Xquery </li></ul></ul><ul><li>Web Services </li></ul><ul><ul><li>SOAP, WSDL </li></ul></ul><ul><ul><li>RESTful Web Services </li></ul></ul><ul><li>Semantic Web </li></ul><ul><ul><li>Introduction </li></ul></ul><ul><ul><li>RDF, RDF Schema, OWL, SPARQL </li></ul></ul>Unit 10: XML and Web and Beyond
  2. 2. <ul><li>“ ... is a simple, very flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere. ” </li></ul><ul><li>W3 Consortium </li></ul><ul><li>XML … </li></ul><ul><ul><li>is not a solution but a tool to build solutions </li></ul></ul><ul><ul><li>is not a language but a meta-language that require interoperating applications that use it to adopt clear conventions on how to use it </li></ul></ul><ul><ul><li>is a standardized text format that is used to represent structured information </li></ul></ul>e X tensible M arkup L anguage
  3. 3. SGML, XML and their applications HyTime HTML XHTML SMIL SOAP WML SGML XML Meta-Markup Language Markup Language Application
  4. 4. <ul><li>The document has exactly one root element </li></ul><ul><li>The root element can be preceded by an optional XML declaration </li></ul><ul><li>Non-empty elements are delimited by both a start-tag and an end-tag. </li></ul><ul><li>Empty elements are marked with an empty-element (self-closing) tag </li></ul><ul><li>Tags may be nested but must not overlap </li></ul><ul><li>All attribute values are quoted with either single (') or double (&quot;) quotes </li></ul><ul><ul><ul><ul><li><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><address> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><street> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><line>123 Pine Rd.</line> </li></ul></ul></ul></ul><ul><ul><ul><ul><li></street> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><city name=&quot;Lexington&quot;/> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><state abbrev=&quot;SC&quot;/> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><zip base=&quot;19072&quot; plus4=&quot;&quot;/> </li></ul></ul></ul></ul><ul><ul><ul><ul><li></address> </li></ul></ul></ul></ul>Well-Formed XML Documents
  5. 5. <ul><li>Are well-formed XML documents </li></ul><ul><li>Are documents that conform the rules defined by certain schemas </li></ul><ul><li>Schema: define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. Two ways to define a schema: </li></ul><ul><ul><li>DTD: Document Type Definition </li></ul></ul><ul><ul><li>XML Schema </li></ul></ul>Valid XML Documents
  6. 6. <ul><ul><li><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> </li></ul></ul><ul><ul><li><!DOCTYPE address [ </li></ul></ul><ul><ul><li><!ELEMENT address (street, city, state, zip)> </li></ul></ul><ul><ul><li><!ELEMENT street line+> </li></ul></ul><ul><ul><li><!ELEMENT line (#PCDATA)> </li></ul></ul><ul><ul><li><!ELEMENT city (#PCDATA)> </li></ul></ul><ul><ul><li><!ELEMENT state (#PCDATA)> </li></ul></ul><ul><ul><li><!ELEMENT zip (#PCDATA)> ]> </li></ul></ul><ul><ul><li><address> ... </address> </li></ul></ul><ul><ul><li><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> </li></ul></ul><ul><ul><li><!DOCTYPE address SYSTEM &quot;http://dtd.mycompany.com/address.dtd&quot;> </li></ul></ul><ul><ul><li><address> ... </address> </li></ul></ul>DTD Example: Embedded and External Definitions
  7. 7. <ul><li>DTD is not integrated with Namespace technology so users cannot import and reuse code </li></ul><ul><li>DTD does not support data types other than character data </li></ul><ul><li>DTD syntax is not XML compliant </li></ul><ul><li>DTD language constructs are no extensible </li></ul>DTD Limitations
  8. 8. <ul><li><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> </li></ul><ul><li><xsd:schema xmlns:xsd=&quot;http://www.w3.org/2000/10/XMLSchema&quot; elementFormDefault=&quot;qualified&quot;> </li></ul><ul><li><xsd:import namespace=&quot; &quot;/> </li></ul><ul><li><xsd:element name=&quot;address&quot;> </li></ul><ul><li><xsd:complexType> </li></ul><ul><li><xsd:sequence> </li></ul><ul><li><xsd:element name=&quot;street&quot;> </li></ul><ul><li><xsd:complexType> </li></ul><ul><li><xsd:all maxOccurs=&quot;unbounded&quot;> </li></ul><ul><li><xsd:element name=&quot;line&quot; type=&quot;xsd:string&quot;/> </li></ul><ul><li></xsd:all> </li></ul><ul><li></xsd:complexType> </li></ul><ul><li></xsd:element> </li></ul><ul><li><xsd:element name=&quot;city&quot; type=&quot;xsd:string&quot;/> </li></ul><ul><li><xsd:element name=&quot;state&quot; type=&quot;xsd:string&quot;/> </li></ul><ul><li><xsd:element name=&quot;zip&quot; type=&quot;xsd:string&quot;/> </li></ul><ul><li></xsd:sequence> </li></ul><ul><li></xsd:complexType> </li></ul><ul><li></xsd:element> </li></ul><ul><li></xsd:schema> </li></ul>XML Schema: Example
  9. 9. <ul><li>Using a programming language and the SAX API. </li></ul><ul><ul><li>SAX is a lexical, event-driven interface in which a document is read serially and its contents are reported as &quot;callbacks&quot; to various methods on a handler object of the user's design </li></ul></ul><ul><li>Using a programming language and the DOM API. </li></ul><ul><ul><li>DOM allows for navigation of the entire document as if it were a tree of &quot;Node&quot; objects representing the document's contents. </li></ul></ul><ul><li>Using a transformation engine and a filter </li></ul><ul><ul><li>XSLT, XQuery, etc </li></ul></ul>Processing XML Documents
  10. 10. <ul><li>Alternative/complement to HTML </li></ul><ul><ul><li>XML + CSS, XML + XSL, XHTML </li></ul></ul><ul><li>Declarative application programming/configuration </li></ul><ul><ul><li>Configuration files, descriptors, etc. </li></ul></ul><ul><li>Data exchange among heterogeneous systems </li></ul><ul><ul><li>B2B, e-commerce: ebXML </li></ul></ul><ul><li>Data Integration from heterogeneous sources </li></ul><ul><ul><li>Schema mediation </li></ul></ul><ul><li>Data storage and processing </li></ul><ul><ul><li>XML Databases, XQuery (XPath) </li></ul></ul><ul><li>Protocol definition </li></ul><ul><ul><li>SOAP, WAP, WML, etc. </li></ul></ul>XML Uses
  11. 11. <ul><li>XSL serves the dual purpose of </li></ul><ul><ul><li>transforming XML documents </li></ul></ul><ul><ul><li>exhibiting control over document rendering </li></ul></ul><ul><li>XSL consists of two parts: </li></ul><ul><ul><li>XSL Transformations (XSLT): </li></ul></ul><ul><ul><ul><li>An XML language for transforming XML documents </li></ul></ul></ul><ul><ul><ul><li>It uses the XML Path Language (XPath) to search and transverse the element hierarchy of XML documents </li></ul></ul></ul><ul><ul><li>XSL Formatting Objects (XSL-FO): </li></ul></ul><ul><ul><ul><li>An XML language for specifying the visual formatting of an XML document. </li></ul></ul></ul><ul><ul><ul><li>It is a superset of the CSS functionally designed to support print layouts. </li></ul></ul></ul>eXtensible Stylesheet Language: XSL
  12. 12. <ul><li><bib> </li></ul><ul><li><book year=&quot;1994&quot;> </li></ul><ul><li><title>TCP/IP Illustrated</title> </li></ul><ul><li><author><last>Stevens</last><first>W.</first></author> </li></ul><ul><li><publisher>Addison-Wesley</publisher> </li></ul><ul><li><price>65.95</price> </li></ul><ul><li></book> </li></ul><ul><li><book year=&quot;1992&quot;> </li></ul><ul><li><title>Advanced Programming in the Unix environment</title> </li></ul><ul><li><author><last>Stevens</last><first>W.</first></author> </li></ul><ul><li><publisher>Addison-Wesley</publisher> </li></ul><ul><li><price>65.95</price> </li></ul><ul><li></book> </li></ul><ul><li><book year=&quot;2000&quot;> </li></ul><ul><li><title>Data on the Web</title> </li></ul><ul><li><author><last>Abiteboul</last><first>Serge</first></author> </li></ul><ul><li><author><last>Suciu</last><first>Dan</first></author> </li></ul><ul><li><publisher>Morgan Kaufmann Publishers</publisher> </li></ul><ul><li><price>39.95</price> </li></ul><ul><li></book> </li></ul><ul><li></book> </li></ul><ul><li></bib> </li></ul>XQuery (XML Query): Example ( source )
  13. 13. <ul><li><results> </li></ul><ul><li>{ let $a := doc(&quot;http://bstore1.example.com/bib/bib.xml&quot;)//author </li></ul><ul><li>for $last in distinct-values($a/last), </li></ul><ul><li>$first in distinct-values($a[last=$last]/first) </li></ul><ul><li>order by $last, $first </li></ul><ul><li>return </li></ul><ul><li><author> </li></ul><ul><li><name> </li></ul><ul><li><last> { $last } </last><first> { $first } </first> </li></ul><ul><li></name> </li></ul><ul><li>{ for $b in doc(&quot;http://bstore1.example.com/bib.xml&quot;)/bib/book </li></ul><ul><li>where some $ba in $b/author </li></ul><ul><li>satisfies ($ba/last = $last and $ba/first=$first) </li></ul><ul><li>return $b/title } </li></ul><ul><li></author> } </li></ul><ul><li></results> </li></ul>XQuery (XML Query): Example ( query ) For each author, retrieve its last, first names as well as the title of its books, ordered by last, first names
  14. 14. <ul><li><results> </li></ul><ul><li><author> </li></ul><ul><li><name> </li></ul><ul><li><last> Abiteboul </last><first> Serge </first> </li></ul><ul><li></name> </li></ul><ul><li><title>Data on the Web</title> </li></ul><ul><li></author> </li></ul><ul><li><author> </li></ul><ul><li><name> </li></ul><ul><li><last> Stevens </last><first> W. </first> </li></ul><ul><li></name> </li></ul><ul><li><title>TCP/IP Illustrated</title> </li></ul><ul><li><title>Advanced Programming in the Unix environment</title> </li></ul><ul><li></author> </li></ul><ul><li><author> </li></ul><ul><li><name> </li></ul><ul><li><last> Suciu </last><first> Dan </first> </li></ul><ul><li></name> </li></ul><ul><li><title>Data on the Web</title> </li></ul><ul><li></author> </li></ul><ul><li></results> </li></ul>XQuery (XML Query): Example ( result )
  15. 15. <ul><li>People and communities have data stores and applications to share </li></ul><ul><li>Vision : </li></ul><ul><ul><li>Expand the Web to include more machine-understandable resources </li></ul></ul><ul><ul><li>Enable global interoperability between resources you know should be interoperable as well as those you don't yet know should be interoperable </li></ul></ul><ul><li>Key Web technologies: </li></ul><ul><li>Web Services: Web of Programs </li></ul><ul><ul><li>Standards for interactions between programs, linked on the Web </li></ul></ul><ul><ul><li>Easier to Expose and Use services (and data they provide) </li></ul></ul><ul><li>Semantic Web: Web of Data </li></ul><ul><ul><li>Standards for things, relationships and descriptions, linked on the Web </li></ul></ul><ul><ul><li>Easier to Understand, Search for, Share, Re-Use, Aggregate, Extend information </li></ul></ul>A Smarter Web Is Possible
  16. 16. Web Services <ul><li>“ A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP -messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards” . Web Services Glossary, W3C, http://www.w3.org/TR/ws-gloss/ </li></ul>UDDI: Universal Description, Discovery and Integration
  17. 17. <ul><li>SOAP is a simple XML based protocol to let applications exchange information over HTTP. </li></ul><ul><li>A SOAP message is a XML document containing the following elements: </li></ul><ul><ul><li>A required Envelope element that identifies the XML document as a SOAP message </li></ul></ul><ul><ul><li>An optional Header element that contains header information </li></ul></ul><ul><ul><li>A required Body element that contains call and response information </li></ul></ul><ul><ul><li>An optional Fault element that provides information about errors that occurred while processing the message </li></ul></ul>Simple Object Access Protocol (SOAP)
  18. 18. <ul><ul><li>POST /InStock HTTP/1.1 </li></ul></ul><ul><ul><li>Host: www.stock.org </li></ul></ul><ul><ul><li>Content-Type: application/soap+xml; charset=utf-8 </li></ul></ul><ul><ul><li>Content-Length: nnn </li></ul></ul><ul><ul><li><?xml version=&quot;1.0&quot;?> </li></ul></ul><ul><ul><li><soap:Envelope </li></ul></ul><ul><ul><li>xmlns:soap=&quot;http://www.w3.org/2001/12/soap-envelope&quot; </li></ul></ul><ul><ul><li>soap:encodingStyle=&quot;http://www.w3.org/2001/12/soap-encoding&quot;> </li></ul></ul><ul><ul><li><soap:Body xmlns:m=&quot;http://www.stock.org/stock&quot;> </li></ul></ul><ul><ul><li><m:GetStockPrice> </li></ul></ul><ul><ul><li><m:StockName>IBM</m:StockName> </li></ul></ul><ul><ul><li></m:GetStockPrice> </li></ul></ul><ul><ul><li></soap:Body> </li></ul></ul><ul><ul><li></soap:Envelope> </li></ul></ul>SOAP Request: Example
  19. 19. <ul><ul><li>HTTP/1.1 200 OK </li></ul></ul><ul><ul><li>Content-Type: application/soap; charset=utf-8 </li></ul></ul><ul><ul><li>Content-Length: nnn </li></ul></ul><ul><ul><li><?xml version=&quot;1.0&quot;?> </li></ul></ul><ul><ul><li><soap:Envelope </li></ul></ul><ul><ul><li>xmlns:soap=&quot;http://www.w3.org/2001/12/soap-envelope&quot; </li></ul></ul><ul><ul><li>soap:encodingStyle=&quot;http://www.w3.org/2001/12/soap-encoding&quot;> </li></ul></ul><ul><ul><li><soap:Body xmlns:m=&quot;http://www.stock.org/stock&quot;> </li></ul></ul><ul><ul><li><m:GetStockPriceResponse> </li></ul></ul><ul><ul><li><m:Price>34.5</m:Price> </li></ul></ul><ul><ul><li></m:GetStockPriceResponse> </li></ul></ul><ul><ul><li></soap:Body> </li></ul></ul><ul><ul><li></soap:Envelope> </li></ul></ul>SOAP Response: Example
  20. 20. Web Services Description Language (WSDL) <ul><li>A WSDL document describes a web service using these major elements: </li></ul><ul><ul><li><portType>: The operations performed by the web service </li></ul></ul><ul><ul><li><message>: The messages used by the web service </li></ul></ul><ul><ul><li><types>: The data types used by the web service </li></ul></ul><ul><ul><li><binding>: The communica-tion protocols used by the web service </li></ul></ul><ul><li><definitions> </li></ul><ul><ul><li><types> </li></ul></ul><ul><ul><li>type definition ...... </li></ul></ul><ul><ul><li></types> </li></ul></ul><ul><ul><li><message> </li></ul></ul><ul><ul><li>message definition ... </li></ul></ul><ul><ul><li></message> </li></ul></ul><ul><ul><li><portType> </li></ul></ul><ul><ul><li>port definition .... </li></ul></ul><ul><ul><li></portType> </li></ul></ul><ul><ul><li><binding> </li></ul></ul><ul><ul><li>binding definition .. </li></ul></ul><ul><ul><li></binding> </li></ul></ul><ul><li></definitions> </li></ul>
  21. 21. <ul><ul><ul><li><message name=“getStockPriceRequest&quot;> </li></ul></ul></ul><ul><ul><ul><li><part name=&quot;StockName&quot; type=&quot;xs:string&quot;/> </li></ul></ul></ul><ul><ul><ul><li></message> </li></ul></ul></ul><ul><ul><ul><li><message name=“getStockPriceResponse&quot;> </li></ul></ul></ul><ul><ul><ul><li><part name=&quot;Price&quot; type=&quot;xs:float&quot;/> </li></ul></ul></ul><ul><ul><ul><li></message> </li></ul></ul></ul><ul><ul><ul><li><portType name=“StockMarket&quot;> </li></ul></ul></ul><ul><ul><ul><li><operation name=“getStockPrice&quot;> </li></ul></ul></ul><ul><ul><ul><li><input message=&quot;getStockPriceRequest&quot;/> </li></ul></ul></ul><ul><ul><ul><li><output message= &quot;getStockPriceTermResponse&quot;/> </li></ul></ul></ul><ul><ul><ul><li></operation> </li></ul></ul></ul><ul><ul><ul><li></portType> </li></ul></ul></ul>WSDL Document: Example (fragment)
  22. 22. <ul><li>The overhead associated to SOAP makes it impractical in high-traffic scenarios </li></ul><ul><li>Representational State Transfer (REST): architectural style for networked systems based on the following principles: </li></ul><ul><ul><li>Application state and functionality are abstracted into resources </li></ul></ul><ul><ul><li>Every resource is uniquely addressable by an URI </li></ul></ul><ul><ul><li>Client-Server: Clients pull resource representations </li></ul></ul><ul><ul><li>Stateless: each request from client to server must contain all needed information. </li></ul></ul><ul><ul><li>Uniform interface: all resources are accessed with a generic interface (HTTP-based) </li></ul></ul><ul><ul><li>Interconnected resource representations </li></ul></ul><ul><ul><li>Layered components - intermediaries, such as proxy servers, cache servers, to improve performance, security </li></ul></ul>RESTful Web Services
  23. 23. <ul><li>A RESTful web service is a simple web service implemented using HTTP and the principles of REST. </li></ul><ul><li>A RESTful web service is a collection of resources. Its definition comprises: </li></ul><ul><ul><li>The URI for the web service as a whole (<baseURI>) </li></ul></ul><ul><ul><li>A URI scheme to address individual resources, e.g. <baseURI>/<ID> </li></ul></ul><ul><ul><li>The MIME type of the data supported by the web service (JSON, XML) </li></ul></ul><ul><ul><li>The set of operations supported by the web service using HTTP methods: </li></ul></ul><ul><ul><ul><li>POST: To create a resource on the server </li></ul></ul></ul><ul><ul><ul><li>GET: To retrieve the current state of the resource </li></ul></ul></ul><ul><ul><ul><li>PUT: To change the state of a resource or to update it </li></ul></ul></ul><ul><ul><ul><li>DELETE: To remove or delete a resource </li></ul></ul></ul>RESTful Web Services (cont.)
  24. 24. RESTful WS: Example (adapted from Wikipedia )
  25. 25. <ul><li>“ The Web was designed as an information space, with the goal that it should be useful not only for human-human communication, but also that machines would be able to participate and help. One of the major obstacles to this has been the fact that most information on the Web is designed for human consumption , and even if it was derived from a database with well defined meanings (in at least some terms) for its columns, that the structure of the data is not evident to a robot browsing the web. Leaving aside the artificial intelligence problem of training machines to behave like people, the Semantic Web approach instead develops languages for expressing information in a machine processable form ” . </li></ul><ul><li>&quot;If HTML and the Web made all the online documents look like one huge book , RDF, schema, and inference languages will make all the data in the world look like one huge database &quot; </li></ul><ul><li>Tim Berners-Lee </li></ul>Semantic Web = The Web of Data
  26. 26. The Current Web (1/2) <ul><li>Resources: </li></ul><ul><ul><li>Identified by URI's </li></ul></ul><ul><ul><li>untyped </li></ul></ul><ul><li>Links: </li></ul><ul><ul><li>href, src, ... </li></ul></ul><ul><ul><li>limited, non-descriptive </li></ul></ul><ul><li>Users: </li></ul><ul><ul><li>A lot of information, but its meaning must be interpreted and deduced from the content as it has been done since millenniums </li></ul></ul><ul><li>Machines: </li></ul><ul><ul><li>They don’t understand. </li></ul></ul>
  27. 27. <ul><li>The Public Web </li></ul><ul><ul><li>The web found when searching and browsing </li></ul></ul><ul><ul><li>At least 21 billion pages indexed by standard search engines </li></ul></ul><ul><li>The Deep Web </li></ul><ul><ul><li>Large data repositories that require their own internal searches. </li></ul></ul><ul><ul><li>About 6 trillion documents not indexed by standard search engines. </li></ul></ul><ul><li>The Private Web </li></ul><ul><ul><li>Password-protected sites and data: corporate intranets, private networks, susbscription-based services, etc. </li></ul></ul><ul><ul><li>About 3 trillion documents not indexed by standard search engines. </li></ul></ul>The Current Web (2/2)
  28. 28. The Semantic Web <ul><li>Resources: </li></ul><ul><ul><li>Globally identified by URIs </li></ul></ul><ul><ul><li>or locally (Blank) </li></ul></ul><ul><ul><li>Extensible </li></ul></ul><ul><ul><li>Relational </li></ul></ul><ul><li>Links: </li></ul><ul><ul><li>Identified by URIs </li></ul></ul><ul><ul><li>Extensible </li></ul></ul><ul><ul><li>Relational </li></ul></ul><ul><li>Users: </li></ul><ul><ul><li>More an better information </li></ul></ul><ul><li>Machines: </li></ul><ul><ul><li>More processable information (Data Web) </li></ul></ul>
  29. 29. <ul><li>Make web resources more accessible to automated processes </li></ul><ul><li>Extend existing rendering markup with semantic markup </li></ul><ul><ul><li>Metadata (data about data) annotations that describe content/function of web accessible resources </li></ul></ul><ul><li>Use Ontologies to provide vocabulary for annotations </li></ul><ul><ul><li>“ Formal specification” accessible to machines </li></ul></ul><ul><li>A prerequisite is a standard web ontology language </li></ul><ul><ul><li>Need to agree common syntax before we can share semantics </li></ul></ul><ul><ul><li>Syntactic web based on standards such as HTTP and HTML </li></ul></ul>Semantic Web: How?
  30. 30. Metadata annotations
  31. 31. <ul><li>Is it semantic? </li></ul><ul><ul><li>Are the terms unambiguous and tagged in royalty-free format, governed by a nonprofit organization, that all software programs can understand? </li></ul></ul><ul><li>Is it on the web? </li></ul><ul><ul><li>Is it online using a common name space that makes it easily findable? </li></ul></ul><ul><ul><li>Is it shared among collaborators or companies? </li></ul></ul><ul><ul><li>Does it use the information already online to get smarter as more people use the system? </li></ul></ul>The Semantic Web “Acid Test” (by D. Siegel)
  32. 32. Semantic Web: W3C Standards and Tools <ul><li>RDF ( R esource D escription F ramework): simple data model to describe resources and their relationships </li></ul><ul><li>RDF Schema: is a language for declaring basic class and types for describing the terms used in RDF, that allows defining class hierarchies </li></ul><ul><li>SPARQL : S PARQL P rotocol and R DF Q uery L anguage </li></ul><ul><li>OWL : W eb O ntology L anguage . Allows enriching the description of properties and classes, including, among others, class disjunction, association cardinality, richer data types, property features (eg. symmetry), etc. </li></ul>
  33. 33. <ul><li>RDF is graphical formalism ( + XML syntax + semantics) </li></ul><ul><ul><li>for representing metadata </li></ul></ul><ul><ul><li>for describing the semantics of information in a machine- accessible way </li></ul></ul><ul><li>RDF Statements are <subject, predicate, object> triples that describe properties of resources : </li></ul><ul><li><Carles,hasColleague,Ernest> </li></ul><ul><li>XML representation: </li></ul><ul><li><Description about =&quot;some.uri/person/carles_farre&quot;> </li></ul><ul><li> <hasColleague resource =&quot;some.uri/person/ernest_teniente&quot;/> </li></ul><ul><li>< /Description > </li></ul>R esource D escription F ramework (RDF)
  34. 34. <ul><li>RDF Schema allows you to define vocabulary terms and the relations between those terms </li></ul><ul><ul><li>it gives “extra meaning” to particular RDF predicates and resources </li></ul></ul><ul><ul><li>this “extra meaning”, or semantics, specifies how a term should be interpreted </li></ul></ul><ul><li>Examples: </li></ul><ul><ul><li><Person, type , Class > </li></ul></ul><ul><ul><li><hasColleague, type , Property > </li></ul></ul><ul><ul><li><Professor, subClassOf ,Person> </li></ul></ul><ul><ul><li><Cristina, type ,Professor> </li></ul></ul><ul><ul><li><hasColleague, range ,Person> </li></ul></ul><ul><ul><li><hasColleague, domain ,Person> </li></ul></ul>RDF Schema
  35. 35. <ul><li>RDFS too weak to describe resources in sufficient detail </li></ul><ul><ul><li>No localized range and domain constraints </li></ul></ul><ul><ul><ul><li>Can’t say that the range of hasChild is person when applied to persons and elephant when applied to elephants </li></ul></ul></ul><ul><ul><li>No existence/cardinality constraints </li></ul></ul><ul><ul><ul><li>Can’t say that all instances of person have a mother that is also a person, or that persons have exactly 2 parents </li></ul></ul></ul><ul><ul><li>No transitive, inverse or symmetrical properties </li></ul></ul><ul><ul><ul><li>Can’t say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf or that touches is symmetrical </li></ul></ul></ul><ul><ul><li>… </li></ul></ul><ul><li>Difficult to provide reasoning support </li></ul><ul><ul><li>No “native” reasoners for non-standard semantics </li></ul></ul><ul><ul><li>May be possible to reason via FO axiomatization </li></ul></ul>Problems with RDFS
  36. 36. <ul><li>OWL is RDF(S), adding vocabulary to specify: </li></ul><ul><ul><li>Relations between classes </li></ul></ul><ul><ul><li>Cardinality </li></ul></ul><ul><ul><li>Equality </li></ul></ul><ul><ul><li>More typing of and characteristics of properties </li></ul></ul><ul><ul><li>Enumerated classes </li></ul></ul><ul><li>Three species of OWL </li></ul><ul><ul><li>OWL full is union of OWL syntax and RDF </li></ul></ul><ul><ul><li>OWL DL restricted to FOL fragment (≅ SHIQ Description Logic) </li></ul></ul><ul><ul><li>OWL Lite is “easier to implement” subset of OWL DL </li></ul></ul><ul><li>OWL DL Benefits from many years of DL research </li></ul><ul><ul><li>Well defined semantics </li></ul></ul><ul><ul><li>Formal properties well understood (complexity, decidability) </li></ul></ul><ul><ul><li>Known reasoning algorithms </li></ul></ul><ul><ul><li>Implemented systems (highly optimised) </li></ul></ul>Web Ontology Language (OWL)
  37. 37. <ul><li>Person ⊓ ∀ hasChild.(Doctor ⊔ ∃ hasChild.Doctor) </li></ul><ul><li><owl:Class> </li></ul><ul><li><owl:intersectionOf rdf:parseType=&quot; collection&quot;> </li></ul><ul><li><owl:Class rdf:about=&quot;#Person&quot;/> </li></ul><ul><li><owl:Restriction> </li></ul><ul><li><owl:onProperty rdf:resource=&quot;#hasChild&quot;/> </li></ul><ul><li><owl:toClass> </li></ul><ul><li><owl:unionOf rdf:parseType=&quot;collection&quot;> </li></ul><ul><li><owl:Class rdf:about=&quot;#Doctor&quot;/> </li></ul><ul><li><owl:Restriction> </li></ul><ul><li><owl:onProperty rdf:resource=&quot;#hasChild&quot;/> </li></ul><ul><li><owl:hasClass rdf:resource=&quot;#Doctor&quot;/> </li></ul><ul><li></owl:Restriction> </li></ul><ul><li></owl:unionOf> </li></ul><ul><li></owl:toClass> </li></ul><ul><li></owl:Restriction> </li></ul><ul><li></owl:intersectionOf> </li></ul><ul><li></owl:Class> </li></ul>OWL in RDF(S) notation: Example
  38. 38. <ul><li>Designed to query collections of triples… </li></ul><ul><li>… and to easily traverse relationships </li></ul><ul><li>Vaguely SQL-like syntax (SELECT, WHERE) </li></ul><ul><li>“ Matches graph patterns” </li></ul><ul><li>SELECT ?sal WHERE { emps:e13954 HR:salary ?sal } </li></ul>SPARQL Protocol And RDF Query Language
  39. 39. SQL vs SPARQL <ul><li>SELECT hire_date </li></ul><ul><li>FROM employees </li></ul><ul><li>WHERE salary >= 21750 </li></ul>emps:e13954 HR:name 'Joe' emps:e13954 HR:hire-date 2000-04-14 emps:e13954 HR:salary 48000 emps:e10335 HR:name ‘Mary' emps:e10335 HR:hire-date 1998-11-23 emps:e10335 HR:salary 52000 … SELECT ?hdate WHERE { ?id HR:salary ?sal ?id HR:hire_date ?hdate FILTER ?sal >= 21750 } EMP_ID NAME HIRE_ DATE SALARY 13954 Joe 2000-04-14 48000 10335 Mary 1998-11-23 52000 … … … … 04182 Bob 2005-02-10 21750
  40. 40. Semantic Web Services <ul><li>The main aim is to enable highly flexible Web services architectures, where new services can be quickly discovered, orchestrated and composed into workflows by </li></ul><ul><ul><li>creating a semantic markup of Web services that makes them machine understandable and use-apparent is necessary </li></ul></ul><ul><ul><li>developing an agent technology that exploits this semantic markup to support automated Web service composition and interoperability </li></ul></ul>WWW URI, HTML, HTTP Semantic Web RDF, RDF(S), OWL Dynamic Web Services UDDI, WSDL, SOAP Static Semantic Web Services
  41. 41. <ul><li>KAPPEL, Gerti et al. Web Engineering , John Wiley & Sons, 2006. Chapter 14. </li></ul><ul><li>SHKLAR, Leon and ROSEN, Rich. Web Application Architecture: Principles, Protocols and Practices, 2 nd Edition . John Wiley & Sons, 2009. Chapters 5 and 13. </li></ul><ul><li>SIEGEL, David. Pull. The Power of the Semantic Web to Transform Your Business . Portfolio (Penguin Group), 2009. </li></ul><ul><li>RAY, Kate. Web 3.0 (video) http://vimeo.com/11529540 </li></ul><ul><li>www.w3.org </li></ul><ul><li>www.w3schools.com </li></ul>References