XML IN Databases (Our school for the 2004 Asian GIS Annual Conference, a Korean professor report) (geographic information, map,

xiaoxiao2021-03-05  50

XML in Databases

Yoonjoon Lee (Li Yun Jun)

Korea Science and Technology Institute

Contents

• What is xml?

• XML Data VS Documents

• Store and Retrieve XML in RDB

• GML

What is xml?

- a Markup Language That You Can Use to create your OWN TAGS

- Created by w3c to overcome the limitations of html

- Based on SGML (Standard Generalized Markup Language - "Sounds Great, Maybe Later, Used In Publishing Industry

- Designed with the Web in Mind

ORIGINS OF XML

- in 1996, Jon Bosak Convinced That W3c To Let Him Form A Committee ON Using SGML ON The Web.

- November, The Committee Has Created The Beginning of A Simplified Form of SGML, this Was XML.

- In March 1997, Bosak Released a Paper "XML, Java and The Future of the Web."

- SGML WAS CREATED for General Document Structuring, HTML AS An Application SGML for Web Document, XML IS A Simplification of SGML for General Web USE.

A Sample XML Document

mrs. </ title></p> <p><first-name> Mary </ first-name></p> <p><last-name> McGoon </ last-name></p> <p></ name></p> <p><street> 1401 main street </ street></p> <p><city state = "nc"> Anytown </ city></p> <p><postal-code> 34829 </ postal-code></p> <p></ address></p> <p>Tags, Elements and Attributes</p> <p>DTD (1/2)</p> <p>- Document Type Definition</p> <p>- EXTENSIBLE IN XML, A DIALECT OF XML</p> <p>• RDF, HL7 SGML / XML, Mathml, XML / EDI, FDX</p> <p>- Describes What Tags The Markup Language Has, What Tags' Attribute May Be, and how the year becombined.</p> <p>- Specifies Very Clearly What Information May or May Not Be include in Markup Language.</p> <p>- DTD Syntax is Different from Ordinary XML Syntax.</p> <p>DTD (2/2)</p> <p><! - address.dtd -></p> <p><! Element Address (Name, Street, City, State, Postal-Code> <! Element Name (Title? First-Name, Last-Name)></p> <p><! Element Title (#pcdata)></p> <p><! Element first-name (#pcdata)></p> <p><! Element last-name (#pcdata)></p> <p><! Element street (#pcdata)></p> <p><! Element City (#pcdata)></p> <p><! Element State (#pcdata)></p> <p><! Element Postal-Code (#pcdata)></p> <p>IS XML A DB?</p> <p>• "Collection of Data"</p> <p>• Advantages: Self-Describing, Portable, Data in Tree Or Graph Structure</p> <p>• Disadvantages: Verbose, Slow Access</p> <p> Storage, Schemas, Query Languages, Programming Interfaces, ...</p> <p>- Efficient Storage, INDEXES, Security, Transactions and Data Integrity, Multi-User Access. Trigger Queries Across Multiple Documents, ...</p> <p>Why db?</p> <p>• Want To Expose Legacy Data</p> <p>• Looking for a place to Store Web Pages</p> <p>• Database Used by An E-Commerce Application In Which XML IS Used As a Data TRANSFER</p> <p>• INTERESTED IN DATA or Documents</p> <p>Data vs. Documents</p> <p>• Used SIMPLY AS A DATA TRANSPORT BETWEEN THE DATABASE AND A Application?</p> <p>• Integral USE AS IN THE CASE OF XHTML AND DOCBOOK DOCUMENTS?</p> <p>Data-centric documents (1/2)</p> <p>• for machine consumption</p> <p>EX) Sales Orders, Flight Schedules, ...</p> <p>• Fairly Regular Structure, Fine-grained Data and Little or No Mixed Content, No Significant Order In Sibling</p> <p>Data-centric documents (2/2)</p> <p><Flightinfo></p> <p><Airline> Abc Airways </ airline> provides <count> Three </ count> non-stop flights daily from <Origin> Dallas </ Origin> To <Destination> Fort Worth </ destination>. Departure Times Are <departure> 09 : 15 </ departure>, <departure> 11:15 </ departure>, and <departure> 13:15 </ departure>. Arrival Times Are Minutes Later. </ Flightinfo></p> <p><Flights></p> <p><Airline> abc airways </ airline></p> <p><Origin> Dallas </ Origin></p> <p><Destination> Fort Worth </ DESTINATION></p> <p><Flight></p> <p><Departure> 09:15 </ departure></p> <p><Arrival> 09:16 </ arrival></p> <p></ Flight></p> <p><Flight></p> <p><Departure> 11:15 </ departure></p> <p><Arrival> 11:16 </ arrival></p> <p></ Flight></p> <p><Flight></p> <p><Departure> 13:15 </ departure></p> <p><Arrival> 13:16 </ arrival></p> <p></ Flight></p> <p></ Flights></p> <p>Document-centric documents (1/2)</p> <p>• for Human Consumption</p> <p>EX) Books, Email, Advertisement, ...</p> <p>• Less Regular or Irregular Structure, Larger Graped Data, Lots of Mixed Contents, Almost Significant Order In Sibling</p> <p>Document-centric documents (2/2)</p> <p><Product></p> <p><Intro></p> <p>The <ProductName> Turkey Wrench </ ProductName> from <developer> Full FabRication Labs, Inc. </ West> is <summary> Like a monkey wrench, but not as big. </ Summary></p> <p></ Intro></p> <p><Description></p> <p><Para> The Turkey Wrench, Which Comes in <i> Both Right- and Left- Handed Versions (Skyhook Optional) </ i>, is Made of the <b> Finest Stainless Steel </ b>. The readi-grip rubberized Handle Quickly Adapts to your hand, Even in the greasiest situations. Adjustment is Possible Through a variety of custom dials. </ para> <para> you can: </ para></p> <p><List></p> <p><Item> <link URL = "Order.html"> Order Your Own Turkey Wrench </ link> </ item></p> <p><Item> <link url = "wrenches.htm"> Read more about wrenches </ link> </ item></p> <p><Item> <link url = "catalog.zip"> Download The Catalog </ LINK> </ ITEM></p> <p></ List></p> <p><Para> The Turkey Wrench Costs <B> Just $ 19.99 </ b> and if you Order Now, Comes with a <b> Hand-Crawed Shrimp Hammer </ b> as a bonus gift. </ Para></p> <p></ Description></p> <p></ Product></p> <p>Store & Retrieve XML</p> <p>• File</p> <p>• RDBMS</p> <p>• Oodbms</p> <p>• Special Purpose Systems for SEMI-STRUCTURE DATA</p> <p>Storing XML Data In Rdbmss</p> <p> RDBMS: a Matured Technology</p> <p> RDBMS WIDELY AVAILABLE</p> <p> Less Investment To Adopt The New Technology</p> <p> Easy to Be Integrated with Other EXISTING APPLICATIONS</p> <p>- Impedance mismatch</p> <p>- Two Level Nature of Relational Schema (tuples and attributes) vs. arbitrary Nesting of XML DTD</p> <p>- FLAT STRUCTURE VS. Recursion</p> <p>- structure-based and content-based query</p> <p>Storing XML Data In Rdbms: Architecture</p> <p>Storing XML Data In Rdbms: Issues</p> <p>• Schema / Data Mapping:</p> <p>- Automate Storage of XML in rdbms</p> <p>• query mapping:</p> <p>- Provide XML Views of Relational Sources</p> <p>• Result Construction:</p> <p>- Export EXISTING DATA AS XMLXML-RELATIONAL MAPPING</p> <p>• Model mapping</p> <p>- Database Schemas represent constructs of the xml document model.</p> <p>• DTD Independent</p> <p>[Florescu & Kossmann 99, Yoshikawa, et. Al. Toit01]</p> <p>• structure mapping</p> <p>- Database Schemas Represent The Logical Strument of Target XML Documents</p> <p>• DTD Dependent</p> <p>[Shanmugasundaram et. Al. VDLB 99]</p> <p>Model mapping: Edge, Xrel, And XParent</p> <p>• Edge: a Single Large Table for Handing Any Structures.</p> <p>• Xrel and XParent: Four Tables</p> <p>- The structure handling:</p> <p>• Xrel: The Structure IS Coded in The Data Using Region Codes (Start, End).</p> <p>• XParent: The Structure IN A Separated "Parent" Table (PARENT-ID, Child-ID). (Can Be Extended To Support An Additional Table)</p> <p>- Partitioning:</p> <p>• Xrel: Partition Edge by Content (Element, Data, Attribute)</p> <p>• XParent: Partition Edge by Content and "Structure VS NON-STRUCTURE)</p> <p>- Label-path Handling: Explicitly As Data</p> <p>Edge (1/3)</p> <p>• Mapping Edges - Edge Approach</p> <p>Edge (2/3)</p> <p>Edge (3/3)</p> <p>XREL (1/6)</p> <p>XREL (2/6)</p> <p>XREL (3/6)</p> <p>XREL (4/6)</p> <p>XREL (5/6)</p> <p>XREL (6/6)</p> <p>XParent (1/4)</p> <p>XParent (2/4)</p> <p>XParent (3/4)</p> <p>XParent (4/4)</p> <p>GML (1/2)</p> <p>• GML (Geographic Markup Language) = GIS XML</p> <p>• GML IS An XML-BASED LANGUAGE for Encoding Geographic Information in Order To Be Stored and Transport over The Internet, Developed by The OpenGIS Consortium</p> <p>• GML Defines Both The Geometry and Properties of Objects That Comprise Geographic Information</p> <p>GML (2/2)</p> <p>• GML IS A Practical Application for Transferring Cartographic Information over the Web</p> <p>• GML allows the data to be controlled on the browser end by the user who receives geometries and geographic features and customizes how the data is to be displayed, instead of transmitting a GIF or JPG map • Geographic data in GML can be sent to any device With an an XML Interface</p> <p>References</p> <p>• D. Florescu, D. Kossman, Storing and Querying XML Data Using An Rdbms. IEEE DATA ENGINEERING Bulletin 22 (3), 1999</p> <p>• M. Yoshikawa et al.</p> <p>• H. Jiang et al., Xparent: an effect rdbms-based XML Database System, In Proc. Of ICDE, 2002</p> <p>• H. Jiang et al., Path Materialization Revisited: An Efficient Storage Model for XML Data, In Proc. Of aice, 2000</p> <p>• About GML</p> <p>- http://www.opengis.org</p> <p>- http://www.isotc211.org</p> <p>- http://www.w3c.org</p> <p>- http://gml4j.sourceforge.net</p> <p>- http://www.expway.net</p> <p>- http://www.galdosinc.com</p> <p>Thanks for your attntion!</p> <p>Any Questions?</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-32978.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="32978" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.053</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'b9konhENdOJuWOTtFPaPXFh9zuVyhqEXD6BzQ9OSB85FBdiDSUFYNZL4UE3ONXexNqZkZuCLlQU4MKOD51l4_2BQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>