Lösning Tentamen IV1023 Avancerad Datahantering Med XML 2011-10-20

Total Page:16

File Type:pdf, Size:1020Kb

Lösning Tentamen IV1023 Avancerad Datahantering Med XML 2011-10-20 KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas Lösning Tentamen IV1023 Avancerad datahantering med XML 2011-10-20 Tentan består av 3 delar: Del 1 Teori och modellering (uppgift 1, 2, 3) Del 2 Frågespråk för SSD och XML (uppgift 4, 5) Del 3 XML och relationsdatabaser (uppgift 6) Tentan betygsätts enligt skalan F/Fx/E/D/C/B/A. För E krävs c:a 60% av totalpoängen, men också c:a 40% av poängen för varje del. Man måste alltså uppvisa kunskaper i alla tre områden (tentadelar). De exakta betygsgränserna för A-E är: Hela tentan Per del A-gräns 94% 87% B-gräns 85% 75% C-gräns 77% 64% D-gräns 68% 52% E-gräns 60% 40% Får man minst 75% på en del utan att uppnå E-gränsen, får man rest (Fx) (på de delar som man inte fick 75%), dvs möjligheten att endast göra vissa delar vid nästa tenta och kan då få högst E. Man behöver inte använda sig av denna möjlighet. Använder man Fx/Rest gäller E-gränserna för de delar man skriver: 60% på hela tentan och 40% per del. Skriv endast på en sida av varje blad! Skriv namn och uppgiftsnummer på varje blad! Fyll i skanningsbladet så att det framgår vilka uppgifter som har lösts och hur många blad som har lämnats in! Inga hjälpmedel tillåtna förutom ordböcker för översättning mellan svenska och främmande språk LYCKA TILL! KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas Uppgift 1 (9 poäng) Uppgift 1 består av 9 frågor. Några frågor är flervalsfrågor där det alternativ som är rätt skall väljas (bara ett alternativ är rätt). Några frågor är termer som skall förklaras kortfattat så att det framgår att man förstår vad termen betyder. Inga långa uppsatser, tack. Förklara följande termer: 1. SVG 2. shredding 3. well-formed XML 4. processing-instruction Välj ett av alternativen för var och en av flervalsfrågorna nedan: 5. Vilken nodtyp kan inte vara en child till en elementnod enligt XQuery-modellen? a. element b. text c. comment d. attribute 6. XML står för: a. Extendable Meta Language b. Extensible Meta Language c. Extendable Markup Language d. Extensible Markup Language 7. Ett rdf:predicate måste alltid vara a. En resurs av typen rdfs:Container b. En resurs av typen rdf:Property c. En literal d. En resurs av typen rdfs:Class 8. Vilket av följande är korrekt? a. Ett element kan innehålla antingen subelement eller kommentarer. b. Ett element får inte ha ett subelement med samma namn som ett attribut. c. Ett element får inte tillhöra flera namespaces. d. Två subelement under samma element får inte vara identiska. e. Ett element och ett subelement får inte ha samma namn. 9. Vad kan man inte göra med XQuery Update facility? a. Byta plats på två syskon-elementnoder. b. Skapa flera nya noder samtidigt. c. Ta bort en elementnod som har subelement. d. Ersätta en nod med två nya noder. e. Skapa en kommentarnod som sista nod i en elementnod. 1. Scalable Vector Graphics - Ett XML-baserat språk för att representera vektorgrafik. 2. Shredding innebär att man delar upp ett XML-dokument till sina data-element och placerar värdena i t ex en relationsdatabas. 3. Ett XML-dokument som har ett rotelement och är syntaktiskt korrekt så att alla element är nästlade i varandra korrekt, alla element och attribut öppnas och stängs korrekt. Ett well-formed XML-dokument skall börja med XML-deklarationen. 4. En speciell typ av XML-nod som har följande format: <?namn innehåll?> XML- deklarationen är en processing-instruction. 5. d 6. d 7. b 8. c 9. a KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas Uppgift 2 (3 poäng) Använd RDF och RDFS för att beskriva nedanstående information! Lösningen skall vara antingen grafer eller XML. En Fanta 500 ml kostar 11 kronor. Vi kan skapa en resurs för "Fanta 500 ml" som har tre properties: namn, storlek och pris: Fanta 500 storlek namn pris 11 P Som RDF/XML blir det enligt följande: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description about="P"> <namn>Fanta</namn> <storlek>500</storlek> <pris>Volvo</pris> </rdf:Description> </rdf:RDF> Resursen ovan borde tillhöra en klass och tre properties borde skapas med den klassen som domain: rdfs:Class namn rdf:type rdfs:domain rdf:type rdf:type rdfs:domain storlek rdf:Property Produkt rdfs:domain rdf:type pris rdfs:range rdfs:range rdfs:range rdfs:Literal KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas I RDF/XML ser det ut såhär: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <rdfs:Class rdf:ID="Produkt" /> <rdf:Property rdf:ID="namn"> <rdfs:domain rdf:resource="Produkt"/> <rdfs:range rdf:resource="rdfs:Literal"/> </rdf:Property> <rdf:Property rdf:ID="storlek"> <rdfs:domain rdf:resource="Produkt"/> <rdfs:range rdf:resource="rdfs:Literal"/> </rdf:Property> <rdf:Property rdf:ID="pris"> <rdfs:domain rdf:resource="Produkt"/> <rdfs:range rdf:resource="rdfs:Literal"/> </rdf:Property> </rdf:RDF> Man kan även tänka sig göra produktens namn till en klass, t ex "Märke". Man kan även utöka modellen med att ha priset och storleken som resurser som har värde och valuta, respektive värde och måttenhet. Informationen om resurserna skulle kunna även representeras som reifierade påståenden (rdf:Statement) med subjekt, predikat och objekt. Resurserna i RDF/XML kan representeras med den förkortade syntaxen där klassens namn blir elementets namn. Det tidigare XML-dokumentet skulle då bli såhär: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <Produkt rdf:about="P"> <namn>Fanta</namn> <storlek>500</storlek> <pris>Volvo</pris> </Produkt> </rdf:RDF> KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas Uppgift 3 (3 poäng) Ta fram en DTD för att representera samma information som relationsmodellen nedan! Tabellen Plantering innehåller information om vad som har platerats i varje skog vid varje datum, medan tabellen Skogsträd innehåller information om den aktuella mängden träd av varje typ i varje skog. <!ELEMENT DB (Trädtyp*, Skog*)> <!ELEMENT Trädtyp EMPTY> <!ELEMENT Skog (Träd*, Planteringstillfälle*)> <!ELEMENT Träd EMPTY> <!ELEMENT Planteringstillfälle (Plantering+)> <!ELEMENT Plantering EMPTY> <!ATTLIST Trädtyp namn ID #REQUIRED medellivslängd CDATA #REQUIRED> <!ATTLIST Skog namn ID #REQUIRED ytakvm CDATA #REQUIRED> <!ATTLIST Träd typ IDREF #REQUIRED antal CDATA #REQUIRED> <!ATTLIST Planteringstillfälle datum CDATA #REQUIRED> <!ATTLIST Plantering trädtyp IDREF #REQUIRED antal CDATA #REQUIRED> Eftersom ID och IDREF har använts, måste vi förutsätta att ingen trädtyp har samma namn som en skog. Annars kan man använda en surrogatnyckel (som vi gjorde i relationsdatabasen). Vi kan även ha attributen definierade endast som CDATA men då blir det ingen kontroll att referensvärdena finns och att dubbletter inte förekommer. En annan lösning är att nästla trädtyperna som subelement till Skog och Plantering, men då har vi redundans som vi kanske vill undvika. Det är även korrekt att använda element istället för attribut eller nästla på något annat sätt, t ex sätta trädtyperna under rotelementet och nästla skog och planteringar i trädtyperna, men det känns mindre naturligt. KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas Uppgift 4 (2 + 2 = 4 poäng) Betrakta nedanstående XML-dokument som endast innehåller testdata för att illustrera strukturen. XML-dokumentet innehåller information om olika organisationer och deras medlemmar. Ni kan förutsätta att alla namn är unika, dvs inga två organisationer har samma namn och inga två personer har samma namn. <?xml version="1.0" encoding="ISO-8859-1"?> <OrgDB> <Organisation namn="Träd i staden" skapades="1999"> <Medlem namn="Lisa Berg" från="1999" till="2001"/> <Medlem namn="Marcus Berg" från="1999" till="2008"/> <Medlem namn="Lisa Berg" från="2005"/> <Medlem namn="Karl Sjögren" från="2000"/> </Organisation> <Organisation namn="Rädda valen" skapades="2008"> <Medlem namn="Lisa Berg" från="2008" till="2010"/> <Medlem namn="Lisa Sunesson" från="2008"/> <Medlem namn="Mia Appelgren" från="2009"/> <Medlem namn="Patrik Nordlander" från="2008" till="2009"/> </Organisation> <Organisation namn="Schacksällskapet" skapades="1991"> <Medlem namn="Bertil Karlgren" från="1991" till="2008"/> <Medlem namn="Lisa Sunesson" från="2000" till="2004"/> <Medlem namn="Mia Appelgren" från="2004"/> <Medlem namn="Katrin Ljung" från="1993" till="1997"/> <Medlem namn="Katrin Ljung" från="2002" till="2006"/> <Medlem namn="Anders Ljung" från="1993" till="1997"/> <Medlem namn="Anders Ljung" från="2003"/> </Organisation> </OrgDB> Skriv XQuery för följande: a) Ta fram information om antal aktuella medlemmar per organisation! Resultatet skall ha följande struktur: <Resultat> <Organisation> <Namn>namnet</Namn> <AntalMedlemmar>antalet</AntalMedlemmar> </Organisation> <Organisation> <Namn>namnet</Namn> <AntalMedlemmar>antalet</AntalMedlemmar> </Organisation> </Resultat> element Resultat { for $o in //Organisation let $n := element Namn {$o/@namn/string()} let $am := element AntalMedlemmar {count($o/Medlem[not(@till)])} return element Organisation {$n, $am} } KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas b) Ta fram namn på organisationer som varje person har någon gång varit medlem i! Resultatet skall ha följande struktur: <Resultat> <Person namn=""> <Organisation namn=""/> <Organisation namn=""/> </Person> <Person namn=""> <Organisation namn=""/> <Organisation namn=""/> </Person> </Resultat> element Resultat { for $pn in distinct-values(//Medlem/@namn) let $orgs := for $o in //Organisation[Medlem/@namn = $pn] return element Organisation {$o/@namn} return element Person {attribute namn {$pn}, $orgs} } Eller med hjälp av preceding-axis (så att vi inte behöver återkonstruera attributet namn): element Resultat { for $pn in //Medlem[not(@namn = preceding::Medlem/@namn)]/@namn let $orgs := for $o in //Organisation[Medlem/@namn = $pn] return element Organisation {$o/@namn} return element Person {$pn, $orgs} } KTH/ICT/SCS IV1023 Lösning Tenta 2011-10-20 nikos dimitrakas Uppgift 5 (3 poäng) Betrakta XML-dokumentet i uppgift 4! Skriv ett XSLT (med XSLT 1.0) för följande beskrivning! Ta fram en HTML-sida där varje person har en rubrik och en tabell med sina medlemskap.
Recommended publications
  • Bibliography of Erik Wilde
    dretbiblio dretbiblio Erik Wilde's Bibliography References [1] AFIPS Fall Joint Computer Conference, San Francisco, California, December 1968. [2] Seventeenth IEEE Conference on Computer Communication Networks, Washington, D.C., 1978. [3] ACM SIGACT-SIGMOD Symposium on Principles of Database Systems, Los Angeles, Cal- ifornia, March 1982. ACM Press. [4] First Conference on Computer-Supported Cooperative Work, 1986. [5] 1987 ACM Conference on Hypertext, Chapel Hill, North Carolina, November 1987. ACM Press. [6] 18th IEEE International Symposium on Fault-Tolerant Computing, Tokyo, Japan, 1988. IEEE Computer Society Press. [7] Conference on Computer-Supported Cooperative Work, Portland, Oregon, 1988. ACM Press. [8] Conference on Office Information Systems, Palo Alto, California, March 1988. [9] 1989 ACM Conference on Hypertext, Pittsburgh, Pennsylvania, November 1989. ACM Press. [10] UNIX | The Legend Evolves. Summer 1990 UKUUG Conference, Buntingford, UK, 1990. UKUUG. [11] Fourth ACM Symposium on User Interface Software and Technology, Hilton Head, South Carolina, November 1991. [12] GLOBECOM'91 Conference, Phoenix, Arizona, 1991. IEEE Computer Society Press. [13] IEEE INFOCOM '91 Conference on Computer Communications, Bal Harbour, Florida, 1991. IEEE Computer Society Press. [14] IEEE International Conference on Communications, Denver, Colorado, June 1991. [15] International Workshop on CSCW, Berlin, Germany, April 1991. [16] Third ACM Conference on Hypertext, San Antonio, Texas, December 1991. ACM Press. [17] 11th Symposium on Reliable Distributed Systems, Houston, Texas, 1992. IEEE Computer Society Press. [18] 3rd Joint European Networking Conference, Innsbruck, Austria, May 1992. [19] Fourth ACM Conference on Hypertext, Milano, Italy, November 1992. ACM Press. [20] GLOBECOM'92 Conference, Orlando, Florida, December 1992. IEEE Computer Society Press. http://github.com/dret/biblio (August 29, 2018) 1 dretbiblio [21] IEEE INFOCOM '92 Conference on Computer Communications, Florence, Italy, 1992.
    [Show full text]
  • Supporting SPARQL Update Queries in RDF-XML Integration *
    Supporting SPARQL Update Queries in RDF-XML Integration * Nikos Bikakis1 † Chrisa Tsinaraki2 Ioannis Stavrakantonakis3 4 Stavros Christodoulakis 1 NTU Athens & R.C. ATHENA, Greece 2 EU Joint Research Center, Italy 3 STI, University of Innsbruck, Austria 4 Technical University of Crete, Greece Abstract. The Web of Data encourages organizations and companies to publish their data according to the Linked Data practices and offer SPARQL endpoints. On the other hand, the dominant standard for information exchange is XML. The SPARQL2XQuery Framework focuses on the automatic translation of SPARQL queries in XQuery expressions in order to access XML data across the Web. In this paper, we outline our ongoing work on supporting update queries in the RDF–XML integration scenario. Keywords: SPARQL2XQuery, SPARQL to XQuery, XML Schema to OWL, SPARQL update, XQuery Update, SPARQL 1.1. 1 Introduction The SPARQL2XQuery Framework, that we have previously developed [6], aims to bridge the heterogeneity issues that arise in the consumption of XML-based sources within Semantic Web. In our working scenario, mappings between RDF/S–OWL and XML sources are automatically derived or manually specified. Using these mappings, the SPARQL queries are translated on the fly into XQuery expressions, which access the XML data. Therefore, the current version of SPARQL2XQuery provides read-only access to XML data. In this paper, we outline our ongoing work on extending the SPARQL2XQuery Framework towards supporting SPARQL update queries. Both SPARQL and XQuery have recently standardized their update operation seman- tics in the SPARQL 1.1 and XQuery Update Facility, respectively. We have studied the correspondences between the update operations of these query languages, and we de- scribe the extension of our mapping model and the SPARQL-to-XQuery translation algorithm towards supporting SPARQL update queries.
    [Show full text]
  • XML Transformations, Views and Updates Based on Xquery Fragments
    Faculteit Wetenschappen Informatica XML Transformations, Views and Updates based on XQuery Fragments Proefschrift voorgelegd tot het behalen van de graad van doctor in de wetenschappen aan de Universiteit Antwerpen, te verdedigen door Roel VERCAMMEN Promotor: Prof. Dr. Jan Paredaens Antwerpen, 2008 Co-promotor: Dr. Ir. Jan Hidders XML Transformations, Views and Updates based on XQuery Fragments Roel Vercammen Universiteit Antwerpen, 2008 http://www.universiteitantwerpen.be Permission to make digital or hard copies of portions of this work for personal or classroom use is granted, provided that the copies are not made or distributed for profit or commercial advantage and that copies bear this notice. Copyrights for components of this work owned by others than the author must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission of the author. Research funded by a Ph.D. grant of the Institute for the Promotion of Innovation through Science and Technology in Flan- ders (IWT-Vlaanderen). { Onderzoek gefinancierd met een specialisatiebeurs van het Instituut voor de Aanmoediging van Innovatie door Wetenschap en Technologie in Vlaanderen (IWT-Vlaanderen). Grant number / Beurs nummer: 33581. http://www.iwt.be Typesetting by LATEX Acknowledgements This thesis is the result of the contributions of many friends and colleagues to whom I would like to say \thank you". First and foremost, I want to thank my advisor Jan Paredaens, who gave me the opportunity to become a researcher and teached me how good research should be performed. I had the honor to write several papers in collaboration with him and will always remember the discussions and his interesting views on research, politics and gastronomy.
    [Show full text]
  • Access Control Models for XML
    Access Control Models for XML Abdessamad Imine Lorraine University & INRIA-LORIA Grand-Est Nancy, France [email protected] Outline • Overview on XML • Why XML Security? • Querying Views-based XML Data • Updating Views-based XML Data 2 Outline • Overview on XML • Why XML Security? • Querying Views-based XML Data • Updating Views-based XML Data 3 What is XML? • eXtensible Markup Language [W3C 1998] <files> "<record>! ""<name>Robert</name>! ""<diagnosis>Pneumonia</diagnosis>! "</record>! "<record>! ""<name>Franck</name>! ""<diagnosis>Ulcer</diagnosis>! "</record>! </files>" 4 What is XML? • eXtensible Markup Language [W3C 1998] <files>! <record>! /files" <name>Robert</name>! <diagnosis>! /record" /record" Pneumonia! </diagnosis> ! </record>! /name" /diagnosis" <record …>! …! </record>! Robert" Pneumonia" </files>! 5 XML for Documents • SGML • HTML - hypertext markup language • TEI - Text markup, language technology • DocBook - documents -> html, pdf, ... • SMIL - Multimedia • SVG - Vector graphics • MathML - Mathematical formulas 6 XML for Semi-Structered Data • MusicXML • NewsML • iTunes • DBLP http://dblp.uni-trier.de • CIA World Factbook • IMDB http://www.imdb.com/ • XBEL - bookmark files (in your browser) • KML - geographical annotation (Google Maps) • XACML - XML Access Control Markup Language 7 XML as Description Language • Java servlet config (web.xml) • Apache Tomcat, Google App Engine, ... • Web Services - WSDL, SOAP, XML-RPC • XUL - XML User Interface Language (Mozilla/Firefox) • BPEL - Business process execution language
    [Show full text]
  • Web and Semantic Web Query Languages: a Survey
    Web and Semantic Web Query Languages: A Survey James Bailey1, Fran¸coisBry2, Tim Furche2, and Sebastian Schaffert2 1 NICTA Victoria Laboratory Department of Computer Science and Software Engineering The University of Melbourne, Victoria 3010, Australia http://www.cs.mu.oz.au/~jbailey/ 2 Institute for Informatics,University of Munich, Oettingenstraße 67, 80538 M¨unchen, Germany http://pms.ifi.lmu.de/ Abstract. A number of techniques have been developed to facilitate powerful data retrieval on the Web and Semantic Web. Three categories of Web query languages can be distinguished, according to the format of the data they can retrieve: XML, RDF and Topic Maps. This ar- ticle introduces the spectrum of languages falling into these categories and summarises their salient aspects. The languages are introduced us- ing common sample data and query types. Key aspects of the query languages considered are stressed in a conclusion. 1 Introduction The Semantic Web Vision A major endeavour in current Web research is the so-called Semantic Web, a term coined by W3C founder Tim Berners-Lee in a Scientific American article describing the future of the Web [37]. The Semantic Web aims at enriching Web data (that is usually represented in (X)HTML or other XML formats) by meta-data and (meta-)data processing specifying the “meaning” of such data and allowing Web based systems to take advantage of “intelligent” reasoning capabilities. To quote Berners-Lee et al. [37]: “The Semantic Web will bring structure to the meaningful content of Web pages, creating an environment where software agents roaming from page to page can readily carry out sophisticated tasks for users.” The Semantic Web meta-data added to today’s Web can be seen as advanced semantic indices, making the Web into something rather like an encyclopedia.
    [Show full text]
  • Declarative Access to Filesystem Data New Application Domains for XML Database Management Systems
    Declarative Access to Filesystem Data New application domains for XML database management systems Alexander Holupirek Dissertation zur Erlangung des akademischen Grades Doktor der Naturwissenschaften (Dr. rer. nat.) Fachbereich Informatik und Informationswissenschaft Mathematisch-Naturwissenschaftliche Sektion Universität Konstanz Referenten: Prof. Dr. Marc H. Scholl Prof. Dr. Marcel Waldvogel Tag der mündlichen Prüfung: 17. Juli 2012 Abstract XML and state-of-the-art XML database management systems (XML-DBMSs) can play a leading role in far more application domains as it is currently the case. Even in their basic configuration, they entail all components necessary to act as central systems for complex search and retrieval tasks. They provide language-specific index- ing of full-text documents and can store structured, semi-structured and binary data. Besides, they offer a great variety of standardized languages (XQuery, XSLT, XQuery Full Text, etc.) to develop applications inside a pure XML technology stack. Benefits are obvious: Data, logic, and presentation tiers can operate on a single data model, and no conversions have to be applied when switching in between. This thesis deals with the design and development of XML/XQuery driven informa- tion architectures that process formerly heterogeneous data sources in a standardized and uniform manner. Filesystems and their vast amounts of different file types are a prime example for such a heterogeneous dataspace. A new XML dialect, the Filesystem Markup Language (FSML), is introduced to construct a database view of the filesystem and its contents. FSML provides a uniform view on the filesystem’s contents and allows developers to leverage the complete XML technology stack on filesystem data.
    [Show full text]
  • Standardised Xquery 3.0 Annotations for REST
    RESTful XQuery Standardised XQuery 3.0 Annotations for REST Adam Retter Adam Retter Consulting <[email protected]> January, 2012 Abstract Whilst XQuery was originally envisaged and designed as a query language for XML, it has been adopted by many as a language for application development This, in turn, has encouraged additional and diverse extensions, many of which could not easily have been foreseen. This paper examines how XQuery has been used for Web Application development, current implementation approaches for executing XQuery in a Web context, and subsequently presents a proposal for a standard approach to RESTful XQuery through the use of XQuery 3.0 Annotations. Keywords: XQuery 3.0, Annotations, REST, HTTP, Standard 1. Introduction 1.1 Background XML Query Language (XQuery) was originally born from several competing query languages for XML[1]. All of these languages had in common the noble yet limited goal of querying XML. They focused on XML as a read-only store for data. In addition, whilst several of these predecessors recognised the Web as a critical factor, like their successor XQuery, none of them attempted to implement constructs in the language that supported use as a (Web) server-side processing language. With the adoption and use of XQuery, because of its functional nature and module system which permit the organisation of code units, people attempted to write complex processing applications in XQuery. As the limits of what was achievable in XQuery were tested, real world scenarios emerged which called for additional XQuery facilities, resulting in extension standards: XPath and XQuery Update[2] and XQuery Full-Text[3].
    [Show full text]
  • Xpath, Xquery and XSLT
    XPath, XQuery and XSLT Timo Lilja February 25, 2010 Timo Lilja () XPath, XQuery and XSLT February 25, 2010 1 / 24 Introduction When processing, XML documents are organized into a tree structure in the memory All XML Query and transformation languages operate on this tree XML Documents consists of tags and attributes which form logical constructs called nodes The basic operation unit of these query/processing languages is the node though access to substructures is provided Timo Lilja () XPath, XQuery and XSLT February 25, 2010 2 / 24 XPath XPath XPath 2.0 [4] is a W3C Recomendation released on January 2007 XPath provides a way to query the nodes and their attributes, tags and values XPath type both dynamic and static typing if the XML Scheme denition is present, it is used for static type checking before executing a query otherwise nodes are marked for untyped and they are coerced dynamically during run-time to suitable types Timo Lilja () XPath, XQuery and XSLT February 25, 2010 3 / 24 XPath Timo Lilja () XPath, XQuery and XSLT February 25, 2010 4 / 24 XPath Path expressions Path expressions provide a way to choose all matching branches of the tree representation of the XML Document Path expressions consist of one or more steps separated by the path operater/. A step can be an axis which is a way to reference a node in the path. a node-test which corresponds to a node in the actual XML document zero or more predicates Syntax for the path expressions: /step/step Syntaxc for a step: axisname::nodestest[predicate] Timo Lilja () XPath, XQuery and XSLT February 25, 2010 5 / 24 XPath Let's assume that we use the following XML Docuemnt <bookstore> <book category="COOKING"> <title lang="it">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K.
    [Show full text]
  • Database Architecture Evolution: Mammals Flourished Long Before Dinosaurs Became Extinct
    Database Architecture Evolution: Mammals Flourished long before Dinosaurs became Extinct Stefan Manegold Martin L. Kersten Peter Boncz CWI, Amsterdam, The Netherlands {manegold,mk,boncz}@cwi.nl ABSTRACT building block for realizing more complex structures (such as ta- The holy grail for database architecture research is to find a solution bles, but also objects and even trees or graphs). that is Scalable & Speedy, to run on anything from small ARM In this paper, we summarize the quest to renovate database ar- processors up to globally distributed compute clusters, Stable & chitecture with the goal of addressing data management needs with Secure, to service a broad user community, Small & Simple, to be a common core rather than bolting on new subsystems [38], and comprehensible to a small team of programmers, Self-managing, to pushing through the functionality plateau, especially using self- let it run out-of-the-box without hassle. adaptation, exploiting resource optimization opportunities as they In this paper, we provide a trip report on this quest, covering appear dynamically, rather than by static prediction. This quest both past experiences, ongoing research on hardware-conscious al- covers the major design space choices, experiences gained and on- gorithms, and novel ways towards self-management specifically fo- going research around the MonetDB system. cused on column store solutions. In all, this story demonstrates the viability of new self-adaptive life-forms that may be very successful yet are very different from the long existing species. In this, the MonetDB strain forms an 1. INTRODUCTION open platform available for all who want to explore further evolu- Forty years of relational database technology seemingly con- tion in the data management ecosystem.
    [Show full text]
  • Document and Schema XML Updates
    361 Chapter 16 Document and Schema XML Updates Dario Colazzo Laboratoire de Recherche en Informatique (LRI-CNRS), Université de Paris-Sud, France Giovanna Guerrini DISI – Università degli Studi di Genova, Italy Marco Mesiti DICo – Università degli Studi di Milano, Italy Barbara Oliboni DI – Università degli Studi di Verona, Italy Emmanuel Waller Laboratoire de Recherche en Informatique (LRI-CNRS), Universite de Paris-Sud, France ABSTRACT Purpose of this chapter is to describe the different research proposals and the facilities of main enabled and native XML DBMSs to handle XML updates at document and schema level, and their versions. Specifically, the chapter will provide a review of various proposals for XML document updates, their different semantics and their handling of update sequences, with a focus on the XQuery Update proposal. Approaches and specific issues concerned with schema updates will then be reviewed. Document and schema versioning will be considered. Finally, a review of the degree and limitations of update support in existing DBMSs will be discussed. INTRODUCTION (W3C, 2004). Both XML native (e.g., Tamino, eXist, TIMBER) and enabled (e.g., Oracle, IBM DB2, SQL XML (W3C, 1998) is nowadays everywhere Server) DBMSs have been so far proposed (Bourret, employed for the representation and exchange of 2007) for storing and querying XML documents. information on the Web. The document structure is Some enabled DBMSs support XML schema for often described through a DTD or an XML schema the specification of a mapping between the XML schema and internal relational or object-relational DOI: 10.4018/978-1-61520-727-5.ch016 representation of XML documents (Florescu & Copyright © 2010, IGI Global.
    [Show full text]
  • Xquery Update
    V. Christophides, I. Fundulaki, CS561 Spring 2010 XQuery Update 1 V. Christophides, I. Fundulaki, CS561 Spring 2010 Why XQuery Update XQuery is a read-only language it can return (compute) an instance of the XQuery Data Model, but it cannot modify an existing instance Applications require reading and updating XML data XQuery Update Facility a candidate recommendation, not yet a standard http://www.w3.org/TR/xquery-update-10/ (June 2009) 2 V. Christophides, I. Fundulaki, CS561 Spring 2010 Requirements for the XQuery Update language Expressive power: 1. Insert 2. Delete 3. Update 4. Copy with new identity Extension of XQuery itself: Simplifies understanding and learning the language Well-defined semantics (kind of) Amenable to efficient implementation 3 V. Christophides, I. Fundulaki, CS561 Spring 2010 XQuery Update Concepts XQuery expressions can be classified into: Updating expressions Non-updating expressions XQuery Update proposal introduces five new kind of expressions: insert, delete, replace, rename: updating expressions transform: non-updating expression 4 V. Christophides, I. Fundulaki, CS561 Spring 2010 XQuery Update Document XQuery Update specifies: how the XQuery syntax is extended to accommodate updates syntax, semantics and processing model for each new updating expression 5 V. Christophides, I. Fundulaki, CS561 Spring 2010 Extending XQuery with Updates 6 V. Christophides, I. Fundulaki, CS561 Spring 2010 Insert Expression Updating expression Syntax SourceExpr evaluates to 0 or more source nodes TargetExpr evaluates
    [Show full text]
  • Xquery 3.0 69 Higher-Order Functions 75 Full-Text 82 Full-Text/Japanese 85 Xquery Update 87 Java Bindings 91 Packaging 92 Xquery Errors 95 Serialization 105
    BaseX Documentation Version 7.2 PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Sat, 24 Mar 2012 17:30:37 UTC Contents Articles Main Page 1 Getting Started 3 Getting Started 3 Startup 4 Startup Options 6 Start Scripts 13 User Interfaces 16 Graphical User Interface 16 Shortcuts 20 Database Server 23 Standalone Mode 26 Web Application 27 General Info 30 Databases 30 Binary Data 32 Parsers 33 Commands 37 Options 50 Integration 64 Integrating oXygen 64 Integrating Eclipse 66 Query Features 68 Querying 68 XQuery 3.0 69 Higher-Order Functions 75 Full-Text 82 Full-Text/Japanese 85 XQuery Update 87 Java Bindings 91 Packaging 92 XQuery Errors 95 Serialization 105 XQuery Modules 108 Cryptographic Module 108 Database Module 113 File Module 120 Full-Text Module 125 HTTP Module 128 Higher-Order Functions Module 131 Index Module 133 JSON Module 135 Map Module 140 Math Module 144 Repository Module 148 SQL Module 149 Utility Module 153 XSLT Module 157 ZIP Module 160 ZIP Module: Word Documents 162 Developing 164 Developing 164 Integrate 165 Git 166 Maven 172 Releases 174 Translations 175 HTTP Services 176 REST 176 REST: POST Schema 184 RESTXQ 185 WebDAV 189 WebDAV: Windows 7 190 WebDAV: Windows XP 192 WebDAV: Mac OSX 195 WebDAV: GNOME 197 WebDAV: KDE 199 Client APIs 201 Clients 201 Standard Mode 202 Query Mode 203 PHP Example 205 Server Protocol 206 Server Protocol: Types 210 Java Examples 212 Advanced User's Guide 214 Advanced User's Guide 214 Configuration 215 Catalog Resolver 216 Statistics 218 Backups 222 User Management 222 Transaction Management 224 Logging 225 Events 226 Indexes 228 Execution Plan 230 References Article Sources and Contributors 231 Image Sources, Licenses and Contributors 233 Article Licenses License 234 Main Page 1 Main Page Welcome to the documentation of BaseX! BaseX [1] is both a light-weight, high-performance and scalable XML Database and an XPath/XQuery Processor with full support for the W3C Update and Full Text extensions.
    [Show full text]