Interpreting XPath by Iterative Pattern Matching with Paisley
Recommend Documents
Exact pattern matching in Java. Exact pattern matching is implemented in Java's
String class ..... Ultimate search program for any given pattern: • one statement ...
In this paper, we demonstrate that the performance of a motif ... significantly improves the performance of MEME. ..... written in Perl (Section 2.3 and 2.4). To test ...
Pattern Matching by Sequential Subdivision of Transformation Space. Mingtian Ni and Stephen E. Reichenbach. Department of Computer Science and ...
In this paper, we introduce the University at Albany's question answering system,. ILQUA. It is developed on the following methods: pattern matching over ...
Jan 4, 1990 - The method can also be applied to strict languages giving a match ..... Let T = ftjt3flggand M = fmjT gbe two constrained terms (in fact the last ...
Section 2 briefly introduces graph .... Pattern matching plays a key role in the efficient execution of all model transformation ..... Another solution would be to.
implementation of functional languages like ML, Caml, or Haskell as well as rewrite rule based ... program is a program written in a host language and extended by some new instructions like the %match ...... Standard ML of new jersey.
'qwerty' would yield the 2-gram string 'qw-we-er-rt-ty'. The HG algorithm can be applied to these 2-grams just as it was applied to single characters. With even.
semantics to secure pattern matching in a prototypical security language. Key words:Concurrent Constraint Programming, Process Calculi, Type systems, ... In the present paper we propose a more general solution to representing this kind ... The forego
provide just a few applications of this definition, we could ... They first provided an algorithm of O(nm. 1 ..... by Algorithm 1 given the pattern P = abcd is depicted.
algorithm with O(kn) time and O(mlog m) preprocessing time for a pattern, where m and n are the lengths of pattern and text. For the k-di erence problem, ...
AllMatch gives the all possible variants of patterns in the sequence ... pattern, with shorter pattern instances (generated by INCREMENTAL or ALLMATCH).
Email: {loiseau,prade,boughane}@irit.fr. In the setting of ... Fuzzy sets defined on the same attribute domain ... tern 'cheap and large' in face of a database stor-.
facility can be considered as a natural extension to empower XQuery. In this
paper we first provide some use cases for XML pattern matching. After showing
that current ... While expressing tree patterns is fairly natural in XPath (and XSLT
for.
basis of the degree of linkage between expected and achieved outcomes. In light of this ... al scaling, and cluster anal
In 1970, Knuth, Pratt, and Morris [1] showed how to do basic pattern matching in linear time. Related problems, such as those discussed in [4], have pre-.
BRICS, Basic Research in Computer Science, Centre of the Danish National .... is to associate a unique signature to each string à such that two strings are equal ...
ching algorithm on two-dimensional arrays given by Baker 2] ... solution. This avoids (sometimes complicated) encoding and decoding of datatypes ... This section brie y describes pattern-matching programs on ... decode def tab key, otherwise.
semantic action, which is executed if the given pattern matches the input term. The semantic ... forms matching only at the top position of the input term (see Section 4 and. Section 6.5 for full ... We will give an answer to this question after expl
Needle in a haystack the string matching problem consists of finding a (usually short) string, the pattern , as a substring in a given. (usually very long) string, the ...
e-mail: [email protected],[email protected]. Received: Oct. 1. ... enterprise templates, among which this article deals with design patterns. Our intention is to ...
systems, current development support tools do not provide practical ways to protect applications against ... A common way to remove SQL/XPath Injection vulnerabilities is to separate the query structure from the input data by using parameterized quer
DIVERSE ARTIST. COVERAGE OF. ANY GUITAR. MAGAZINE! In this Issue. THE
SCORPIONS. JOE BONAMASSA. ALLISON ROBERTSON. SHADOWS FALL.
I'm proud to be Scottish and in my 20s during the 'snowflake generation'. I love learning from others. I think that havi
Interpreting XPath by Iterative Pattern Matching with Paisley
restricted use of the imperative host language, thus forming a hybrid object-orientedâfunctionalâlogic ... dard on-board facilities of the host language Java.
Interpreting XPath by Iterative Pattern Matching with Paisley Baltasar Tranc´ on y Widemann12 and Markus Lepper2 1
Ilmenau University of Technology 2 GmbH
Abstract. The Paisley architecture is a light-weight EDSL for non-deterministic pattern matching. It automates the querying of arbitrary objectoriented data models in a general-purpose programming language, using API, libraries and simple programming patterns in a portable and noninvasive way. The core of Paisley has been applied to real-world applications. Here we discuss the extension of Paisley by pattern iteration, which adds a Kleene algebra of pattern function composition to the unrestricted use of the imperative host language, thus forming a hybrid object-oriented–functional–logic framework. We subject it to a classical practical problem and established benchmarks: the node-set fragment of the XPath language for querying W3C XML document object models.
1
Introduction
The Paisley embedded domain-specific language (EDSL) and library adds the more declarative style of pattern matching to the object-oriented context of Java programming [9,10]. Paisley offers a combination of features that is, by our knowledge, not offered by any other existing pattern matching solution for a main-stream language: it is strictly typed, fully compositional, non-invasive and supports non-determinism, full reification and persistence. The non-deterministic aspects of Paisley have been demonstrated to provide a fairly powerful basis for embedded logic programming in the object-oriented host environment. In [11] we have discussed how to solve cryptarithmetic puzzles with the backtracking facilities of Paisley, and how to obtain non-trivial efficient search plans by object-oriented meta-programming with Paisley pattern objects. Here we describe and evaluate recent extensions to Paisley that greatly increase its capabilities as an embedded functional-logic programming system, supporting more complex control and data flow than the combinatorial generate&test tactics of [11]. In particular, the novel contributions are: 1. in the core layer, a calculus of functions on patterns and its Kleene algebra, thus providing regular expressions of nested patterns; 2. in the application layer, a library extension that demonstrates their use by matching W3C XML Document Object Models with XPath [3] expressions; 3. a practical case study that evaluates the approach in comparison with standard on-board facilities of the host language Java.
Variants:
1 .//a[@href]
2 .//p//a[@href]
3 .//p[.//a[@href]]
void collect (int variant, Node node, Collection h Element i results, boolean sideways) { if (node instanceof Element) { Element elem = (Element)node; if (elem.getTagName( ).equals(variant == 1 ? ”a” : ”p”) ) { if (variant > 1) { Collection h Element i sub = variant == 2 ? results : new ArrayListh i ( ); collect(1, elem, sub, false);
} Fig. 1. Three related XML queries. Top: XPath expressions; bottom: Java code.
2
Motivation
The basic motivation for a pattern matching EDSL is that patterns as language constructs make data-gathering code more declarative, and thus more readable, more writable and more maintainable. If done properly, this additional expressive power can be used to factor code compositionally in ways that are not straightforwardly possible in a conventional object-oriented approach, where the logic and data flow of a complex query often appear as cross-cutting concerns. As an example that highlights the issues of logical compositionality, consider a family of three related XPath expressions, depicted in Fig. 1, that select nodes from XHTML documents. The first selects, from the context node and its descendants, all elements (hyperlink anchors) that have a href (target) attribute specified. The second selects only those elements with href attributes that are nested within