A Grailog Visualizer for Datalog Ruleml Via XSLT 2.0 Translation to SVG

Total Page:16

File Type:pdf, Size:1020Kb

A Grailog Visualizer for Datalog Ruleml Via XSLT 2.0 Translation to SVG University of New Brunswick Faculty of Computer Science CS 6795 Semantic Web Techniques A Grailog Visualizer for Datalog RuleML via XSLT 2.0 Translation to SVG Project Proposal Team 1: Martin Koch Sven Schmidt [email protected] [email protected] October 29, 2012 Advisor: Dr. Harold Boley Contents 1 Introduction 1 2 Objectives 1 3 Methodology 2 4 Languages / Tools 4 4.1 Datalog RuleML . 4 4.2 Grailog . 5 4.3 Scalable Vector Graphics (SVG) 1.1 . 5 4.4 XSL Transformations (XSLT) Version 2.0 . 5 ii List of Figures 2.1 The translation takes place one at a time (normalization sequence) [3] . 2 3.1 (Current) Mapping of Datalog RuleML to Grailog, i.e. subset to subset [3] . 3 4.1 The left side shows a Datalog RuleML rule visualized as Order-Labeled (OrdLab) Tree. On the right side is shown the corresponding XML code of the rule. [1] . 4 iii 1 Introduction Datalog RuleML [1, 5] is a n-ary, rule based markup language that is a sublanguage of the RuleML family [4]. Because of its usage for artificial intelligence (AI) and the Semantic Web, it is built with a format that is more suitable for machine readability than for human read- ability. In spite of making the Datalog RuleML language more human readable, one natural approach is to transform its knowledge base, consisting of facts, rules and queries, in a suit- able way. One solution to that is to create a visualized representation of the knowledge base, because of the fact that humans naturally better understand a well developed visualization (abstraction) than a heavy bulk of text or code. Therefore, the final goal is to create a suf- ficient visualization, which is much easier to read, learn and remember. One of such well developed approaches for visualizing major (Semantic Web) logics is Graph inscribed logic invokes imagery for logic (Grailog) [3]. It describes the mapping for several defined graph constructs to each corresponding symbolic logic construct of the considered knowledge base, which leads to a better human readability. At this point, it seems likely, to try to automatize this transformation as far as possible, so that finally each Datalog RuleML knowledge base can be easily visualized as a Grailog representation. 2 Objectives The final result of the project should be an initial version of a so called ’Grailog Visual- izer’. This tool should handle the task described above, i.e. the transformation from Datalog RuleML to a visualized SVG Grailog representation. The tool will be open source in its final version and it will be available on the Web, accessible from the RuleML and the Grailog sites. The main objective of the project is to define a mapping from Datalog RuleML, written in Extensible Markup Language (XML) [9], to Scalable Vector Graphics (SVG) [6, 9], also written in XML. This will be realized by using eXtensible Stylesheet Language Transformations 2.0 (XSLT 2.0) [7], a language that permits translations from a XML source document to a newly generated XML document. By implementing different elements in the XSLT 2.0 XML document, each Datalog RuleML fact, (as resources permits) rule and query in XML, will be automatically translated to its corresponding SVG elements in XML. This will be done one element at a time, as shown in Figure 2.1, to avoid highly complex layouting issues in the SVG part of the project. So, for example, no ‘merging’ of box copies has to been handled. The resulting SVG elements, which are based on a distinct Grailog subset can than be used for rendering. To put it all in a nutshell, the Grailog Visualizer translates Datalog’s n-ary relationships to Grailog’s directed hyperarc arrows, that connect the argument-box nodes. The resulting Grailog representation of the Datalog RuleML source document can than finally be rendered by using suitable tools, for example one of the recent major web browsers. For this initial version, the assumption is made that the source documents only consist of Datalog RuleML knowledge bases and queries. The resulting visualization will be in a ‘fully 1 Figure 2.1: The translation takes place one at a time (normalization sequence) [3] node copied’ normal form, which means that the separation of clauses of the symbolic form in the Datalog RuleML source document is also kept in the resulting graphic form of the SVG Grailog representation. 3 Methodology Before the implementation part of the project can be started, it is essential to analyze and completely understand the mapping between the Datalog RuleML symbolic subset and the associated Grailog subset. At the same time, the necessary knowledge about SVG and XSLT 2.0 has to be acquired. The chosen subset of Grailog has to be represented in a suitable subset of SVG, using XML. This leads to combinations of several individual graphical elements, for example the different arrows and rectangles of the Grailog visualization. To create these different graphical objects, SVG provides many basic elements, like paths, lines or polylines, which can for example be used for parts of the arrows. To represent the nodes, different rectangle variants of SVG can be used. The so far considered subset of Grailog is shown in Figure 3.1. The subset that will finally be used by the tool may change to some extent. In the next step, the mapping from RuleML to SVG will be defined, using XSLT 2.0. Each element of Datalog RuleML, facts, (as resources permits) rules and queries will be translated in its corresponding graphical element, one at a time. This part of the project mainly depends on the SVG part before, but nevertheless it should be possible to implement both parts nearly in parallel, by using simple temporary graphical SVG elements for the transformation process, which can be replaced by its actual counterparts further in the project. For now, the mapping consists of five major parts, mapping individual constants and variables, mapping binary relations, mapping n-ary relations, mapping single-premise rules and mapping multi-premise rules. If resources permit, the mapping of queries will be considered, too. The current mapping can be seen in Figure 3.1. The final result of the implemented transformation process should be an automatically gener- ated SVG document, which can then be used for rendering the Grailog representation of the given Datalog RuleML knowledge base. To proof the reliability of the transformation process, different kinds of source documents (in the range of the made assumptions) will be translated, the results will be evaluated and possible further improvements will be discussed. 2 Figure 3.1: (Current) Mapping of Datalog RuleML to Grailog, i.e. subset to subset [3] 3 4 Languages / Tools For this project, the rule language Datalog RuleML will be used as the language of the con- sidered rules which should be visualized via Grailog. Grailog itself provides the systematics for visualizing the logic knowledge representation as generalized graphs. For the implemen- tation and the rendering of the visualization, the modularized language for describing two- dimensional vector and mixed vector/raster graphics in XML, SVG will be used. The trans- formation language XSLT 2.0 provides the necessary tools to perform the transformation from the Datalog RuleML knowlegde bases and queries to the SVG Grailog visualization. In the following, each language/tool will be illustrated shortly. 4.1 Datalog RuleML RuleML is a family of rule based languages, which are used for sharing rule bases written in XML and publishing them on the Web. Datalog RuleML is one rule sublanguage of RuleML, based on the Datalog logic. Moreover, Datalog is the semantic foundation of RuleML and can be seen as an intersection of SQL and Prolog [1]. Datalog is used to define facts and rules and therefore is used to create logic knowledge bases and queries. One simple Datalog RuleML logic relation can be seen in Figure 4.1. It describes the logic relation that a customer is premium, if the customer has spent at least 5000 euros in the previous year. The XML code, the rule is written in, is exactly the code that will be translated to Grailog by the Grailog Visualizer. The graph on the left side of the figure is an Ordered-Labeled (OrdLab) Tree. This representation of the rule is another visualization approach, prior to Grailog. Figure 4.1: The left side shows a Datalog RuleML rule visualized as Order-Labeled (OrdLab) Tree. On the right side is shown the corresponding XML code of the rule. [1] 4 4.2 Grailog Grailog describes systematics to visualize knowledge representations with graphical elements. Each of the introduced graphical elements is mapped to its corresponding symbolic logic construct. The benefit of Grailog is that its resulting visual representations of knowledge sources are much easier to read for humans than the original source code is. Moreover, the rules for the transformation are easy to learn and to remember. One principle of Grailog is that the used graphs should be natural extensions of Directed La- beled Graphs (DLGs). Another principle dictates that the used Graphs should allow stepwise refinements for logic constructs, like Description Logic constructors or general PSOA RuleML terms. These principles all support the main goal of Grailog, namley easy understanding and application of the systematics. Another major part of Grailogs visualization elements are the directed hypergraphs. These are used for dealing with n-ary relationships, Datalog RuleML (in contrast to Datalog) is capable of. Examples of the different Grailog elements can be seen in Figure 3.1. 4.3 Scalable Vector Graphics (SVG) 1.1 With the languague SVG, two-dimensional graphics, both static and dynamic (i.e., interactive or animated) can be described in XML.
Recommended publications
  • Open Source Software Used in Cisco Unified Web and E-Mail Interaction
    Open Source Used In EIM/WIM 9.0(1) This document contains the licenses and notices for open source software used in this product. With respect to the free/open source software listed in this document, if you have any questions or wish to receive a copy of the source code to which you are entitled under the applicable free/open source license(s) (such as the GNU Lesser/General Public License), please contact us at [email protected]. In your requests please include the following reference number 78EE117C99-32799394 Contents 1.1 Apache Log4J 1.2.15 1.1.1 Available under license 1.2 Ext JS 3.4.0 1.2.1 Available under license 1.3 JBoss Application Server 7.1.2 1.3.1 Available under license 1.4 JForum 2.1.8 1.4.1 Available under license 1.5 XML Parser for Java-Xalan 1.4.1 1.5.1 Available under license 1.6 XML Parser for Java-Xerces 1.4.1 1.6.1 Available under license Open Source Used In EIM/WIM 9.0(1) 1 1.1 Apache Log4J 1.2.15 1.1.1 Available under license : Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
    [Show full text]
  • SVG Tutorial
    SVG Tutorial David Duce *, Ivan Herman +, Bob Hopgood * * Oxford Brookes University, + World Wide Web Consortium Contents ¡ 1. Introduction n 1.1 Images on the Web n 1.2 Supported Image Formats n 1.3 Images are not Computer Graphics n 1.4 Multimedia is not Computer Graphics ¡ 2. Early Vector Graphics on the Web n 2.1 CGM n 2.2 CGM on the Web n 2.3 WebCGM Profile n 2.4 WebCGM Viewers ¡ 3. SVG: An Introduction n 3.1 Scalable Vector Graphics n 3.2 An XML Application n 3.3 Submissions to W3C n 3.4 SVG: an XML Application n 3.5 Getting Started with SVG ¡ 4. Coordinates and Rendering n 4.1 Rectangles and Text n 4.2 Coordinates n 4.3 Rendering Model n 4.4 Rendering Attributes and Styling Properties n 4.5 Following Examples ¡ 5. SVG Drawing Elements n 5.1 Path and Text n 5.2 Path n 5.3 Text n 5.4 Basic Shapes ¡ 6. Grouping n 6.1 Introduction n 6.2 Coordinate Transformations n 6.3 Clipping ¡ 7. Filling n 7.1 Fill Properties n 7.2 Colour n 7.3 Fill Rule n 7.4 Opacity n 7.5 Colour Gradients ¡ 8. Stroking n 8.1 Stroke Properties n 8.2 Width and Style n 8.3 Line Termination and Joining ¡ 9. Text n 9.1 Rendering Text n 9.2 Font Properties n 9.3 Text Properties -- ii -- ¡ 10. Animation n 10.1 Simple Animation n 10.2 How the Animation takes Place n 10.3 Animation along a Path n 10.4 When the Animation takes Place ¡ 11.
    [Show full text]
  • Configurable Editing of XML-Based Variable-Data Documents John Lumley, Roger Gimson, Owen Rees HP Laboratories HPL-2008-53
    Configurable Editing of XML-based Variable-Data Documents John Lumley, Roger Gimson, Owen Rees HP Laboratories HPL-2008-53 Keyword(s): XSLT, SVG, document construction, functional programming, document editing Abstract: Variable data documents can be considered as functions of their bindings to values, and this function could be arbitrarily complex to build strongly-customised but high-value documents. We outline an approach for editing such documents from example instances, which is highly configurable in terms of controlling exactly what is editable and how, capable of being used with a wide variety of XML-based document formats and processing pipelines, if certain reasonable properties are supported and can generate appropriate editors automatically, including web- service deployment. External Posting Date: October 6, 2008 [Fulltext] Approved for External Publication Internal Posting Date: October 6, 2008 [Fulltext] Published and presented at DocEng’08, September 16-19, 2008, São Paulo, Brazil © Copyright 2008 ACM Configurable Editing of XML-based Variable-Data Documents John Lumley, Roger Gimson, Owen Rees Hewlett-Packard Laboratories Filton Road, Stoke Gifford BRISTOL BS34 8QZ, U.K. {john.lumley,roger.gimson,owen.rees}@hp.com ABSTRACT al form of the final document (WYSIWYG rather than declaring Variable data documents can be considered as functions of their intent such as using LaTeX), but when the document is highly vari- bindings to values, and this function could be arbitrarily complex able and there are very many different possible instances, how to to build strongly-customised but high-value documents. We outline do this is not immediately obvious. an approach for editing such documents from example instances, We were also keen to consider that, especially in complex commer- which is highly configurable in terms of controlling exactly what ical document workflows, there may be many distinctly different is editable and how, capable of being used with a wide variety of roles of ‘editor’ and ‘author’ for such documents.
    [Show full text]
  • Stylesheet Translations of SVG to VML
    Stylesheet Translations of SVG to VML A Master's Project presented to The Faculty of the Department of Computer Science San Jose State University In Partial Fulfillment of the Requirements for the Degree of Master of Science Julie Nabong Advisor: Dr. Chris Pollett May 2004 Abstract The most common graphics formats on the Web today are JPEG and GIF. In addition to these formats, two XML-based graphic types are available as open standards: SVG and VML. SVG and VML are vector graphic formats. These formats offer benefits such as fast Web download time, zoomable images, and searchable texts. Because these vector graphics are scalable, these images can be viewed in different screen sizes, such as PC displays and handheld devices. SVG and VML implementations are gaining popularity in Internet cartography and zoomable charts. SVG images can be viewed by downloading a plug-in; whereas, VML images are rendered in Microsoft's Internet Explorer browser versions 5.0 and higher. Although SVG may be considered a more mature format than VML, it is unlikely it will be supported natively by Microsoft anytime soon. In this master's project, SVG images will be transformed into VML images contained in an HTML document that can be viewed without a plug-in. SVG images will be manipulated through the Document Object Model API and transformed into VML images using JavaScript, XSLT, and XPath. JavaScript will play an important role in handling functionalities not present in XSLT. This project will address the issue of gradient discrepancies between the two formats, and try to get the speed of the translation as close to that of the plug-in based solution as possible.
    [Show full text]
  • SVG-Based Knowledge Visualization
    MASARYK UNIVERSITY FACULTY}w¡¢£¤¥¦§¨ OF I !"#$%&'()+,-./012345<yA|NFORMATICS SVG-based Knowledge Visualization DIPLOMA THESIS Miloš Kaláb Brno, spring 2012 Declaration Hereby I declare, that this paper is my original authorial work, which I have worked out by my own. All sources, references and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Advisor: RNDr. Tomáš Gregar Ph.D. ii Acknowledgement I would like to thank RNDr. Tomáš Gregar Ph.D. for supervising the thesis. His opinions, comments and advising helped me a lot with accomplishing this work. I would also like to thank to Dr. Daniel Sonntag from DFKI GmbH. Saarbrücken, Germany, for the opportunity to work for him on the Medico project and for his supervising of the thesis during my erasmus exchange in Germany. Big thanks also to Jochen Setz from Dr. Sonntag’s team who worked on the server background used by my visualization. Last but not least, I would like to thank to my family and friends for being extraordinary supportive. iii Abstract The aim of this thesis is to analyze the visualization of semantic data and sug- gest an approach to general visualization into the SVG format. Afterwards, the approach is to be implemented in a visualizer allowing user to customize the visualization according to the nature of the data. The visualizer was integrated as an extension of Fresnel Editor. iv Keywords Semantic knowledge, SVG, Visualization, JavaScript, Java, XML, Fresnel, XSLT v Contents Introduction . .3 1 Brief Introduction to the Related Technologies ..........5 1.1 XML – Extensible Markup Language ..............5 1.1.1 XSLT – Extensible Stylesheet Lang.
    [Show full text]
  • Pearls of XSLT/Xpath 3.0 Design
    PEARLS OF XSLT AND XPATH 3.0 DESIGN PREFACE XSLT 3.0 and XPath 3.0 contain a lot of powerful and exciting new capabilities. The purpose of this paper is to highlight the new capabilities. Have you got a pearl that you would like to share? Please send me an email and I will add it to this paper (and credit you). I ask three things: 1. The pearl highlights a capability that is new to XSLT 3.0 or XPath 3.0. 2. Provide a short, complete, working stylesheet with a sample input document. 3. Provide a brief description of the code. This is an evolving paper. As new pearls are found, they will be added. TABLE OF CONTENTS 1. XPath 3.0 is a composable language 2. Higher-order functions 3. Partial functions 4. Function composition 5. Recursion with anonymous functions 6. Closures 7. Binary search trees 8. -- next pearl is? -- CHAPTER 1: XPATH 3.0 IS A COMPOSABLE LANGUAGE The XPath 3.0 specification says this: XPath 3.0 is a composable language What does that mean? It means that every operator and language construct allows any XPath expression to appear as its operand (subject only to operator precedence and data typing constraints). For example, take this expression: 3 + ____ The plus (+) operator has a left-operand, 3. What can the right-operand be? Answer: any XPath expression! Let's use the max() function as the right-operand: 3 + max(___) Now, what can the argument to the max() function be? Answer: any XPath expression! Let's use a for- loop as its argument: 3 + max(for $i in 1 to 10 return ___) Now, what can the return value of the for-loop be? Answer: any XPath expression! Let's use an if- statement: 3 + max(for $i in 1 to 10 return (if ($i gt 5) then ___ else ___))) And so forth.
    [Show full text]
  • Create an HTML Output from Your Own Project with XSLT
    Create an HTML output from your own project with XSLT Martina Semlak - Georg Vogeler IDE Spring School 2015, Graz Folie 2 IDE Spring School 2015, Graz Minimal stuff provided <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0"> <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" /> </xsl:stylesheet> Folie 3 IDE Spring School 2015, Graz First step Grab file xsl:template with the attribute: match="/" This template can contain the basic HTML structure of the ouput file Folie 4 IDE Spring School 2015, Graz HTML basics – Reminder <html> <head><title></title><link (e.g. for a css)></head> <body></body> </html> We added this into <xsl:template match="/"> </xsl:template> Folie 5 IDE Spring School 2015, Graz Display text We have prepared basic HTML structure for you: header, section, nav > ul = navigation with references to other files We need a heading for the whole text: html: section > h3 xsl: xsl:value-of, attribute select with the appropriate xpath: //body/head div seems to be convenient to retain: do something with all divs: <xsl:apply-templates select="//body/div"/> what to do: <xsl:template match="div"> <div><xsl:apply-templates /></div> </xsl:template> Folie 6 IDE Spring School 2015, Graz XPath conditions Use a condition in the XPath (square brackets) for html: body/header > h1 and h2: find the appropriate title-element with type main or sub <h1> <xsl:value-of select="//title[@type='main']"/> </h1> Folie 7 IDE Spring School 2015, Graz <apply-templates />: individual templates xsl:template match="lg" div class="stanza" xsl:template match="l" <br/>..
    [Show full text]
  • Xpath and Xquery
    XPath and XQuery Patryk Czarnik Institute of Informatics University of Warsaw XML and Modern Techniques of Content Management – 2012/13 . 1. Introduction Status XPath Data Model 2. XPath language Basic constructs XPath 2.0 extras Paths 3. XQuery XQuery query structure Constructors Functions . 1. Introduction Status XPath Data Model 2. XPath language Basic constructs XPath 2.0 extras Paths 3. XQuery XQuery query structure Constructors Functions . XPath XQuery . Used within other standards: Standalone standard. XSLT Main applications: XML Schema XML data access and XPointer processing XML databases . DOM . Introduction Status XPath and XQuery Querying XML documents . Common properties . Expression languages designed to query XML documents Convenient access to document nodes Intuitive syntax analogous to filesystem paths Comparison and arithmetic operators, functions, etc. Patryk Czarnik 06 – XPath XML 2012/13 4 / 42 Introduction Status XPath and XQuery Querying XML documents . Common properties . Expression languages designed to query XML documents Convenient access to document nodes Intuitive syntax analogous to filesystem paths Comparison and arithmetic operators, functions, etc. XPath XQuery . Used within other standards: Standalone standard. XSLT Main applications: XML Schema XML data access and XPointer processing XML databases . DOM . Patryk Czarnik 06 – XPath XML 2012/13 4 / 42 . XPath 2.0 . Several W3C Recommendations, I 2007: XML Path Language (XPath) 2.0 XQuery 1.0 and XPath 2.0 Data Model XQuery 1.0 and XPath 2.0 Functions and Operators XQuery 1.0 and XPath 2.0 Formal Semantics Used within XSLT 2.0 Related to XQuery 1.0 . Introduction Status XPath — status . XPath 1.0 . W3C Recommendation, XI 1999 used within XSLT 1.0, XML Schema, XPointer .
    [Show full text]
  • Session 2: Markup Language Technologies
    XML for Java Developers G22.3033-002 Session 2 - Main Theme Markup Language Technologies (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Agenda Summary of Previous Session / Review New Syllabus XML Applications vs. Applications of XML!? History and Current State of XML Standards Advanced Applications of XML XML’s eXtensible Style Language (XSL) Character Encodings and Text Processing XML and DBMSs Course Approach ... XML Application Development XML References and Class Project Readings Assignment #1a (due today - reminder?) 2 Assignment #1b (due next week) 1 Summary of Previous Session XML Generics Course Logistics, Structure and Objectives History of Meta-Markup Languages XML Applications: Markup Languages XML Information Modeling Applications XML-Based Architectures XML and Java XML Development Tools (XML, DTD and Schema Editors) Summary Class Project Readings Assignment #1a 3 Old History Formatting Markups Rendition notations (e.g., LaTeX, TeX, RTF, MIF) Compatible with standard text editors Processed into presentations (printout, or electronic display) WYSIWYG What You See Is “ALL” You Get Meta-Markup Language GML (Goldfarb, Mosher, Lorie - IBM 1969) Generalized (i.e., indep. of systems, devices, applications) Markups (i.e., information related to struct. & content Language (i.e., methodology with formal syntax) Validation capabilities (1974) 4 2 SGML SGML (1978 - 10/15/86) Used by DoD for Continuous Acquisition and Lifecycle Support (CALS) http://www.oasis-open.org/cover/general.html SGML DTD or Schema <!DOCTYPE tutorials [ <!ELEMENT tutorials – (tutorial+)> <!ELEMENT tutorial – (title, intro, chap+)> <!ELEMENT title – O (#PCDATA)> <!ELEMENT intro – O (para+)> <!ELEMENT chap – O (title, para+)> <!ELEMENT para – O (#PCDATA)> ]> 5 SGML Markup <tutorials> <tutorial> <title>XML TUTORIAL <intro> <para>Required first paragraph of intro.
    [Show full text]
  • A Proposal for XSLT
    A Proposal for XSLT 4.0 Michael Kay Saxonica <[email protected]> Abstract This paper defnes a set of proposed extensions to the XSLT 3.0 language [18], suitable for inclusion in version 4.0 of the language were that ever to be defned. The proposed features are described in sufcient detail to enable the functionality to be understood and assessed, but not in the microscopic detail needed for the eventual language specifcation. Brief motivation is given for each feature. The ideas have been collected by the author both from his own experience in using XSLT 3.0 to develop some sizable applications (such as an XSLT compiler: see [4], [3]), and also from feedback from users, reported either directly to Saxonica in support requests, or registered on internet forums such as StackOverfow. 1. Introduction The W3C is no longer actively developing the XSLT and XPath languages, but this does not mean that development has to stop. There is always the option of some other organisation taking the language forward; the W3C document license under which the specifcation is published 1 explicitly permits this, though use of the XSLT name might need to be negotiated. This paper is a sketch of new features that could be usefully added to the lan- guage, based on experience and feedback from users of XSLT 3.0. XSLT 3.0 (by which I include associated specifcations such as XPath 3.1) intro- duced some major innovations [18]. A major theme was support for streaming, and by and large that aspect of the specifcation proved successful and complete; I have not felt any need to propose changes in that area.
    [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]
  • Python, XML and Webservices
    Introduction to XML 2004 CERN School of Computing, Vico Equense Andreas Pfeiffer CERN, PH/SFT [email protected] CERN School of Computing 2004 1 XML eXtensible Markup Language [email protected] CERN School of Computing 2004 2 Overview XML – what it (not) is XML syntax DTD – describing XML documents Related technologies [email protected] CERN School of Computing 2004 3 XML – what it is (not) XML is a markup language and only a markup language Not a programming language ! No “compiler” for XML Not a network protocol ! Not a database either ! [email protected] CERN School of Computing 2004 4 XML – what it is (Meta) Data description language E.g., config files Extensible – you can add your own “words” Simple, well-documented data format Truly cross-platform Ideal for long-term storage Text file Unicode (ASCII or other) encoding [email protected] CERN School of Computing 2004 5 Meta Markup Language No fixed set of tags and elements Just a couple of “special characters” which are to avoid (using escape sequences) Users can define their own specific “language” Document Type Definition (DTD) Huge flexibility, very powerful Namespaces to avoid conflicts [email protected] CERN School of Computing 2004 6 XML syntax: Tags Start tags begin with “<” End tags begin with “</” Tags are closed by “>” Empty elements are closed by “/>” Case sensitive Names of tags reflect the type of content, not formatting information Comments like in HTML <!-- this is a comment --> The double hyphen -- should not appear anywhere
    [Show full text]