Non-XML Structured Data

XML Foundations [./]
Fall 2009 — INFO 242 (CCN 42575)

Erik Wilde, UC Berkeley School of Information
2009-12-01

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents E. Wilde: Non-XML Structured Data

Contents

E. Wilde: Non-XML Structured Data

(2) Abstract

XML can be viewed in two different perspectives: as a way to serialize a data structure into a syntax that can be easily transmitted and consumed, or as the native data model which not only is a way of representing data, but represents the data model of the data itself. The first perspective (serialization format) allows XML to be used for a wider range of applications and scenarios, but also more tightly couples the peers in such a scenario because they not only have to support XML, but they also have to understand and support the non-XML data model that is required to make sense of the XML serialization.



E. Wilde: Non-XML Structured Data

(3) Syntax vs. Model



E. Wilde: Non-XML Structured Data

(4) Pseudo-XML



Resource Description Framework (RDF)

Outline (Resource Description Framework (RDF))

  1. Resource Description Framework (RDF) [5]
  2. JavaScript Object Notation (JSON) [4]
  3. Conclusions [1]
Resource Description Framework (RDF) E. Wilde: Non-XML Structured Data

(6) Describing Resources

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#">
  <contact:Person rdf:about="http://www.w3.org/People/EM/contact#me">
    <contact:fullName>Eric Miller</contact:fullName>
    <contact:mailbox rdf:resource="mailto:em@w3.org"/>
    <contact:personalTitle>Dr.</contact:personalTitle> 
  </contact:Person>
</rdf:RDF>
[http://www.w3.org/TR/REC-rdf-syntax/#intro]

Resource Description Framework (RDF) E. Wilde: Non-XML Structured Data

(7) RDF Graphs

rdf-graph.png

Resource Description Framework (RDF) E. Wilde: Non-XML Structured Data

(8) RDF is Simple and Complex



Resource Description Framework (RDF) E. Wilde: Non-XML Structured Data

(9) RDF Schema Graph

rdfs-graph.png

Resource Description Framework (RDF) E. Wilde: Non-XML Structured Data

(10) RDF in Attributes (RDFa)

<p>This document is licensed under a <a xmlns:cc="http://creativecommons.org/licenses/" rel="cc:license" href="http://creativecommons.org/licenses/by/nc-nd/3.0/">Creative Commons License</a>.</p>


JavaScript Object Notation (JSON)

Outline (JavaScript Object Notation (JSON))

  1. Resource Description Framework (RDF) [5]
  2. JavaScript Object Notation (JSON) [4]
  3. Conclusions [1]
JavaScript Object Notation (JSON) E. Wilde: Non-XML Structured Data

(12) JavaScript and XML



JavaScript Object Notation (JSON) E. Wilde: Non-XML Structured Data

(13) JSON Example

<?xml version="1.0"?>
<menu id="file" value="File">
 <popup>
  <menuitem value="New" onclick="CreateNewDoc()"/>
  <menuitem value="Open" onclick="OpenDoc()"/>
  <menuitem value="Close" onclick="CloseDoc()"/>
 </popup>
</menu>
{ "menu" : {
 "id" : "file",
 "value" : "File",
 "popup" : {
  "menuitem" : [
   { "value" : "New", "onclick" : "CreateNewDoc()" },
   { "value" : "Open", "onclick" : "OpenDoc()" },
   { "value" : "Close", "onclick" : "CloseDoc()" }
  ]
 }
}}


JavaScript Object Notation (JSON) E. Wilde: Non-XML Structured Data

(14) JSON via Content Negotiation



JavaScript Object Notation (JSON) E. Wilde: Non-XML Structured Data

(15) JSON Media Type



Conclusions

Outline (Conclusions)

  1. Resource Description Framework (RDF) [5]
  2. JavaScript Object Notation (JSON) [4]
  3. Conclusions [1]
Conclusions E. Wilde: Non-XML Structured Data

(17) XML is just a Tool



2009-12-01 XML Foundations [./]
Fall 2009 — INFO 242 (CCN 42575)