13.07.2015 Views

WWW/Internet - Portal do Software Público Brasileiro

WWW/Internet - Portal do Software Público Brasileiro

WWW/Internet - Portal do Software Público Brasileiro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ISBN: 978-972-8939-25-0 © 2010 IADISSelect the remote resource that attend the following conditions: (i) be connected to the locator whoselabel is “TotalBankingActivities”; and (ii) be the origin of the arc whose element dba_TotalBankingActivitiesSubjectBIAis destiny./d‐ba_TotalBankingActivitiesSubjectBIA::HL::arc‐destination::arc() /LL::arc‐destination::locator()[attribute(xlink:label)=’TotalBankingActivities’]/LL::linked::remote()Execute the link crossing from the element d-ba_BankingActivitiesDomain to the element d-ba_TotalBankingActivities./d‐ba_BankingActivitiesDomain::HL::arc‐source::arc()/HL::arc‐source::remote(d‐a_TotalBankingActivities)ResultQueryandDocumentsFormatterConsoleProcessorExecutorDOMElementStoreExpressionView Controller ModelStepfunction xlpathExecutor (expression, <strong>do</strong>cument)beginelementStore.setContextElement (expression ,<strong>do</strong>cument)return xlpathProcessor (expression, elementStore)endfunction xlpathProcessor (expression, elementStore)beginfor each step : expression.getStepsfor each element : elementStore.getElementssearch element referencesend forend forelementStore.setElements (references)return elementStoreendFigure 6. XLPath processor architecture.Figure 7. XLPath algorithm.These examples show how XLPath perform queries in XML <strong>do</strong>cuments interconnected by XLink. Todemonstrate its usage in a real application, a prototype for XLPath processor was developed in Javalanguage, based on the architecture and algorithm defined in Sections 4.1 and 4.2. Each component of thisarchitecture was modeled in a Java class, and these classes were grouped in packages named Model, Viewand Controller, according to MVC approach. Figure 8 shows the XLPath processor console. This prototype iscomposed by two input data parameters – one for the query expression and another for the <strong>do</strong>cument to bequeried –, besides a field for data output, where the query results are exhibited. Figure 8 illustrates a queryperformed in the <strong>do</strong>cument d-ba-2006-07-01.xsd, Figure 1. This <strong>do</strong>cument contains elements referred by thelink link:definitionLink, which is in a linkbase. During the query execution, the XLPath expression identifiesthese references and, automatically, identifies the corresponding linkbase. This type of query cannot beperformed by the languages XPath, XQuery, or by the proposals discussed in Section 6. Thus, of the maincontribution of XLPath is the ability to perform queries in XML <strong>do</strong>cuments interconnected by extended links.The output data of an XLPath query is organized by the XLPathFormatter class, which shows the stepssequency of the XLPath expression submitted and the respective resulting elements of its processing by theXLPathProcessor class. Figure 9 illustrates XLPath query based on the <strong>do</strong>cument illustrated in Figure 1andthe complete result extracted from the console. In this example, XLPath expression submitted was composedby five steps, to combine low and high level approaches, and, in some cases, making use of predicateoperators to refine the query. Thus, all the mechanisms provided by XLPath could be tested: the specificationof abstraction level, of axis and of element, and the predicate operators.6. LANGUAGES FOR NAVIGATION IN XML DATA WITH LINKSXLPath comes from XPath+ language [Silva et al., 2008 and 2009], which main characteristic is allowingqueries fulfillment over the arcs that compose the links. This language is capable of locating arcs, whetherthey are in an instance, in an XML Schema data scheme, or in a linkbases. The main mechanisms providedby XPath+ are the link-source and link-destination axis. The first selects a list of nodes that has context nodeas a source resource, while the second selects a list of nodes that has the context node as a destiny resource.This semantic is reproduced in XLPath through the arc-source and arc-destination axis, however combinedwith other mechanisms that allow the filtering of the elements obtained as a result of its application.96

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!